如何恢复solaris区?

我发布了一个关于如何备份和删除solaris区域的问题: 如何备份和删除solaris区域?

但我也想问我怎样才能恢复solaris区,以防万一下一次我需要访问文件或旧solaris区内的环境?

这是我做过的一个方法。 取决于您是否使用pax命令备份了该区域

# 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 

将新区域附加到新主机

 # 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) 

在这一点上,我们将不得不升级新区域的软件包,所以使用-u选项运行:

 # 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