我是软件 RAID 1 的新手,希望能在这个论坛寻求帮助。我的上级希望有备份而不是软 RAID1。我怎样才能将软 RAID 1 转换回非 RAID 而不丢失任何数据
以下是 fdisk -l 命令
Disk /dev/sdb: 500.1 GB, 500107862016 bytes, 976773168 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disk label type: dos
Disk identifier: 0x0009ab56
Device Boot Start End Blocks Id System
/dev/sdb1 16611328 879056895 431222784 fd Linux raid autodetect
/dev/sdb2 * 15634432 16611327 488448 fd Linux raid autodetect
/dev/sdb3 2048 7817215 3907584 fd Linux raid autodetect
/dev/sdb4 879056896 976773119 48858112 5 Extended
/dev/sdb5 879058944 976773119 48857088 fd Linux raid autodetect
分区表条目不按磁盘顺序排列
Disk /dev/sda: 500.1 GB, 500107862016 bytes, 976773168 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disk label type: dos
Disk identifier: 0x0009d585
Device Boot Start End Blocks Id System
/dev/sda1 16611328 879056895 431222784 fd Linux raid autodetect
/dev/sda2 * 15634432 16611327 488448 fd Linux raid autodetect
/dev/sda3 2048 7817215 3907584 fd Linux raid autodetect
/dev/sda4 879056896 976773119 48858112 5 Extended
/dev/sda5 879058944 976773119 48857088 fd Linux raid autodetect
分区表条目不按磁盘顺序排列
Disk /dev/md127: 3999 MB, 3999268864 bytes, 7811072 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disk /dev/md126: 50.0 GB, 49996103680 bytes, 97648640 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disk /dev/md125: 500 MB, 500105216 bytes, 976768 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disk /dev/md124: 441.4 GB, 441437913088 bytes, 862183424 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
and the details for df -TH
Filesystem Type Size Used Avail Use% Mounted on
/dev/md126 xfs 47G 23G 24G 49% /
devtmpfs devtmpfs 16G 0 16G 0% /dev
tmpfs tmpfs 16G 0 16G 0% /dev/shm
tmpfs tmpfs 16G 82M 16G 1% /run
tmpfs tmpfs 16G 0 16G 0% /sys/fs/cgroup
/dev/md125 xfs 471M 202M 270M 43% /boot
tmpfs tmpfs 3.2G 0 3.2G 0% /run/user/0
感谢您的建议。
开尔文
答案1
首先,您应该备份您的数据——任何类型的转换都应被视为高风险。... 尤其是在互联网上向不认识的人寻求建议时。
备份数据后,从阵列中拔出一个磁盘(最好是 /dev/sdb)。这将导致阵列性能下降,但也将确保您拥有数据的副本,以防下一步出现问题。
理想情况下,应使用 USB 启动盘执行此操作,因此没有任何活动,但您可能能够从活动磁盘执行此操作。请注意,这可能意味着设备 ID 将发生变化(即 /dev/sda 可能变为 /dev/sdb)。确保您获得正确的设备标识符,不要盲目遵循以下步骤。理解每个步骤很重要。
使用分区编辑器,将 RAID 分区的分区类型从 FD 更改为 83(即 Linux)
修改 /etc/fstab 以指向 /dev/sda? 而不是 UUID,或者更新 UUID 以匹配底层块设备 uuid - 您可以使用“blkid /dev/sda?”找到它)[如果您使用的是 USB 密钥,则需要先挂载它,因此您可能需要执行类似
mount /dev/sdAX /mnt
then edit /mnt/etc/fstab
使用以下命令删除超级块(这将删除 RAID 块)
mdadm --zero-superblock /dev/sda
重新运行 grub -
grub-install /dev/sda