How to restore solaris zone

solaris

I posted an earlier question on how to backup and delete the solaris zone:
How to backup and remove solaris zones?

But i like to ask also how can i restore the solaris zone just in case next time i need to access the files or the environment inside the old solaris zone?

Best Answer

Here is one way I've done it. Depends on whether you backed up the zone with the pax command

# mkdir -m 700 -p /zpool/zones/10gr2
# cd /zpool/zones/10gr2/
# ls ../..
oracle10gr2.pax  zones
# pax -r@f ../../oracle10gr2.pax
# zonecfg -z oracle10gr2
oracle10gr2: No such zone configured
Use 'create' to begin configuring a new zone.
zonecfg:oracle10gr2> create -a /zpool/zones/10gr2
zonecfg:oracle10gr2> exit

Attach the new zone to the new host

# zoneadm -z oracle10gr2 attach
These packages installed on this system were not installed on the source system:
        SUNWpostgr-82-client (11.10.0,REV=2007.04.27.13.04)
        SUNWpostgr-82-contrib (11.10.0,REV=2007.04.27.13.04)
        SUNWpostgr-82-devel (11.10.0,REV=2007.04.27.13.04)
        SUNWpostgr-82-libs (11.10.0,REV=2007.04.27.13.04)
        SUNWpostgr-82-server (11.10.0,REV=2007.04.27.13.04)
        SUNWpostgr-82-server-data-root (11.10.0,REV=2007.04.27.13.04)
        SUNWpostgr-83-server-data-root (11.10.0,REV=2008.06.05.09.31)

At this point, we'll have to upgrade the new zone's packages, so run with the -u option:

# zoneadm -z oracle10gr2 attach -u
Getting the list of files to remove
Removing 5 files
Remove 12 of 12 packages
Installing 24 files
Add 19 of 19 packages
Installation of these packages generated warnings: SUNWpostgr-82-server-data-root
Updating editable files
The file </var/sadm/system/logs/update_log> within the zone contains a log of the zone update.
# zoneadm -z oracle10gr2 boot
# zlogin -C oracle10gr2
Related Topic