实验环境:
Disk /dev/sdb: 42.9 GB, 42949672960 bytes
255 heads, 63 sectors/track, 5221 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Device Boot Start End Blocks Id System
/dev/sdb1 1 1246 10008463+ 83 Linux
/dev/sdb2 1247 2492 10008495 83 Linux
/dev/sdb3 2493 3738 10008495 83 Linux
/dev/sdb4 3739 5221 11912197+ 83 Linux
Disk /dev/sdc: 42.9 GB, 42949672960 bytes
255 heads, 63 sectors/track, 5221 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Device Boot Start End Blocks Id System
/dev/sdc1 1 1246 10008463+ 83 Linux
/dev/sdc2 1247 2492 10008495 83 Linux
/dev/sdc3 2493 3738 10008495 83 Linux
/dev/sdc4 3739 5221 11912197+ 83 Linux
[root@dbserver ~]#
磁盘组ARCH对应磁盘/dev/sdb4。
1.新建磁盘组ARCH2对应磁盘/dev/sdc4.
2.备份/dev/sdc4磁盘头(2个au,默认即2M)
[root@dbserver eisoo]# dd if=/dev/sdc4 of=/eisoo/sdc4_2097152 bs=2097152 count=1
1+0 records in
1+0 records out
2097152 bytes (2.1 MB) copied, 0.04031 seconds, 52.0 MB/s
3.将/dev/sdbb4磁盘全部dd到/dev/sdc4
[root@dbserver eisoo]# dd if=/dev/sdb4 of=/dev/sdc4 bs=209715200
58+1 records in
58+1 records out
12198090240 bytes (12 GB) copied, 354.003 seconds, 34.5 MB/s
4.将备份的/dev/sdc4磁盘头覆盖到/dev/sdc4
[root@dbserver eisoo]# dd if=/eisoo/sdc4_2097152 of=/dev/sdc4 bs=2097152 count=1 conv=notrunc
1+0 records in
1+0 records out
2097152 bytes (2.1 MB) copied, 0.087591 seconds, 23.9 MB/s
################################################################################
2-4步也可参照以下1步实现,注意skip和seek后接BLOCKS。
[root@dbserver eisoo]# dd if=/dev/sdb4 of=/dev/sdc4 bs=2097152 skip=1 seek=1
11910149+1 records in
11910149+1 records out
12195993088 bytes (12 GB) copied, 402.23 seconds, 30.3 MB/s
################################################################################
至此ARCH恢复到ARCH2,ARCH2只能供临时拷贝数据,不能重启,重启会报错,待研究。