Oracle Solaris ZFS Administration Guide

ProcedureHow to Recreate a ZFS Root Pool and Restore Root Pool Snapshots

In this procedure, assume the following conditions:

All the steps are performed on the local system.

  1. Boot from a CD/DVD or the network.

    • SPARC: Select one of the following boot methods:


      ok boot net -s
      ok boot cdrom -s
      

      If you don't use -s option, you'll need to exit the installation program.

    • x86: Select the option for booting from the DVD or the network. Then, exit the installation program.

  2. Mount the remote snapshot dataset.

    For example:


    # mount -F nfs remote-system:/rpool/snaps /mnt
    

    If your network services are not configured, you might need to specify the remote-system's IP address.

  3. If the root pool disk is replaced and does not contain a disk label that is usable by ZFS, you must relabel the disk.

    For more information about relabeling the disk, go to the following site:

    http://www.solarisinternals.com/wiki/index.php/ZFS_Troubleshooting_Guide

  4. Recreate the root pool.

    For example:


    # zpool create -f -o failmode=continue -R /a -m legacy -o cachefile=
    /etc/zfs/zpool.cache rpool c1t1d0s0
    
  5. Restore the root pool snapshots.

    This step might take some time. For example:


    # cat /mnt/rpool.0804 | zfs receive -Fdu rpool
    

    Using the -u option means that the restored archive is not mounted when the zfs receive operation completes.

  6. Verify that the root pool datasets are restored.

    For example:


    # zfs list
    NAME                        USED  AVAIL  REFER  MOUNTPOINT
    rpool                      6.17G  60.8G    98K  /a/rpool
    rpool@0804                     0      -    98K  -
    rpool/ROOT                 4.67G  60.8G    21K  /legacy
    rpool/ROOT@0804                0      -    21K  -
    rpool/ROOT/zfsBE           4.67G  60.8G  4.67G  /a
    rpool/ROOT/zfsBE@0804       398K      -  4.67G  -
    rpool/dump                 1.00G  60.8G  1.00G  -
    rpool/dump@0804                0      -  1.00G  -
    rpool/swap                  517M  61.3G    16K  -
    rpool/swap@0804                0      -    16K  -
  7. Set the bootfs property on the root pool BE.

    For example:


    # zpool set bootfs=rpool/ROOT/zfsBE rpool
    
  8. Install the boot blocks on the new disk.

    SPARC:


    # installboot -F zfs /usr/platform/`uname -i`/lib/fs/zfs/bootblk /dev/rdsk/c1t1d0s0
    

    x86:


    # installgrub /boot/grub/stage1 /boot/grub/stage2 /dev/rdsk/c1t1d0s0
    
  9. Reboot the system.


    # init 6