我的硬盘驱动器在我的服务器上失败。 当我谈到Linux的时候,我感觉非常慢。 我更换了驱动器。
我跑这个:
sfdisk -d /dev/sda | sfdisk /dev/sdb
然后我跑了:
fdisk -l Disk /dev/sda: 2000.4 GB, 2000398934016 bytes 255 heads, 63 sectors/track, 243201 cylinders, total 3907029168 sectors Units = sectors of 1 * 512 = 512 bytes Sector size (logical/physical): 512 bytes / 512 bytes I/O size (minimum/optimal): 512 bytes / 512 bytes Disk identifier: 0x00024c28 Device Boot Start End Blocks Id System /dev/sda1 2048 50333696 25165824+ fd Linux raid autodetect /dev/sda2 50335744 51384320 524288+ fd Linux raid autodetect /dev/sda3 51386368 3907027120 1927820376+ fd Linux raid autodetect WARNING: GPT (GUID Partition Table) detected on '/dev/sdb'! The util fdisk doesn't support GPT. Use GNU Parted. Disk /dev/sdb: 2000.4 GB, 2000398934016 bytes 255 heads, 63 sectors/track, 243201 cylinders, total 3907029168 sectors Units = sectors of 1 * 512 = 512 bytes Sector size (logical/physical): 512 bytes / 512 bytes I/O size (minimum/optimal): 512 bytes / 512 bytes Disk identifier: 0x00024c28 Device Boot Start End Blocks Id System /dev/sdb1 2048 50333696 25165824+ fd Linux raid autodetect /dev/sdb2 50335744 51384320 524288+ fd Linux raid autodetect /dev/sdb3 51386368 3907027120 1927820376+ fd Linux raid autodetect Disk /dev/md2: 1974.0 GB, 1973953691648 bytes 2 heads, 4 sectors/track, 481922288 cylinders, total 3855378304 sectors Units = sectors of 1 * 512 = 512 bytes Sector size (logical/physical): 512 bytes / 512 bytes I/O size (minimum/optimal): 512 bytes / 512 bytes Disk identifier: 0x00000000 Disk /dev/md2 doesn't contain a valid partition table
不知怎的,我得到了这个,但是,我很失落:
cat /proc/mdstat Personalities : [linear] [multipath] [raid0] [raid1] [raid6] [raid5] [raid4] [raid10] md2 : active raid1 sdb3[2] sda3[0] 1927689152 blocks super 1.2 [2/1] [U_] [====>................] recovery = 23.7% (457343168/1927689152) finish=190.9min speed=128320K/sec md0 : inactive sda1[0](S) 25149440 blocks super 1.2 md1 : inactive sda2[0](S) 524032 blocks super 1.2 unused devices: <none>
我正在试图将md0join到raid中。 我想我必须等到这个恢复完成之后我才做其他事情?
UPDATE1我有一点进一步,但不知道md1
# mdadm --stop /dev/md0 mdadm: stopped /dev/md0 # mdadm --stop /dev/md1 mdadm: stopped /dev/md1 # cat /proc/mdstat Personalities : [linear] [multipath] [raid0] [raid1] [raid6] [raid5] [raid4] [raid10] md2 : active raid1 sdb3[2] sda3[0] 1927689152 blocks super 1.2 [2/1] [U_] [=====>...............] recovery = 27.8% (536125376/1927689152) finish=179.4min speed=129207K/sec unused devices: <none> mdadm --assemble --scan mdadm: /dev/md/0 has been started with 1 drive (out of 2). mdadm: /dev/md/1 has been started with 1 drive (out of 2). # cat /proc/mdstat Personalities : [linear] [multipath] [raid0] [raid1] [raid6] [raid5] [raid4] [raid10] md1 : active raid1 sda2[0] 523968 blocks super 1.2 [2/1] [U_] md0 : active raid1 sda1[0] 25149312 blocks super 1.2 [2/1] [U_] md2 : active raid1 sdb3[2] sda3[0] 1927689152 blocks super 1.2 [2/1] [U_] [=====>...............] recovery = 27.8% (537003968/1927689152) finish=198.8min speed=116544K/sec unused devices: <none>
谢谢
您不必等待操作完成,现在可以添加其他分区。 既然你已经添加了sdb3你只需要添加sdb1和sdb2到他们对应的md
mdadm --add /dev/md0 /dev/sdb1 mdadm --add /dev/md1 /dev/sdb2
然后, cat /proc/mdstat应该显示所有三个分区的正确状态。
如果您还没有这样做,您可能需要重新安装grub到两个硬盘。