Note:This procedure will be applicable only if you are using zfs for root and sending the rpool snapshot periodically to NAS location.
First we will see how to recover SPARC based machines.First boot the system via network if you are already have jump-start server or boot if from OS DVD.
ok boot net -s
or
ok boot cdrom -s
2) Mount the NFS share with the snapshots:
# mount -F nfs nfs-server:/path_to_directory /mnt
3) Recreate the root pool:
# zpool create -f -o failmode=continue -R /a -o cachefile=/etc/zfs/zpool.cache rpool mirror c1t0d0s0 c1t1d0s0
# zpool set autoreplace=on rpool
4) Restore the snapshots:
# cd /mnt
# zfs receive -Fd rpool < hostname.rpool.20120711.zfs
# zfs receive -Fd rpool < hostname.dataset.20120711.zfs
5) Verify snapshot was restored:
# zfs list
6) Create swap and dump volumes:
# zfs create -V 8g rpool/dump
# zfs set refreservation=none rpool/dump
# zfs set checksum=off rpool/dump
# zfs create -V 8g rpool/swap
7) Set pool bootfs property:
# zpool set bootfs=rpool/ROOT/dataset rpool
# zfs set canmount=noauto rpool/ROOT/dataset
# zfs set mountpoint=/ rpool/ROOT/dataset
# zfs set mountpoint=/rpool rpool
8) Install ZFS bootblk:
# installboot -F zfs /usr/platform/`uname -i`/lib/fs/zfs/bootblk /dev/rdsk/c1t0d0s0
# installboot -F zfs /usr/platform/`uname -i`/lib/fs/zfs/bootblk /dev/rdsk/c1t1d0s0
9) Reboot the system:
# umount /mnt
# init 6
Upon bootup, the system may appear to hang after printing the hostname. The system
# zfs list |grep @
# zfs destroy -r rpool@XXXXXXXXX
# zpool create -f -o failmode=continue -R /a -o cachefile=/etc/zfs/zpool.cache rpool mirror c1t0d0s0 c1t1d0s0
# zpool set autoreplace=on rpool
# cd /mnt
# zfs receive -Fd rpool < hostname.rpool.20120711.zfs
# zfs receive -Fd rpool < hostname.dataset.20120711.zfs
5.Verify snapshot was restored:
# zfs list
6.Create swap and dump volumes:
# zfs create -V 8g rpool/dump
# zfs set refreservation=none rpool/dump
# zfs set checksum=off rpool/dump
# zfs create -V 8g rpool/swap
7.Set pool bootfs property:
# zpool set bootfs=rpool/ROOT/dataset rpool
# zfs set canmount=noauto rpool/ROOT/dataset
# zfs set mountpoint=/ rpool/ROOT/dataset
# zfs set mountpoint=/rpool rpool
8.Install ZFS bootblk:
# installgrub /boot/grub/stage1 /boot/grub/stage2 /dev/rdsk/c1t0d0s0
# installgrub /boot/grub/stage1 /boot/grub/stage2 /dev/rdsk/c1t1d0s0
9.Reboot the system:
# umount /mnt
# init 6
Upon bootup, the system may appear to hang after printing the hostname. The system is creating the rpool/dump device, which can take several minutes.
10.Delete snapshot:
# zfs list |grep @
# zfs destroy -r rpool@20120711
Thank you for reading this article.
Please leave a comment if you have any doubt ,i will get back to you as soon as possible.
praveen says
after booting the server in single usermode, how come we can mount the snapshot through nfs?.. I meant in single user mode there won’t be NFS support right?
Venkat says
@Praveen – you needs to enable the minimal network in single user mode to make the NAS IP connectivity. Then you can able to connect and mount the NAS share on single user mode.