Solaris ZFS Administration Guide

Procedure How to Create Root Pool Snapshots

Create root pool snapshots for recovery purposes. The best way to create root pool snapshots is to do a recursive snapshot of the root pool.

The procedure below creates a recursive root pool snapshot and stores the snapshot as a file in a pool on a remote system. In the case of a root pool failure, the remote dataset can be mounted by using NFS and the snapshot file received into the recreated pool. You can also store root pool snapshots as the actual snapshots in a pool on a remote system. Sending and receiving the snapshots from a remote system is a bit more complicated because you must configure ssh or use rsh while the system to be repaired is booted from the Solaris OS miniroot.

For information about remotely storing and recovering root pool snapshots and the most up-to-date information about root pool recovery, go to this site:

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

Validating remotely stored snapshots as files or snapshots is an important step in root pool recovery and in either method, snapshots should be recreated on a routine basis, such as when the pool configuration changes or when the Solaris OS is upgraded.

In the following example, the system is booted from the zfs1009BE boot environment.

  1. Create space on a remote system to store the snapshots.

    For example:


    remote# zfs create rpool/snaps
    
  2. Share the space to the local system.

    For example:


    remote# zfs set sharenfs='rw=local-system,root=local-system' rpool/snaps
    # share
    -@rpool/snaps   /rpool/snaps   sec=sys,rw=local-system,root=local-system   "" 
  3. Create a recursive snapshot of the root pool.

    In this example, the system has two BEs, zfsnv109BE and zfsnv1092BE. The active BE is zfsnv109BE.


    local# zpool set listsnapshots=on mpool
    local# zfs snapshot -r mpool@0311
    local# zfs list
    NAME                               USED  AVAIL  REFER  MOUNTPOINT
    mpool                              9.98G  41.2G  22.5K  /mpool
    mpool@0311                             0      -  22.5K  -
    mpool/ROOT                         7.48G  41.2G    19K  /mpool/ROOT
    mpool/ROOT@0311                        0      -    19K  -
    mpool/ROOT/zfsnv1092BE               85K  41.2G  7.48G  /tmp/.alt.luupdall.2934
    mpool/ROOT/zfsnv1092BE@0311            0      -  7.48G  -
    mpool/ROOT/zfsnv109BE              7.48G  41.2G  7.45G  /
    mpool/ROOT/zfsnv109BE@zfsnv1092BE  28.7M      -  7.48G  -
    mpool/ROOT/zfsnv109BE@0311           58K      -  7.45G  -
    mpool/dump                         2.00G  41.2G  2.00G  -
    mpool/dump@0311                        0      -  2.00G  -
    mpool/swap                          517M  41.7G    16K  -
    mpool/swap@0311                        0      -    16K  -
  4. Send the root pool snapshots to the remote system.

    For example:


    local# zfs send -Rv mpool@0311 > /net/remote-system/rpool/snaps/mpool.0311
    sending from @ to mpool@0311
    sending from @ to mpool/swap@0311
    sending from @ to mpool/dump@0311
    sending from @ to mpool/ROOT@0311
    sending from @ to mpool/ROOT/zfsnv109BE@zfsnv1092BE
    sending from @zfsnv1092BE to mpool/ROOT/zfsnv109BE@0311
    sending from @ to mpool/ROOT/zfsnv1092BE@0311