大网数据广告活动
服务器运维问答

Linux Software RAID10: Mysterious renaming /dev/md0 to /dev/md127: Why?

· 52CE 我爱测

During the last two nights we had mysterious events on a server running Ubuntu Linux 12.04 LTS with a Linux mdadm software RAID10: DeviceDisappeared /dev/md0 NewArray /dev/md127 Both messages appeared in the same second, on the s…

问题原文

原帖链接 · pefu · CC BY-SA 3.0

During the last two nights we had mysterious events on a server running Ubuntu Linux 12.04 LTS with a Linux mdadm software RAID10:

DeviceDisappeared /dev/md0
NewArray /dev/md127

Both messages appeared in the same second, on the same time as the logrotate cron action happened. Although the array is still named /dev/md0 in /etc/mdadm/mdadm.conf, it appears as /dev/md127 in the output of cat /proc/mdstat:

Personalities : [linear] [multipath] [raid0] [raid1] [raid10] [raid6] [raid5] [raid4] 
md127 : active raid10 sdb1[0] sdg1[5] sdc1[1] sdh1[6] sdf1[4] sdd1[2] sdk1[9] sdj1[8] sde1[3] sdi1[7]
      9746600960 blocks 512K chunks 2 near-copies [10/10] [UUUUUUUUUU]

unused devices: <none>

Why is this so and how can I fix this?

已采纳解答

原帖链接 · pefu · CC BY-SA 4.0

I figured it out: The UUID in the file /etc/mdadm/mdadm.conf did not match the UUID of the actual software raid array in this server due to some "uncareful" sysadmin activity which happend three days ago. Editing the UUID in this file to the UUID displayed by (in my case, YMMV) the command:

mdadm --examine /dev/sdb1 

and recreating the initrd images using the command (see EDIT2021 below):

update-initramfs -u -k all

and a following reboot fixed the naming back to /dev/md0.
EDIT: @Michael Hamptons comment: The device name /dev/md0 mentioned in the ARRAY line in the configuration file /etc/mdadm/mdadm.conf might be possibly replaced by something like for example /dev/disk/by-label/DATA. But I've not tried this yet: The examples in the manual page of mdadm.conf use device names like /dev/md*. I'm not sure whether such a replacement is possible: The more abstract device names in /dev/disk/by-label/* or /dev/disk/by-uuid/* are created dynamically later on.

EDIT 2021: The above mentioned command:

update-initramfs

is a script specific to Debian/Ubuntu derived flavors of Linux distributions. On RedHat derived distributions (Fedora, CentOS, etc...) it is possible to create a new initramfs file for the currently active kernel using the following command:

mkinitrd /boot/initramfs-`uname -r`.img `uname -r`

摘自公开归档,保留原文语言,版式经整理,外部媒体与邮箱地址已移除。

资料来源与适用范围

资料来源
Server Fault
适用范围
以原帖系统、软件版本与发布日期为准(2015-09-04)
内容语言
中文;命令、路径和错误标识保留技术原文
本地收录日期
2026-11-15
授权说明
CC BY-SA 3.0 / CC BY-SA 4.0

正文与所需资源由本站本地存储。查看来源及更新记录 ↗

请按适用版本和实际日志确认原因;本站没有对每一种系统或设备逐项执行文中的操作。