免费注册 查看新帖 |

Chinaunix

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

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

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2008-05-09 10:16 |只看该作者 |倒序浏览
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 编辑 ]

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

论坛徽章:
0
3 [报告]
发表于 2008-05-09 14:27 |只看该作者
明白你的意思,但是修改链接太麻烦了

不知道直接将两个链接名称c1t1dt和c2t2d2互换是不是简单一些?

论坛徽章:
0
4 [报告]
发表于 2008-05-09 15:20 |只看该作者
原帖由 dogg 于 2008-5-9 14:27 发表
明白你的意思,但是修改链接太麻烦了

不知道直接将两个链接名称c1t1dt和c2t2d2互换是不是简单一些?


能否告知直接将两个链接名称c1t1dt和c2t2d2互换的操作命令?

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

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


用mv也一样涉及到16次操作,免不了的。
我再次浏览了一次精华贴,发现还是我的方法简单有效。

关键是解决了dd后的镜像光纤硬盘+插到原系统盘位置+启动系统的问题。

论坛徽章:
0
7 [报告]
发表于 2008-05-20 10:01 |只看该作者
头有点晕

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

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

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

回复 #1 amin 的帖子

你试过把根盘拨出来,直接从镜像盘启动吗?

那样你的链接还能找到吗?
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

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

清除 Cookies - ChinaUnix - Archiver - WAP - TOP