Hello,
Doing this for a first time on live system, so please correct me if I'm doing something wrong. Also doing this on remote system, and it is quite hard to get there.
System description:
rootfs on zfs, only 2 disks, mirror
Disks: /dev/ada0, /dev/ada1(new disk, old disk not spinning, replaced)
Here is what I would like to do to restore system functionality
1. Clone partition table:
2. put bootcode on a new disk:
3. replace disk in zfs:
then wait for resilver...
Doing this for a first time on live system, so please correct me if I'm doing something wrong. Also doing this on remote system, and it is quite hard to get there.
System description:
rootfs on zfs, only 2 disks, mirror
Disks: /dev/ada0, /dev/ada1(new disk, old disk not spinning, replaced)
Code:
# zpool status
zroot DEGRADED 0 0 0
mirror-0 DEGRADED 0 0 0
ada0p3 ONLINE 0 0 0
9258811949525251908 REMOVED 0 0 0 was /dev/ada1p3
# gpart show
=> 40 1953525088 ada0 GPT (932G)
40 1024 1 freebsd-boot (512K)
1064 984 - free - (492K)
2048 16777216 2 freebsd-swap (8.0G)
16779264 1936744448 3 freebsd-zfs (924G)
1953523712 1416 - free - (708K)
Here is what I would like to do to restore system functionality
1. Clone partition table:
# gpart backup ada0 | gpart restore -F /dev/ada1
2. put bootcode on a new disk:
# gpart bootcode -b /boot/pmbr -p /boot/gptzfsboot -i 1 /dev/ada1
3. replace disk in zfs:
# zpool replace zroot 9258811949525251908 /dev/ada1p3
then wait for resilver...