Tuesday, June 19, 2012

Backup Solaris Zones

Find out zonepath of the zone you need to backup


root@isve-111-116:~# zonecfg -z rac4Zone info zonepath
zonepath: /zonepools/zones/rac4Zone

Find out the data-set of zonepath

root@isve-111-116:~# zfs list -H -o name /zonepools/zones/rac4Zone
zonepools/zones/rac4Zone

Create a snapshot of the zonepath

root@isve-111-116:~# zfs snapshot -r zonepools/zones/rac4Zone@backup1

Verify that snapshot was successfully created

 zfs snapshot -r zonepools/zones/rac4Zone@backup1

root@isve-111-116:~# zfs list -t snap -r zonepools/zones/rac4Zone
NAME                                                      USED  AVAIL  REFER  MOUNTPOINT
zonepools/zones/rac4Zone@backup1                             0      -    34K  -
zonepools/zones/rac4Zone/rpool@backup1                       0      -    31K  -
zonepools/zones/rac4Zone/rpool/ROOT@backup1                  0      -    31K  -
zonepools/zones/rac4Zone/rpool/ROOT/solaris@install      6.97M      -   291M  -
zonepools/zones/rac4Zone/rpool/ROOT/solaris@backup1       387K      -  5.36G  -
zonepools/zones/rac4Zone/rpool/ROOT/solaris/var@install  27.4M      -  66.2M  -
zonepools/zones/rac4Zone/rpool/ROOT/solaris/var@backup1      0      -  82.5M  -
zonepools/zones/rac4Zone/rpool/dump@backup1                  0      -    16K  -
zonepools/zones/rac4Zone/rpool/export@backup1                0      -    32K  -
zonepools/zones/rac4Zone/rpool/export/home@backup1       6.24M      -  1.83G  -
zonepools/zones/rac4Zone/rpool/swap@backup1                  0      -    16K  -


Archive the zonepath

zfs send -rc zonepools/zones/rac4Zone@backup1 > /cont/rac4

Verify that the archive of the zonepath is created
root@isve-111-116:/cont# file /cont/rac4
/cont/rac4:     ZFS snapshot stream

No comments:

Post a Comment