sfdiskはパーティションが好きではありません。ソフトウェアRAIDを復元するために別のハードドライブをダンプしたいと思います。

sfdiskはパーティションが好きではありません。ソフトウェアRAIDを復元するために別のハードドライブをダンプしたいと思います。

私はCent OS 6.5を使用しています。

互いに同じコピーである2つのハードドライブ(/dev/sdaと/dev/sdb)があります。

/dev/sdaが失敗し、交換する必要があります。

すべてコピーしようとしています。/dev/sdb到着/dev/sda

コマンドを実行しようとするとsfdisk -d /dev/sdb | sfdisk -d /dev/sdb |、次のような結果が得られます。

Checking that no-one is using this disk right now ...
OK

Disk /dev/sda: 121601 cylinders, 255 heads, 63 sectors/track
Old situation:
Units = cylinders of 8225280 bytes, blocks of 1024 bytes, counting from 0

Device Boot Start     End   #cyls    #blocks   Id  System
/dev/sda1          0       -       0          0    0  Empty
/dev/sda2          0       -       0          0    0  Empty
/dev/sda3          0       -       0          0    0  Empty
/dev/sda4          0       -       0          0    0  Empty
New situation:
Units = sectors of 512 bytes, counting from 0

Device Boot    Start       End   #sectors  Id  System
/dev/sda1   *      4096  41947135   41943040  fd  Linux raid autodetect
/dev/sda2      41947136 1952468991 1910521856  fd  Linux raid autodetect
/dev/sda3     1952468992 1953519615    1050624  82  Linux swap / Solaris
/dev/sda4             0         -          0   0  Empty
Warning: partition 1 does not end at a cylinder boundary

sfdisk: I don't like these partitions - nothing changed.
(If you really want this, use the --force option.)

別の-l次を返します。

Model: ATA Hitachi HUA72201 (scsi)
Disk /dev/sda: 1000GB
Sector size (logical/physical): 512B/512B
Partition Table: msdos

Number  Start  End  Size  Type  File system  Flags


Model: ATA ST1000DM003-9YN1 (scsi)
Disk /dev/sdb: 1000GB
Sector size (logical/physical): 512B/4096B
Partition Table: msdos

Number  Start   End     Size    Type     File system     Flags
1      2097kB  21.5GB  21.5GB  primary  ext4            boot, raid
2      21.5GB  1000GB  978GB   primary  ext4            raid
3      1000GB  1000GB  538MB   primary  linux-swap(v1)

私も試しましたsgdisk -R=/dev/sda /dev/sdbただし、このコマンドは出力またはエラーメッセージをまったく返しません。

どうすればいいですか?

ベストアンサー1

シリンダー境界と整列する必要がある要件は、長い間消えてきました。 4kブロックのドライブと128k消去ブロックを持つSSDが導入されたら、これらのブロックの倍数を揃える必要があります。 1MiB境界の位置合わせは新しい標準と見なされ、DIが押出に使用することです。

源泉

--forceソートが良いと思われる場合は、このオプションを使用できます。

おすすめ記事