If the data located in the zonepath or in the zone's rpool has been damaged or lost, this procedure provides instructions on how to restore this data.
If the zonepath is healthy, ignore this procedure.
![]() | Caution - When following the process to restore the zonepath, do not try to install the zone, and do not run the zoneadm -z myzone install command. Doing so can corrupt the zonepath that is being restored. |
Backing up a zone generates a ZFS stream out of the zonepath. The restore procedure consists of receiving this stream back.
# zonepath=`zonecfg -z myzone info zonepath | awk '{print $2}'`
# zfs list -H -o name -t filesystem $zonepath
# pool=`grep zonepath /sharedPath/myzone.data.info | grep pool | awk '{print $3}'`
# zpool list $pool
# device=`grep zonepath /sharedPath/myzone.data.info | grep 'raw device' | awk '{print $4}'` # zpool create $pool $device
# dataset=`grep zonepath /sharedPath/myzone.data.info | grep dataset | awk '{print $3}'` # mountpoint=`grep zonepath /sharedPath/myzone.data.info | grep mountpoint | awk '{print $3}'` # zfs create $dataset
Locate the .zfs file in osc-config-backup/domains/mydomain/SolarisZones/myzone and receive it.
root# su - oscbackR oscbackR$ cd osc-config-backup/domains/mydomain/SolarisZones/myzone oscbackR$ cp rpool.backup.data.zfs /sharedPath oscbackR$ exit root# cat /sharedPath/rpool.backup.data.zfs | zfs receive -vF $dataset root# zfs set mountpoint=$mountpoint $dataset
# zfs destroy -r $dataset@osc-config-backup
# zonepath=`zonecfg -z myzone info zonepath | awk '{print $2}'` # dataset=`zfs list -Ho name -t filesystem $zonepath` # zfs mount $dataset