很简单,只需要一个命令cat
例如:系统的硬盘分区如下:
/dev/rdsk/c0t0d0s0 /
/dev/rdsk/c0t0d0s1 swap
/dev/rdsk/c0t0d0s3 /var
/dev/rdsk/c0t0d0s4 /opt
/dev/rdsk/c0t0d0s7 /usr
现在要将系统克隆到/dev/rdsk/c0t1d0上
做法:
1、使用format,将/dev/rdsk/c0t1d0的分区分得与/dev/rdsk/c0t0d0一样
2、制作一个文件cloneSystemDisk.sh,内容为:
cat /dev/rdsk/c0t0d0s0>/dev/rdsk/c0t1d0s0
cat /dev/rdsk/c0t0d0s1>/dev/rdsk/c0t1d0s1
cat /dev/rdsk/c0t0d0s3>/dev/rdsk/c0t1d0s3
cat /dev/rdsk/c0t0d0s4>/dev/rdsk/c0t1d0s4
cat /dev/rdsk/c0t0d0s7>/dev/rdsk/c0t1d0s7
3、执行这个脚本
#chmod 755 cloneSystemDisk.sh
#PathOfTheScript/cloneSystemDisk.sh
4、一旦脚本执行完毕,硬盘克隆就完成了。要使用这个克隆系统
只需要将克隆硬盘安装在原来系统盘的位置就可以
[[i] 本帖最后由 oldunix 于 2007-3-11 10:16 编辑 [/i]]
V890上克隆磁盘
[color=Red][size=7]转载请注明Oldunix[/size][/color]
很久以前写过一个克隆磁盘的帖子
这是SCSI时代的技术,用在FC时代有点勉为其难了!
昨天参考论坛文章,在V890上做了一次。[color=Red]增加了一项解决不成功克隆后的处理方法。[/color]
下面是整个过程:
硬盘克隆目标 c1t0d0 -----> c1t1d0
1、复制分区信息
prtvtoc /dev/rdsk/c1t1d0s2 |fmthard -s - /dev/rdsk/c1t1d0s2
2、[color=Red][size=5]如果有以前不成功的复制,执行如下,进行清除:[/size][/color]
lucancel
lustatus
ludelete c1t1d0s2
3、执行如下克隆每个启动盘的分区
lucreate -c c1t0d0 \
-m /:/dev/dsk/c1t1d0s0:ufs \
-m -:/dev/dsk/c1t1d0s1:swap \
-m /var:/dev/dsk/c1t1d0s3:ufs \
-m /globaldevices:/dev/dsk/c1t1d0s4:ufs \
-m /opt:/dev/dsk/c1t1d0s5:ufs \
-m /users:/dev/dsk/c1t1d0s6:ufs \
-n c1t1d0
-c c1t0d0 源盘
-n c1t1d0 目标盘
-m 目录:目标盘块设备分区:文件系统 或者 -:目标盘块设备交换分区:swap
4、克隆结束后,查看状态:
root@rac1 # lustatus
Boot Environment Is Active Active Can Copy
Name Complete Now On Reboot Delete Status
-------------------------- -------- ------ --------- ------ ----------
c1t0d0 yes yes yes no -
c1t1d0 yes no no yes -
5、激活克隆盘
root@rac1 # luactivate c1t1d0
**********************************************************************
The target boot environment has been activated. It will be used when you
reboot. NOTE: You MUST NOT USE the reboot, halt, or uadmin commands. You
MUST USE either the init or the shutdown command when you reboot. If you
do not use either init or shutdown, the system will not boot using the
target BE.
**********************************************************************
In case of a failure while booting to the target BE, the following process
needs to be followed to fallback to the currently working boot environment:
1. Enter the PROM monitor (ok prompt).
2. Change the boot device back to the original boot environment by typing:
setenv boot-device
/pci@8,600000/SUNW,qlc@2/fp@0,0/disk@w5000cca004261389,0:a
3. Boot to the original boot environment by typing:
boot
**********************************************************************
Activation of boot environment successful.
root@rac1 #
6、记录以上的信息,根据需要是否修改PROM,或者通过:
boot disk1
boot disk
来选择启动哪块硬盘
[ 本帖最后由 oldunix 于 2008-6-4 17:32 编辑 ]
阅读(1772) | 评论(0) | 转发(0) |