当前位置:文档之家› IBM硬盘克隆步骤

IBM硬盘克隆步骤



AIX rootvg的镜像备份


在克隆过程中,系统需完成如下工作:
1.基于当前系统rootvg中内容,产生/image.data 文件.
2.使用系统中未被占用的硬盘, 创建altinst_rootvg卷组
3.创建前缀为alt_inst的逻辑卷和文件系统
4.以当前rootvg为蓝本,生成备份文件列表, 不包含在exclude.list中的文件
5.将所有文件拷到altinst_rootvg的文件系统上
6.如果指定的话,使用installp 命令在新的系统中安装系统的更新软件或新的软件包
7.使用bosboot命令在altinst_rootvg上创建引导逻辑卷
8.若有指定,执行用户的脚本程序
9.卸载文件系统, 修改altinst_rootvg上逻辑卷和文件系统的命名
10. 将引导列表改成从替换硬盘上引导.
需要bos.alt_disk_install.rte这个软件包
alt_disk_install -OCB hdisk1
这种方法克隆的盘,可以拿到不同硬件配置的机器上去用,用它进行引导时,会删除ODM库里的所有信息,重新配置所有设备信息,相当于使用克隆盘重新安装新的系统一样。

alt_disk_install -CB hdisk1
如果你是相同硬件配置的机器,则可以运行下列命令克隆而保持所有设备信息:
----------------------------------------------------------------
1、
# lspv
hdisk0 002074481b340f84 None
hdisk1 002074484424da16 rootvg
# alt_disk_install -CB hdisk0
Calling mkszfile to create new /image.data file.
Checking disk sizes.
Creating cloned rootvg volume group and associated logical volumes.
Creating logical volume alt_hd5.
Creating logical volume alt_hd6.
Creating logical volume alt_hd8.
Creating logical volume alt_hd4.
Creating logical volume alt_hd2.
Creating logical volume alt_hd9var.
Creating logical volume alt_hd3.
Creating logical volume alt_hd1.
Creating logical volume alt_hd10opt.
Creating /alt_inst/ file system.
Creating /alt_inst/home file system.
Creating /alt_inst/opt file system.
Creating /alt_inst/tmp file system.
Creating /alt_inst/usr file system.
Creating /alt_inst/var file system.
Generating a list of files
for backup and restore into the alternate file system...
Backing-up the rootvg files and restoring them to the alternate file system...
Modifying ODM on cloned disk.
Building boot image on cloned disk
forced unmount of /alt_inst/var
forced unmount of /alt_inst/usr
forced unmount of /alt_inst/tmp
forced unmount of /alt_inst/opt
forced unmount of /alt_inst/home
forced unmount of /alt_inst
forced unmount of /alt_inst
Changing logical volume names in volume group descriptor area.
Fixing LV control blocks...
Fixing file system superblocks...
# lspv
hdisk0 002074481b340f84 altinst_rootvg
hdisk1 002074484424da16 rootvg
# bootlist -m normal -o (照例应该是默认克隆盘引导的)
hdisk1
# bootlist -m normal hdisk0 hdisk1
重起进系统后


# lspv
hdisk0 002074481b340f84 rootvg
hdisk1 002074484424da16 old_rootvg
------------------------------------------------------------------
如要释放老rootvg所占用的硬盘,删除其在ODM中的定义,需做如下操作:
alt_disk_install -X old_rootvg

2、
# lspv
hdisk0 002074481b340f84 old_rootvg
hdisk1 002074484424da16 rootvg
# alt_disk_install -W hdisk0 ---->从新的备用磁盘引导后“唤醒”一个原始rootvg
Waking up old_rootvg volume group ...
# lspv
hdisk0 002074481b340f84 altinst_rootvg
hdisk1 002074484424da16 rootvg
-W disk
用来“唤醒”卷组以在 rootvg 和备用磁盘 rootvg 间的数据存取。
注:经历“唤醒”的卷组将重命名为“altinst_rootvg”。
限制
正在运行系统的操作系统版本必须高于或等于经历“唤醒”的卷组的操作系统版本。这可能意味着有必要从“altinst_rootvg”引导并“唤醒”“old_rootvg”。

------------------------------------------------------------------
3、关机,把hdisk1拔掉,插hdisk0。(和插到其他新机器一样)
# lspv
hdisk1 002074484424da16 rootvg
hdisk0 002074481b340f84 altinst_rootvg
# bootlist -m normal -o
hdisk1
# bootlist -m normal hdisk0
# bootlist -m normal -o
hdisk0
进系统后:
# lspv
hdisk0 002074481b340f84 rootvg
# lsdev -Cc disk
hdisk1 Defined 00-00-00-4,0 2.2 GB 16 Bit SCSI Disk Drive
hdisk0 Available 00-00-00-0,0 2.2 GB 16 Bit SCSI Disk Drive
# rmdev -dl hdisk1
hdisk1 deleted
# lsdev -Cc disk
hdisk0 Available 00-00-00-0,0 2.2 GB 16 Bit SCSI Disk Drive
(这样看上去就是习惯一点,hdisk0为rootvg ,但要是hdisk1是克隆盘,插到新机器上呢?)
(重新插回hdisk1后:)
# lspv
hdisk0 002074481b340f84 rootvg
hdisk1 002074484424da16 old_rootvg
---------------------------------------------------------------

继续(想确认下,保留的hdisk0信息如何删除,并使hdisk1开机认出来hdisk0)
# lspv
hdisk1 002074484424da16 altinst_rootvg
hdisk0 002074481b340f84 rootvg
# lspv -l hdisk1
hdisk1:
LV NAME LPs PPs DISTRIBUTION MOUNT POINT
alt_hd5 2 2 02..00..00..00..00 N/A
alt_hd10opt 5 5 05..00..00..00..00 /alt_inst/opt
alt_hd1 1 1 01..00..00..00..00 /alt_inst/home
alt_hd9var 3 3 03..00..00..00..00 /alt_inst/var
alt_hd6 107 107 00..107..00..00..00 N/A
alt_hd8 1 1 00..00..01..00..00 N/A
alt_hd4 2 2 00..00..02..00..00 /alt_inst
alt_hd2 105

105 00..00..104..01..00 /alt_inst/usr
alt_hd3 5 5 00..00..00..05..00 /alt_inst/tmp
# bootlist -m normal -o
hdisk0
# bootlist -m normal hdisk1
拔掉hdisk0,直接插hdisk1。
进系统后:
# lspv
hdisk1 002074484424da16 rootvg
# lsdev -Cc disk
hdisk0 Defined 00-00-00-0,0 2.2 GB 16 Bit SCSI Disk Drive
hdisk1 Available 00-00-00-4,0 2.2 GB 16 Bit SCSI Disk Drive
# rmdev -dl hdisk0
hdisk0 deleted
# lsdev -Cc disk
hdisk1 Available 00-00-00-4,0 2.2 GB 16 Bit SCSI Disk Drive
和之前一样,hdisk0也一样在。但这时要把原本hdisk1变成hdisk0属于rootvg就比较麻烦了,直接改不了,又需要作一步clone或mirror。(虽然这样不影响使用,但是习惯,而且也可以解决)。所以可选择做如下操作:

# lspv
hdisk1 002074484424da16 None
hdisk0 002074481b340f84 rootvg
# alt_disk_install -OCB hdisk1 ------>用这个方便点,但不能保存设备配置

作好插到新机器上,可能要改下启动顺序,进系统:
# lspv
hdisk0 002074484424da16 rootvg
# ifconfig -a
lo0: flags=e08084b
inet 127.0.0.1 netmask 0xff000000 broadcast 127.255.255.255
inet6 ::1/0
# lsdev -Cc disk
hdisk0 Available 00-00-00-4,0 2.2 GB 16 Bit SCSI Disk Drive
IP都可以重新配~~~
-O 在目标 altinst_rootvg 上执行设备的复位。这将使 alt_disk_install 不保留任何用户定义的设备配置。如果一个或多个目标磁盘将成为不同系统的 rootvg(比如在逻辑分区或系统磁盘交换的情况下),此标志是非常有用的。
-----------------------------------------------------------
另:
1、
要在从新的备用磁盘引导后,除去原始 rootvg ODM 数据库条目:
alt_disk_install -X old_rootvg
原始 rootvg 的 lspv 清单将更改至“None”。所以,新的卷组可以在那些磁盘上创建。
2、
要确定具有多个物理卷的卷组的引导磁盘:
alt_disk_install -q hdisk0说明示例
# lspv
hdisk0 00006091aef8b687 old_rootvg
hdisk1 00076443210a72ea rootvg
hdisk2 0000875f48998649 old_rootvg
# alt_disk_install -q hdisk0
hdisk2在这种情况下,“old_rootvg”的引导磁盘实际上是 hdisk2。所以,您应将引导列表重新设置为 hdisk2,并重新引导至原始 rootvg 卷组。
3、
要修改 alt_disk_install 卷组名称:
alt_disk_install -v alt_disk_432 hdisk2说明示例
# lspv
hdisk0 00006091aef8b687 rootvg
hdisk1 00000103000d1a78 rootvg
hdisk2 000040445043d9f3 altinst_rootvg
hdisk3 00076443210a72ea altinst_rootvg
hdisk4 0000875f48998649 None
hdisk5 000005317c58000e None
# alt_disk_install -v alt_disk_432 hdisk2
#lspv
hdisk0 00006091aef8b687 rootvg
hdisk1 00000103000d1a78 ro

otvg
hdisk2 000040445043d9f3 alt_disk_432
hdisk3 00076443210a72ea alt_disk_432
hdisk4 0000875f48998649 None
hdisk5 000005317c58000e None
4、
要在从新的备用磁盘引导后“唤醒”一个原始 rootvg:
alt_disk_install -W hdisk0说明示例
# lspv
hdisk0 000040445043d9f3 old_rootvg
hdisk1 00076443210a72ea rootvg
# alt_disk_install -W hdisk0
# lspv
hdisk0 000040445043d9f3 altinst_rootvg
hdisk1 00076443210a72ea rootvg此时,“altinst_rootvg”卷组是联机的,且将安装 /alt_inst 文件系统。
5、
要将已经经历了“唤醒”的卷组“置于睡眠”:
alt_disk_install -S说明示例
# lspv
hdisk0 000040445043d9f3 altinst_rootvg
hdisk1 00076443210a72ea rootvg
# alt_disk_install -S
# lspv
hdisk0 000040445043d9f3 altinst_rootvg
hdisk1 00076443210a72ea rootvg“altinst_rootvg”不再处于联机状态且不再安装 /alt_inst 文件系统。如果有必要将卷组名称“altinst_rootvg”更改回“old_rootvg”,这可以通过“-v”标志来进行


相关主题
文本预览
相关文档 最新文档