linux raid信息丢失,重新启动后Linux RAID消失

当Linux RAID信息丢失导致设备文件从/dev/md0变为如/dev/md127时,解决办法是使用UUID而非设备文件。创建RAID时,应使用分区设备文件,如/dev/sda1。创建Linux RAID阵列后,通过mkfs.ext4创建文件系统并获取UUID,然后在fstab中使用UUID挂载。避免更新mdadm.conf文件,因为这通常是不必要的。
摘要由CSDN通过智能技术生成

遇到同样的问题后,这个食谱对我有用。环顾四周,试图找到答案,最后遇到了这个问题,仍然没有帮助。

我认为这个问题是多重的。

mdadm reassigns the device files from /dev/md0 to something like /dev/md127 on the next reboot. So you cannot just use the device file in the fstab. I ended up using the UUID, from the created filesystem.

Almost all the RAID drive setup tutorials on the web are showing the creation of the RAID device using the driver device files like this:

mdadm --create --verbose /dev/md0 --level=0 --raid-devices=4 /dev/sda /dev/sdb /dev/sdc /dev/sdd

Instead I used the partition device files, like this:

mdadm --create --verbose /dev/md0 --level=0 --raid-devices=4 /dev/sda1 /dev/sdb1 /dev/sdc1 /dev/sdd1

The second form requires proper creation of partitions on each disk using gdisk or fdisk. I used gdisk and assigned it as type fd00, which is a raid partition.

There's lots of talk about needing to update /etc/mdadm/mdadm.conf. This is wrong. I purposefully, deleted that file. It's not needed. (See below)

真的就是全部。完整食谱如下...

Partition each drive with one partition of type fd00, Linux RAID:

root@teamelchan:~# gdisk /dev/sda

Command (? for help): n

Partition number (1-128, default 1):

First sector (2048-3907029134, default = 2048) or {+-}size

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值