I need some help replacing a couple of smaller drives with another couple of bigger ones, while maintaining the same ZFS filesystem but enlarging the pool and also switching to EFI boot.
This is on PVE 6.4 in preparation for upgrading to 7.
This is what /dev/sda and /dev/sdb look like right now:
Device Start End Sectors Size Type
/dev/sda1 34 2047 2014 1007K BIOS boot
/dev/sda2 2048 1952432093 1952430046 931G Solaris /usr & Apple ZFS
/dev/sda9 1952432094 1952448478 16385 8M Solaris reserved 1
NAME STATE READ WRITE CKSUM
rpool ONLINE 0 0 0
mirror-0 ONLINE 0 0 0
sda2 ONLINE 0 0 0
sdb2 ONLINE 0 0 0
The steps that I think need to be done are as follows:
This is on PVE 6.4 in preparation for upgrading to 7.
This is what /dev/sda and /dev/sdb look like right now:
Device Start End Sectors Size Type
/dev/sda1 34 2047 2014 1007K BIOS boot
/dev/sda2 2048 1952432093 1952430046 931G Solaris /usr & Apple ZFS
/dev/sda9 1952432094 1952448478 16385 8M Solaris reserved 1
NAME STATE READ WRITE CKSUM
rpool ONLINE 0 0 0
mirror-0 ONLINE 0 0 0
sda2 ONLINE 0 0 0
sdb2 ONLINE 0 0 0
The steps that I think need to be done are as follows:
- Connect the bigger drives to the machine (/dev/sdc and /dev/sdd) and create GPT partition tables on them
- Partition the drives like this: (structure taken from a fresh install of a PVE 7 machine in EFI mode)
- first partition:
- start sector: 34
- end sector: 2047
- change partition type to 4 (BIOS boot)
- NOTE: is this really necessary if I'm only going to boot in EFI mode? Also, how do I actually start at sector 34? fdisk won't let me start below 2048
- second partition
- start sector: 2048
- end sector: 1050623
- change partition type to 1 (EFI system)
- third partition
- start sector: 1050624
- end sector: last sector minus a few megabytes worth of sectors
- change partition type to 48 (Solaris /usr & Apple ZFS)
- first partition:
- Add the two new partitions to rpool
- first check if autoexpand is on for rpool
- zpool get autoexpand rpool
- if it's off, then set it to on
- zpool set autoexpand=on rpool
- now add one of the partitions from the new drives to the mirror
- zpool attach rpool /dev/sda2 /dev/sdc3
- wait for rpool to resilver (check with: zpool status rpool) and attach the remaining partition to rpool
- zpool attach rpool /dev/sda2 /dev/sdd3
- first check if autoexpand is on for rpool
- What do I need to do to the first partitions (BIOS boot) from the new drives? I need help here.
- The EFI system partitions need to be formatted as FAT32
- mkfs.fat -F 32 /dev/sdc2
- mkfs.fat -F 32 /dev/sdd2
- Populate the EFI system partitions and write bootloaders
- I really need help with this step
- Boot in EFI mode for the first time
- reboot, go into the BIOS and set the boot mode to UEFI and the first and second boot devices to be the two big drives (sdc & sdd)
- Assuming the machine booted fine, now it's time to remove the small drives from the ZFS array
- check first that the array is all synced up with: zpool status rpool
- optional: scrub the zfs pool to make sure the data is fine on the new drives before removing the old ones: zpool scrub rpool
- remove the old drives from the pool
- zpool detach rpool /dev/sda2
- zpool detach rpool /dev/sdb2
- At this point all that's left to do is shut down the machine and remove the old drives.