更换驱动器后,如何重建软件 RAID1 阵列?

更换驱动器后,如何重建软件 RAID1 阵列?

我有一台 1and1 专用主机,配置了 RAID 1。其中一个驱动器坏了,他们刚刚用一个好的驱动器替换了它。现在我需要构建,但我不确定哪个驱动器是旧的,哪个是新的空白驱动器。请帮忙。以下是说明:http://help.1and1.com/servers-c37684/linux-server-c37687/system-recovery-c37690/如何重建我的软件 raid 阵列后驱动器更换-a730894.html

据我正确理解,我_思考_我的旧驱动器是 /dev/sda,这意味着我应该按照步骤 7 进行:

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

我说得对吗?这是我的控制台内容。请帮忙,谢谢。

[root@u16365582 ~]# fdisk -l

Disk /dev/sdb: 1000.2 GB, 1000204886016 bytes
255 heads, 63 sectors/track, 121601 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00000000


Disk /dev/sda: 1000.2 GB, 1000204886016 bytes
255 heads, 63 sectors/track, 121601 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x416e0acb

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1               1         523     4194304   fd  Linux raid autodetect
Partition 1 does not end on cylinder boundary.
/dev/sda2             523         784     2097152   82  Linux swap / Solaris
Partition 2 does not end on cylinder boundary.
/dev/sda3             784      121602   970470104   fd  Linux raid autodetect
Partition 3 does not end on cylinder boundary.

Disk /dev/md3: 993.8 GB, 993761296384 bytes
2 heads, 4 sectors/track, 242617504 cylinders
Units = cylinders of 8 * 512 = 4096 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00000000


Disk /dev/md1: 4294 MB, 4294901760 bytes
2 heads, 4 sectors/track, 1048560 cylinders
Units = cylinders of 8 * 512 = 4096 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00000000


Disk /dev/mapper/vg00-usr: 34.4 GB, 34359738368 bytes
255 heads, 63 sectors/track, 4177 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00000000


Disk /dev/mapper/vg00-var: 871.9 GB, 871878361088 bytes
255 heads, 63 sectors/track, 105999 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00000000


Disk /dev/mapper/vg00-home: 4294 MB, 4294967296 bytes
255 heads, 63 sectors/track, 522 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00000000

[root@u16365582 ~]# cat /proc/mdstat
Personalities : [raid1]
md1 : active raid1 sda1[0]
      4194240 blocks [2/1] [U_]
      bitmap: 1/1 pages [4KB], 65536KB chunk

md3 : active raid1 sda3[1]
      970470016 blocks [2/1] [_U]
      bitmap: 206/232 pages [824KB], 2048KB chunk

unused devices: <none>
[root@u16365582 ~]#

答案1

/dev/sda 是 报告的“良好”驱动器mdstat。它也是 报告的具有有效分区数据的驱动器fdisk

如果您之前没有将 /dev/sdb 用于需要保留其数据的任何用途,则按照指南的建议使用 sfdisk 将分区信息复制到 /dev/sdb 应该是安全的。完成此操作后(可能还需要调用一次其他partprobe电话),您应该能够分别将mdadm manage [...] --add [...]分区/dev/sdb1/dev/sdb3复制到md1md3

相关内容