如何恢复 solaris 区域?

如何恢复 solaris 区域?

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

但我还想问一下,如何恢复 solaris 区域,以防下次我需要访问旧 solaris 区域内的文件或环境?

答案1

这是我做过的一种方式。取决于你是否用 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

相关内容