免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 5305 | 回复: 8
打印 上一主题 下一主题

dd后换盘,从镜像盘启动系统的一种简便方法 [复制链接]

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

论坛徽章:
0
2 [报告]
发表于 2008-05-09 10:52 |只看该作者
手工操作地方太多 容易搞乱,本版精华区有,你怎么不去参考?

论坛徽章:
0
3 [报告]
发表于 2008-05-09 14:27 |只看该作者
明白你的意思,但是修改链接太麻烦了\r\n\r\n不知道直接将两个链接名称c1t1dt和c2t2d2互换是不是简单一些?

论坛徽章:
0
4 [报告]
发表于 2008-05-09 15:35 |只看该作者
当然一步是做不到了\r\n你的想法是改链接,要写大量的硬盘物理地址\r\n我说的是改名称mv c1t1d1s0 c2t2t2s0,类似这样的\r\n应该也是一样的

论坛徽章:
1
2015亚冠之全北现代
日期:2015-08-11 10:05:30
5 [报告]
发表于 2008-05-20 11:03 |只看该作者
为什么要换插槽呢,直接从镜像盘启动不就行了?

论坛徽章:
0
6 [报告]
发表于 2008-05-27 13:18 |只看该作者
楼上正解,不需要换槽,我们可以 使用\r\n#devaliase disk2 /PCIXXXXXX/SCSIXXXXXXXXXXX\r\n然后boot disk2\r\n我想问一下各位dd的时候引导块已经安装好了没 ?\r\n需要重新\r\ninstallblk  /usr/platform/`uname -i`/lib/fs/ufs/bootblk  /dev/dsk/c0t2d0s0\r\n不阿?

论坛徽章:
0
7 [报告]
发表于 2008-05-27 16:42 |只看该作者

回复 #1 amin 的帖子

你试过把根盘拨出来,直接从镜像盘启动吗?\r\n\r\n那样你的链接还能找到吗?

论坛徽章:
0
8 [报告]
发表于 2008-05-30 10:11 |只看该作者

同意9楼

同意9楼的,我们没必要换槽位吧。\r\n\r\n除非是想把第一块盘拿下来,暂时不用,2块盘做冷备份。\r\n我曾经在一个项目中遇到的客户就是这么做的。

论坛徽章:
1
2015亚冠之全北现代
日期:2015-08-11 10:05:30
9 [报告]
发表于 2008-05-30 15:26 |只看该作者
修改第二块盘的vfstab文件,然后直接从第二块盘启动。
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP