[tech] Backups
David Adam
zanchey at ucc.gu.uwa.edu.au
Thu Jul 18 09:43:19 AWST 2019
On Thu, 11 Jul 2019, David Adam wrote:
> However, I discovered the PERC 5/i in the machine *can* resize the RAID -
> online, even! - and it is currently doing so using this awful series of
> commands:
>
> Delete the old single-disk array, virtual disk 1 on adapter 0 with:
> # megacli -CfgLdDel -L1 -a0
> Start a reconfiguration operation on a RAID-5 array adding the new disk
> (disk numbers from the incredibly useful megaclisas-status tool) to
> virtual disk 0 on adapter 0:
> # megacli -LDRecon -Start -r5 -Add -PhysDrv '[8:2]' -L0 -a0
> Watch paint dry^W^W the array rebuild with:
> # megacli -LDRecon -ProgDsply -L0 -a0
This finally finished - it took about five days to first rebuild then
initialise.
> This is likely to take some hours so I have disabled the backups for now
> by commenting them out in the "backups" user crontab.
I have reversed this change and the backups will run as usual at 0200.
> Mollitz itself is not backed up (except locally), so /backups/conf
> probably needs putting into git or similar.
I have not done this.
> Once it's done I will resize the partition, LVM volume and the filesystem.
I've done this. I rescanned the device with:
# echo 1 > /sys/block/sda/device/rescan
The partition table then needs fixing for the new size;
https://serverfault.com/a/833738/ was helpful here as fdisk spat out the
error "MyLBA mismatch with real position at backup header."
I installed gdisk, ran `gdisk /dev/sda`, entered expert mode ('x'), ran
the command to 'relocate backup data structures to the end of the disk'
('e'), and wrote the partition table with 'w'.
(I also changed the partition type from "Microsoft basic data" (0700) to
"Linux LVM" (8e00), though that wasn't essential).
Then I ran partprobe as
# partprobe
I unmounted the /backups array, used parted to resize the partition, and
then ran the LVM command to expand the PV, LV and filesystem:
# pvresize /dev/sda1
# lvresize --extents +100%FREE --resizefs backups/uccbackups
Then mounted it again, and restored the backups crontab.
David Adam
zanchey at ucc.gu.uwa.edu.au
More information about the tech
mailing list