Discussion:
any way to make names /dev/md[0-9]* consistent boot to boot
(too old to reply)
Robert Riches
2018-03-02 05:13:15 UTC
Permalink
Is there any reasonable way to make RAID device names
/dev/md[0-9]* consistent from one boot to the next?

On my Slackware 14.2 test VM, I have several RAID10s, each from a
given partition slice on four /dev/vd[abcd] disks (which are
partitioned identically). My /etc/mdadm.conf specifies names of
the form /dev/md/*, and they come up consistently from boot to
boot (else everything would be sunk). However, the /dev/md[0-9]*
names (/dev/md122 through /dev/md127) differ from one boot to the
next.

Thanks,
--
Robert Riches
***@jacob21819.net
(Yes, that is one of my email addresses.)
Lew Pitcher
2018-03-02 14:24:56 UTC
Permalink
Post by Robert Riches
Is there any reasonable way to make RAID device names
/dev/md[0-9]* consistent from one boot to the next?
On my Slackware 14.2 test VM, I have several RAID10s, each from a
given partition slice on four /dev/vd[abcd] disks (which are
partitioned identically). My /etc/mdadm.conf specifies names of
the form /dev/md/*, and they come up consistently from boot to
boot (else everything would be sunk). However, the /dev/md[0-9]*
names (/dev/md122 through /dev/md127) differ from one boot to the
next.
That sounds like a job for some site-specific, custom udev rules.
--
Lew Pitcher
"In Skills, We Trust"
PGP public key available upon request
invalid
2018-03-02 14:36:20 UTC
Permalink
Does UUID or whatever it's called help with this? It seems it is some sort
of checksum for each device that doesn't change.

You can use the UUID in /etc/fstab and the mounts seem to work.
Post by Lew Pitcher
Post by Robert Riches
Is there any reasonable way to make RAID device names
/dev/md[0-9]* consistent from one boot to the next?
On my Slackware 14.2 test VM, I have several RAID10s, each from a
given partition slice on four /dev/vd[abcd] disks (which are
partitioned identically). My /etc/mdadm.conf specifies names of
the form /dev/md/*, and they come up consistently from boot to
boot (else everything would be sunk). However, the /dev/md[0-9]*
names (/dev/md122 through /dev/md127) differ from one boot to the
next.
That sounds like a job for some site-specific, custom udev rules.
Robert Riches
2018-03-03 03:21:13 UTC
Permalink
Post by invalid
Does UUID or whatever it's called help with this? It seems it is some sort
of checksum for each device that doesn't change.
You can use the UUID in /etc/fstab and the mounts seem to work.
Post by Lew Pitcher
Post by Robert Riches
Is there any reasonable way to make RAID device names
/dev/md[0-9]* consistent from one boot to the next?
On my Slackware 14.2 test VM, I have several RAID10s, each from a
given partition slice on four /dev/vd[abcd] disks (which are
partitioned identically). My /etc/mdadm.conf specifies names of
the form /dev/md/*, and they come up consistently from boot to
boot (else everything would be sunk). However, the /dev/md[0-9]*
names (/dev/md122 through /dev/md127) differ from one boot to the
next.
That sounds like a job for some site-specific, custom udev rules.
Thanks for the suggestion of using the UUIDs. I can already use
the /dev/md/home, /dev/md/slash, /dev/md/swap, /dev/md/tmp, and
/dev/md/usrlocal names in /etc/fstab and elsewhere.

Thanks.
--
Robert Riches
***@jacob21819.net
(Yes, that is one of my email addresses.)
King Beowulf
2018-03-03 16:32:26 UTC
Permalink
Post by invalid
Does UUID or whatever it's called help with this? It seems it is some
sort of checksum for each device that doesn't change.
You can use the UUID in /etc/fstab and the mounts seem to work.
Post by Lew Pitcher
Is there any reasonable way to make RAID device names /dev/md[0-9]*
consistent from one boot to the next?
On my Slackware 14.2 test VM, I have several RAID10s, each from a
given partition slice on four /dev/vd[abcd] disks (which are
partitioned identically). My /etc/mdadm.conf specifies names of the
form /dev/md/*, and they come up consistently from boot to boot (else
everything would be sunk). However, the /dev/md[0-9]*
names (/dev/md122 through /dev/md127) differ from one boot to the
next.
That sounds like a job for some site-specific, custom udev rules.
One of my slackware boxes way back bounced around a bit due to /dev/hdX
vs /dev/sdX.

As suggested, you can either set up a udev rule to lock the device nodes
or use UUIDs or PARTUUIDs to identify. These unique identifiers will
always linked to the correct /dev node even if said node changes. See

blkid

/dev/disk/{by-id,by-partuuid,by-uuid}

Robert Riches
2018-03-03 03:19:01 UTC
Permalink
Post by Lew Pitcher
Post by Robert Riches
Is there any reasonable way to make RAID device names
/dev/md[0-9]* consistent from one boot to the next?
On my Slackware 14.2 test VM, I have several RAID10s, each from a
given partition slice on four /dev/vd[abcd] disks (which are
partitioned identically). My /etc/mdadm.conf specifies names of
the form /dev/md/*, and they come up consistently from boot to
boot (else everything would be sunk). However, the /dev/md[0-9]*
names (/dev/md122 through /dev/md127) differ from one boot to the
next.
That sounds like a job for some site-specific, custom udev rules.
Thanks for that suggestion. Writing custom udev rules sounds
risky. One wrong keystroke could make the system fail to boot.

Assuming the lack of consistency continues after I migrate the
base (hardware) machine to Slackware, I'll live with it. It's
only a couple of extra minutes of bookkeeping each boot, which is
around a dozen or so times per year.

Thanks.
--
Robert Riches
***@jacob21819.net
(Yes, that is one of my email addresses.)
Grant Taylor
2018-03-03 03:48:31 UTC
Permalink
Post by Robert Riches
Thanks for that suggestion. Writing custom udev rules sounds
risky. One wrong keystroke could make the system fail to boot.
You should be able to make it effectively no risk at all.

You can test your udev rules to your hearts content while booted.
udev-adm (?) has a keyword, I think it's trigger.

You should be able to edit, trigger, test, repeat.
--
Grant. . . .
unix || die
Loading...