Today, I am practicing the replacement of a boot disk in an encrypted mirrored setup.
I know how to restore the partition table and ZFS drive using these commands:
For the mirrored swap, it has nothing to do with /etc/fstab, just use gmirror.
However, I am unsure about restoring the EFI and freebsd-boot type partitions.
For the EFI partition, can I simply mount the good EFI partition and the new EFI partition, and then rsync everything to the new one? Similarly, can I do the same for the freebsd-boot type partition?
Any guidance or tips would be greatly appreciated!
Thanks in advance!
I know how to restore the partition table and ZFS drive using these commands:
Code:
# Backup the partition table
gpart backup da0 > da0.gpart
# Restore the partition table to the new disk
gpart restore da1 < da0.gpart
# Create encrypted partition
geli init -b -e "AES-XTS" -l 256 -s 4096 da1p4
# Attach the encrypted partition
geli attach da1p4
# Check the zpool status
zpool status zroot
# Offline broken vdev
zpool offline zroot da1p4.eli
# Check if vdev is offline
zpool status zroot
# Replace the broken with the new one
zpool replace zroot da1p4.eli da1p4.eli
# Check the zpool status, should be resilvering
zpool status zroot
For the mirrored swap, it has nothing to do with /etc/fstab, just use gmirror.
Code:
# Check gmirror status
gmirror status
# Forget the broken swap partition
gmirror forget swap
# Insert the new swap partition into the mirrored swap
gmirror insert swap da1p3
# Check gmirror status, should be SYNCHRONIZING
gmirror status
However, I am unsure about restoring the EFI and freebsd-boot type partitions.
For the EFI partition, can I simply mount the good EFI partition and the new EFI partition, and then rsync everything to the new one? Similarly, can I do the same for the freebsd-boot type partition?
Any guidance or tips would be greatly appreciated!
Thanks in advance!