论坛徽章: 0
20 可用积分
dd后换盘,从镜像盘启动系统的一种简便方法2-1
标题:dd后换盘,从镜像盘启动系统的一种简便方法
作者;小民
背景:
有2块光纤硬盘,分别是系统盘c1t1d1和镜像盘c2t2d2;
计划用dd工具给系统盘作镜像,把镜像盘和系统盘交换槽位,从镜像盘启动系统。
网上有关光纤硬盘的资料操作步骤过于繁复,很容易出错,笔者至今还未试验成功。
笔者另辟蹊径,只需修改镜像盘里/dev/dsk/c1t1d1和/dev/rdsk/c1t1d1相关的链接即可,未知有什么负面影响,请达人指教。
以下是笔者的具体操作步骤。
Last login: Wed May 7 10:28:51 2008 from 192.168.176.136
Sun Microsystems Inc. SunOS 5.10 Generic January 2005
$ su
口令:
# uname -a
SunOS No12webser 5.10 Generic_127111-09 sun4u sparc SUNW,Sun-Fire-880
#
# format
Searching for disks...done
AVAILABLE DISK SELECTIONS:
0. c1t1d1 <SUN72G cyl 14087 alt 2 hd 24 sec 424>
/pci@8,600000/SUNW,qlc@2/fp@0,0/ssd@w500000e010373291,0
1. c2t2d2 <SUN72G cyl 14087 alt 2 hd 24 sec 424>
/pci@8,600000/SUNW,qlc@2/fp@0,0/ssd@w500000e01036d021,0
Specify disk (enter its number): ^C
#
# dd if=/dev/rdsk/c1t1d1s2 of=/dev/rdsk/c2t2d2s2 bs=8192k
#
# mkdir /mnt/c2t2d2
# mount /dev/dsk/c2t2d2s0 /mnt/c2t2d2/
# ls -l /dev/dsk/c2t2*
lrwxrwxrwx 1 root root 70 4月 7日 16:57 /dev/dsk/c2t2d2s0 ->../../devices/pci@8,600000/SUNW,qlc@2/fp@0,0/ssd@w500000e01036d021,0:a
lrwxrwxrwx 1 root root 70 4月 7日 16:57 /dev/dsk/c2t2d2s1 ->../../devices/pci@8,600000/SUNW,qlc@2/fp@0,0/ssd@w500000e01036d021,0:b
lrwxrwxrwx 1 root root 70 4月 7日 16:57 /dev/dsk/c2t2d2s2 ->../../devices/pci@8,600000/SUNW,qlc@2/fp@0,0/ssd@w500000e01036d021,0:c
lrwxrwxrwx 1 root root 70 4月 7日 16:57 /dev/dsk/c2t2d2s3 ->../../devices/pci@8,600000/SUNW,qlc@2/fp@0,0/ssd@w500000e01036d021,0:d
lrwxrwxrwx 1 root root 70 4月 7日 16:57 /dev/dsk/c2t2d2s4 ->../../devices/pci@8,600000/SUNW,qlc@2/fp@0,0/ssd@w500000e01036d021,0:e
lrwxrwxrwx 1 root root 70 4月 7日 16:57 /dev/dsk/c2t2d2s5 ->../../devices/pci@8,600000/SUNW,qlc@2/fp@0,0/ssd@w500000e01036d021,0:f
lrwxrwxrwx 1 root root 70 4月 7日 16:57 /dev/dsk/c2t2d2s6 ->../../devices/pci@8,600000/SUNW,qlc@2/fp@0,0/ssd@w500000e01036d021,0:g
lrwxrwxrwx 1 root root 70 4月 7日 16:57 /dev/dsk/c2t2d2s7 ->../../devices/pci@8,600000/SUNW,qlc@2/fp@0,0/ssd@w500000e01036d021,0:h
#
# ls -l /mnt/c2t2d2/dev/dsk/c2t2*
lrwxrwxrwx 1 root root 70 4月 7日 16:57 /mnt/c2t2d2/dev/dsk/c2t2d2s0 ->../../devices/pci@8,600000/SUNW,qlc@2/fp@0,0/ssd@w500000e01036d021,0:a
lrwxrwxrwx 1 root root 70 4月 7日 16:57 /mnt/c2t2d2/dev/dsk/c2t2d2s1 ->../../devices/pci@8,600000/SUNW,qlc@2/fp@0,0/ssd@w500000e01036d021,0:b
lrwxrwxrwx 1 root root 70 4月 7日 16:57 /mnt/c2t2d2/dev/dsk/c2t2d2s2 ->../../devices/pci@8,600000/SUNW,qlc@2/fp@0,0/ssd@w500000e01036d021,0:c
lrwxrwxrwx 1 root root 70 4月 7日 16:57 /mnt/c2t2d2/dev/dsk/c2t2d2s3 ->../../devices/pci@8,600000/SUNW,qlc@2/fp@0,0/ssd@w500000e01036d021,0:d
lrwxrwxrwx 1 root root 70 4月 7日 16:57 /mnt/c2t2d2/dev/dsk/c2t2d2s4 ->../../devices/pci@8,600000/SUNW,qlc@2/fp@0,0/ssd@w500000e01036d021,0:e
lrwxrwxrwx 1 root root 70 4月 7日 16:57 /mnt/c2t2d2/dev/dsk/c2t2d2s5 ->../../devices/pci@8,600000/SUNW,qlc@2/fp@0,0/ssd@w500000e01036d021,0:f
lrwxrwxrwx 1 root root 70 4月 7日 16:57 /mnt/c2t2d2/dev/dsk/c2t2d2s6 ->../../devices/pci@8,600000/SUNW,qlc@2/fp@0,0/ssd@w500000e01036d021,0:g
lrwxrwxrwx 1 root root 70 4月 7日 16:57 /mnt/c2t2d2/dev/dsk/c2t2d2s7 ->../../devices/pci@8,600000/SUNW,qlc@2/fp@0,0/ssd@w500000e01036d021,0:h
#
dd后换盘,从镜像盘启动系统的一种简便方法2-2
#
# ls -l /dev/dsk/c1t1*
lrwxrwxrwx 1 root root 70 2007 9月 7 /dev/dsk/c1t1d1s0 ->../../devices/pci@8,600000/SUNW,qlc@2/fp@0,0/ssd@w500000e010373291,0:a
lrwxrwxrwx 1 root root 70 2007 9月 7 /dev/dsk/c1t1d1s1 ->../../devices/pci@8,600000/SUNW,qlc@2/fp@0,0/ssd@w500000e010373291,0:b
lrwxrwxrwx 1 root root 70 2007 9月 7 /dev/dsk/c1t1d1s2 ->../../devices/pci@8,600000/SUNW,qlc@2/fp@0,0/ssd@w500000e010373291,0:c
lrwxrwxrwx 1 root root 70 2007 9月 7 /dev/dsk/c1t1d1s3 ->../../devices/pci@8,600000/SUNW,qlc@2/fp@0,0/ssd@w500000e010373291,0:d
lrwxrwxrwx 1 root root 70 2007 9月 7 /dev/dsk/c1t1d1s4 ->../../devices/pci@8,600000/SUNW,qlc@2/fp@0,0/ssd@w500000e010373291,0:e
lrwxrwxrwx 1 root root 70 2007 9月 7 /dev/dsk/c1t1d1s5 ->../../devices/pci@8,600000/SUNW,qlc@2/fp@0,0/ssd@w500000e010373291,0:f
lrwxrwxrwx 1 root root 70 2007 9月 7 /dev/dsk/c1t1d1s6 ->../../devices/pci@8,600000/SUNW,qlc@2/fp@0,0/ssd@w500000e010373291,0:g
lrwxrwxrwx 1 root root 70 2007 9月 7 /dev/dsk/c1t1d1s7 ->../../devices/pci@8,600000/SUNW,qlc@2/fp@0,0/ssd@w500000e010373291,0:h
#
# ls -l /mnt/c2t2d2/dev/dsk/c1t1*
lrwxrwxrwx 1 root root 70 2007 9月 7 /mnt/c2t2d2/dev/dsk/c1t1d1s0 ->../../devices/pci@8,600000/SUNW,qlc@2/fp@0,0/ssd@w500000e010373291,0:a
lrwxrwxrwx 1 root root 70 2007 9月 7 /mnt/c2t2d2/dev/dsk/c1t1d1s1 ->../../devices/pci@8,600000/SUNW,qlc@2/fp@0,0/ssd@w500000e010373291,0:b
lrwxrwxrwx 1 root root 70 2007 9月 7 /mnt/c2t2d2/dev/dsk/c1t1d1s2 ->../../devices/pci@8,600000/SUNW,qlc@2/fp@0,0/ssd@w500000e010373291,0:c
lrwxrwxrwx 1 root root 70 2007 9月 7 /mnt/c2t2d2/dev/dsk/c1t1d1s3 ->../../devices/pci@8,600000/SUNW,qlc@2/fp@0,0/ssd@w500000e010373291,0:d
lrwxrwxrwx 1 root root 70 2007 9月 7 /mnt/c2t2d2/dev/dsk/c1t1d1s4 ->../../devices/pci@8,600000/SUNW,qlc@2/fp@0,0/ssd@w500000e010373291,0:e
lrwxrwxrwx 1 root root 70 2007 9月 7 /mnt/c2t2d2/dev/dsk/c1t1d1s5 ->../../devices/pci@8,600000/SUNW,qlc@2/fp@0,0/ssd@w500000e010373291,0:f
lrwxrwxrwx 1 root root 70 2007 9月 7 /mnt/c2t2d2/dev/dsk/c1t1d1s6 ->../../devices/pci@8,600000/SUNW,qlc@2/fp@0,0/ssd@w500000e010373291,0:g
lrwxrwxrwx 1 root root 70 2007 9月 7 /mnt/c2t2d2/dev/dsk/c1t1d1s7 ->../../devices/pci@8,600000/SUNW,qlc@2/fp@0,0/ssd@w500000e010373291,0:h
#
# rm -rf /mnt/c2t2d2/dev/dsk/c2t2*
# ls -l /mnt/c2t2d2/dev/dsk/c2t2*
/mnt/c2t2d2/dev/dsk/c2t2*: 无此文件或目录
# rm -rf /mnt/c2t2d2/dev/dsk/c1t1*
# ls -l /mnt/c2t2d2/dev/dsk/c1t1*
/mnt/c2t2d2/dev/dsk/c1t1*: 无此文件或目录
#
# ln -s../../devices/pci@8,600000/SUNW,qlc@2/fp@0,0/ssd@w500000e01036d021,0:a/mnt/c2t2d2/dev/dsk/c1t1d1s0
# ln -s../../devices/pci@8,600000/SUNW,qlc@2/fp@0,0/ssd@w500000e01036d021,0:b/mnt/c2t2d2/dev/dsk/c1t1d1s1
# ln -s../../devices/pci@8,600000/SUNW,qlc@2/fp@0,0/ssd@w500000e01036d021,0:c/mnt/c2t2d2/dev/dsk/c1t1d1s2
# ln -s../../devices/pci@8,600000/SUNW,qlc@2/fp@0,0/ssd@w500000e01036d021,0:d/mnt/c2t2d2/dev/dsk/c1t1d1s3
# ln -s../../devices/pci@8,600000/SUNW,qlc@2/fp@0,0/ssd@w500000e01036d021,0:e/mnt/c2t2d2/dev/dsk/c1t1d1s4
# ln -s../../devices/pci@8,600000/SUNW,qlc@2/fp@0,0/ssd@w500000e01036d021,0:f/mnt/c2t2d2/dev/dsk/c1t1d1s5
# ln -s../../devices/pci@8,600000/SUNW,qlc@2/fp@0,0/ssd@w500000e01036d021,0:g/mnt/c2t2d2/dev/dsk/c1t1d1s6
# ln -s../../devices/pci@8,600000/SUNW,qlc@2/fp@0,0/ssd@w500000e01036d021,0:h/mnt/c2t2d2/dev/dsk/c1t1d1s7
#
# ls -l /mnt/c2t2d2/dev/dsk/c1t1*
lrwxrwxrwx 1 root root 70 5月 7日 11:06 /mnt/c2t2d2/dev/dsk/c1t1d1s0 ->../../devices/pci@8,600000/SUNW,qlc@2/fp@0,0/ssd@w500000e01036d021,0:a
lrwxrwxrwx 1 root root 70 5月 7日 11:07 /mnt/c2t2d2/dev/dsk/c1t1d1s1 ->../../devices/pci@8,600000/SUNW,qlc@2/fp@0,0/ssd@w500000e01036d021,0:b
lrwxrwxrwx 1 root root 70 5月 7日 11:07 /mnt/c2t2d2/dev/dsk/c1t1d1s2 ->../../devices/pci@8,600000/SUNW,qlc@2/fp@0,0/ssd@w500000e01036d021,0:c
lrwxrwxrwx 1 root root 70 5月 7日 11:08 /mnt/c2t2d2/dev/dsk/c1t1d1s3 ->../../devices/pci@8,600000/SUNW,qlc@2/fp@0,0/ssd@w500000e01036d021,0:d
lrwxrwxrwx 1 root root 70 5月 7日 11:08 /mnt/c2t2d2/dev/dsk/c1t1d1s4 ->../../devices/pci@8,600000/SUNW,qlc@2/fp@0,0/ssd@w500000e01036d021,0:e
lrwxrwxrwx 1 root root 70 5月 7日 11:08 /mnt/c2t2d2/dev/dsk/c1t1d1s5 ->../../devices/pci@8,600000/SUNW,qlc@2/fp@0,0/ssd@w500000e01036d021,0:f
lrwxrwxrwx 1 root root 70 5月 7日 11:08 /mnt/c2t2d2/dev/dsk/c1t1d1s6 ->../../devices/pci@8,600000/SUNW,qlc@2/fp@0,0/ssd@w500000e01036d021,0:g
lrwxrwxrwx 1 root root 70 5月 7日 11:08 /mnt/c2t2d2/dev/dsk/c1t1d1s7 ->../../devices/pci@8,600000/SUNW,qlc@2/fp@0,0/ssd@w500000e01036d021,0:h
#
# rm -rf /mnt/c2t2d2/dev/rdsk/c2t2d2s?
# rm -rf /mnt/c2t2d2/dev/rdsk/c1t1d1s?
# ls -l /mnt/c2t2d2/dev/rdsk/c2t2d2s?
dev/rdsk/c2t2d2s?: 无此文件或目录
# ls -l /mnt/c2t2d2/dev/rdsk/c1t1d1s?
/mnt/c2t2d2/dev/rdsk/c1t1d1s?: 无此文件或目录
#
# ln -s../../devices/pci@8,600000/SUNW,qlc@2/fp@0,0/ssd@w500000e01036d021,0:a,raw/mnt/c2t2d2/dev/rdsk/c1t1d1s0
# ln -s../../devices/pci@8,600000/SUNW,qlc@2/fp@0,0/ssd@w500000e01036d021,0:b,raw/mnt/c2t2d2/dev/rdsk/c1t1d1s1
# ln -s../../devices/pci@8,600000/SUNW,qlc@2/fp@0,0/ssd@w500000e01036d021,0:c,raw/mnt/c2t2d2/dev/rdsk/c1t1d1s2
# ln -s../../devices/pci@8,600000/SUNW,qlc@2/fp@0,0/ssd@w500000e01036d021,0:d,raw/mnt/c2t2d2/dev/rdsk/c1t1d1s3
# ln -s../../devices/pci@8,600000/SUNW,qlc@2/fp@0,0/ssd@w500000e01036d021,0:e,raw/mnt/c2t2d2/dev/rdsk/c1t1d1s4
# ln -s../../devices/pci@8,600000/SUNW,qlc@2/fp@0,0/ssd@w500000e01036d021,0:f,raw/mnt/c2t2d2/dev/rdsk/c1t1d1s5
# ln -s../../devices/pci@8,600000/SUNW,qlc@2/fp@0,0/ssd@w500000e01036d021,0:g,raw/mnt/c2t2d2/dev/rdsk/c1t1d1s6
# ln -s../../devices/pci@8,600000/SUNW,qlc@2/fp@0,0/ssd@w500000e01036d021,0:h,raw/mnt/c2t2d2/dev/rdsk/c1t1d1s7
#
# ls -l /mnt/c2t2d2/dev/rdsk/c1t1d1s?
lrwxrwxrwx 1 root root 74 5月 8日 09:15 /mnt/c2t2d2/dev/rdsk/c1t1d1s0 ->../../devices/pci@8,600000/SUNW,qlc@2/fp@0,0/ssd@w500000e01036d021,0:a,raw
lrwxrwxrwx 1 root root 74 5月 8日 09:15 /mnt/c2t2d2/dev/rdsk/c1t1d1s1 ->../../devices/pci@8,600000/SUNW,qlc@2/fp@0,0/ssd@w500000e01036d021,0:b,raw
lrwxrwxrwx 1 root root 74 5月 8日 09:15 /mnt/c2t2d2/dev/rdsk/c1t1d1s2 ->../../devices/pci@8,600000/SUNW,qlc@2/fp@0,0/ssd@w500000e01036d021,0:c,raw
lrwxrwxrwx 1 root root 74 5月 8日 09:15 /mnt/c2t2d2/dev/rdsk/c1t1d1s3 ->../../devices/pci@8,600000/SUNW,qlc@2/fp@0,0/ssd@w500000e01036d021,0:d,raw
lrwxrwxrwx 1 root root 74 5月 8日 09:15 /mnt/c2t2d2/dev/rdsk/c1t1d1s4 ->../../devices/pci@8,600000/SUNW,qlc@2/fp@0,0/ssd@w500000e01036d021,0:e,raw
lrwxrwxrwx 1 root root 74 5月 8日 09:15 /mnt/c2t2d2/dev/rdsk/c1t1d1s5 ->../../devices/pci@8,600000/SUNW,qlc@2/fp@0,0/ssd@w500000e01036d021,0:f,raw
lrwxrwxrwx 1 root root 74 5月 8日 09:15 /mnt/c2t2d2/dev/rdsk/c1t1d1s6 ->../../devices/pci@8,600000/SUNW,qlc@2/fp@0,0/ssd@w500000e01036d021,0:g,raw
lrwxrwxrwx 1 root root 74 5月 8日 09:15 /mnt/c2t2d2/dev/rdsk/c1t1d1s7 ->../../devices/pci@8,600000/SUNW,qlc@2/fp@0,0/ssd@w500000e01036d021,0:h,raw
#
# umount /mnt/c2t2d2/
# sync;sync;sync
# init 5#
# 挂起
拔除c2t2d2和c1t1d1硬盘交换插槽;
加电启动机器,看到登录界面。
[ 本帖最后由 amin 于 2008-5-9 10:22 编辑 ]
我来回答