mdraid: /dev/md directory no longer exists

Bug #1922070 reported by Brian Candler
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Ubuntu
New
Undecided
Unassigned

Bug Description

In Ubuntu 20.04 (kernel 5.4.0), the /dev/md directory which contains /dev/md/<NAME> links apparently no longer exists.

# ls -l /dev/md*
brw-rw---- 1 root disk 9, 127 Mar 31 08:46 /dev/md127
#

Compare to an 18.04 system:

$ ls -l /dev/md*
brw-rw---- 1 root disk 9, 0 Mar 26 08:01 /dev/md0
brw-rw---- 1 root disk 9, 1 Mar 26 08:01 /dev/md1

/dev/md:
total 0
lrwxrwxrwx 1 root root 6 Mar 26 08:01 0 -> ../md0
lrwxrwxrwx 1 root root 6 Mar 26 08:01 1 -> ../md1

I've confirmed this is also the case with Debian 10 (also 5.4.0), so it appears to have been an upstream change. It might be in udev/devtmpfs or the kernel itself, I don't know which.

However the md(4) manpage still says that it exists:

SYNOPSIS
       /dev/mdn
       /dev/md/n
       /dev/md/name

There are scripts which depend on the /dev/md/n or /dev/md/name link, e.g. https://github.com/prometheus-community/node-exporter-textfile-collector-scripts/issues/92, so arguably this is a regression. I'm OK with it going, but I think the manpage should be updated to reflect this change.

WORKAROUND: switch to using /dev/disk/by-id/md-name-<FULLNAME>.

# find /dev -lname '*md*'
/dev/log
/dev/disk/by-uuid/f36588df-7e7f-446a-9be4-c0c6d092dcf4
/dev/disk/by-id/md-name-CORE-ELASTIC-VM1:127
/dev/disk/by-id/md-uuid-f6641f8b:65b425e9:298e0ac2:b6c3c83e
/dev/block/9:127
# find /dev -lname '*md*' | xargs ls -l
lrwxrwxrwx 1 root root 8 Mar 31 08:46 /dev/block/9:127 -> ../md127
lrwxrwxrwx 1 root root 11 Mar 31 08:46 /dev/disk/by-id/md-name-CORE-ELASTIC-VM1:127 -> ../../md127
lrwxrwxrwx 1 root root 11 Mar 31 08:46 /dev/disk/by-id/md-uuid-f6641f8b:65b425e9:298e0ac2:b6c3c83e -> ../../md127
lrwxrwxrwx 1 root root 11 Mar 31 08:46 /dev/disk/by-uuid/f36588df-7e7f-446a-9be4-c0c6d092dcf4 -> ../../md127
lrwxrwxrwx 1 root root 28 Mar 31 08:46 /dev/log -> /run/systemd/journal/dev-log

Note that the <FULLNAME> is typically <CREATION_HOST>:<NAME>, and even on older systems which have /dev/md/ the <NAME> may be different to /dev/md/<NAME>.

Tags: bot-comment
Revision history for this message
Ubuntu Foundations Team Bug Bot (crichton) wrote :

Thank you for taking the time to report this bug and helping to make Ubuntu better. It seems that your bug report is not filed about a specific source package though, rather it is just filed against Ubuntu in general. It is important that bug reports be filed about source packages so that people interested in the package can find the bugs about it. You can find some hints about determining what package your bug might be about at https://wiki.ubuntu.com/Bugs/FindRightPackage. You might also ask for help in the #ubuntu-bugs irc channel on Freenode.

To change the source package that this bug is filed about visit https://bugs.launchpad.net/ubuntu/+bug/1922070/+editstatus and add the package name in the text box next to the word Package.

[This is an automated message. I apologize if it reached you inappropriately; please just reply to this message indicating so.]

tags: added: bot-comment
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.