(Debian)Linux中的重复分区表

磁盘在软件RAIDarrays中失败,我试图replace它。 我已经完成了这一切没有一个困难,但这次我得到一个错误,当试图复制分区表。

我正在使用这个命令:

sfdisk -l /dev/sda | sfdisk /dev/sdb 

得到这个错误:

 sfdisk: unrecognized input: 121601 cylinders, 255 heads, 63 sectors/track 

阅读sfdisk手册页我不能诚实地看到这个命令是如何工作的,但过去曾多次使用过。

问:如何将确切的分区表复制到第二个磁盘,以便我可以将其用作RAID成员? 我并不喜欢sfdisk,这只是以前的工作。

这里有一些细节,如果有帮助

sfdisk -l / dev / sda

 Disk /dev/sda: 121601 cylinders, 255 heads, 63 sectors/track Units = cylinders of 8225280 bytes, blocks of 1024 bytes, counting from 0 Device Boot Start End #cyls #blocks Id System /dev/sda1 * 0+ 3646 3647- 29294496 fd Linux raid autodetect /dev/sda2 3647 121600 117954 947465505 5 Extended /dev/sda3 0 - 0 0 0 Empty /dev/sda4 0 - 0 0 0 Empty /dev/sda5 3647+ 27961 24315- 195310206 fd Linux raid autodetect /dev/sda6 27962+ 40119 12158- 97659103+ fd Linux raid autodetect /dev/sda7 120628+ 121600 973- 7815591 fd Linux raid autodetect /dev/sda8 119655+ 120627 973- 7815591 fd Linux raid autodetect /dev/sda9 40120+ 119654 79535- 638864856 fd Linux raid autodetect 

sfdisk -l / dev / sdb

 Disk /dev/sdb: 121601 cylinders, 255 heads, 63 sectors/track Units = cylinders of 8225280 bytes, blocks of 1024 bytes, counting from 0 Device Boot Start End #cyls #blocks Id System /dev/sdb1 0+ 121600 121601- 976760001 83 Linux /dev/sdb2 0 - 0 0 0 Empty /dev/sdb3 0 - 0 0 0 Empty /dev/sdb4 0 - 0 0 0 Empty 

也尝试从-d选项pipe道,但这告诉我:

  Device Boot Start End #sectors Id System /dev/sdb1 * 63 58589054 58588992 fd Linux raid autodetect /dev/sdb2 58589055 1953520064 1894931010 5 Extended /dev/sdb3 0 - 0 0 Empty /dev/sdb4 0 - 0 0 Empty /dev/sdb5 58589118 449209529 390620412 fd Linux raid autodetect /dev/sdb6 449209593 644527799 195318207 fd Linux raid autodetect /dev/sdb7 1937888883 1953520064 15631182 fd Linux raid autodetect /dev/sdb8 1922257638 1937888819 15631182 fd Linux raid autodetect /dev/sdb9 644527863 1922257574 1277729712 fd Linux raid autodetect Warning: partition 7 does not start at a cylinder boundary sfdisk: I don't like these partitions - nothing changed. (If you really want this, use the --force option.) 

partition7是否可能从sda的cylendar边界开始,但是不会在sdb上? 我应该解决这个(分手?)还是强迫它?

既然你之前为你工作的命令已经不起作用了,我还是有点犹豫,告诉你用dd克隆MBR吧…如果你敢冒险,就试试它。

 dd if=/dev/sda of=/dev/sdb bs=512 count=1 

该命令应该是

 sfdisk -d /dev/sda | sfdisk /dev/sdb