Subject: Re: software RAID member names questions

From: James Mcphee via PLUG-discuss <[email-masked]>
Date: Sun, 18 May 2025 20:27:30 -0700

you can also tell mdadm which dir it can scan for devices.  it's been a
while, and is very limiting, but a quick google says DEVICE
/dev/disk/by-uuid/* and this corresponds with my recollection.  granted
that was centos5.

On Sun, May 18, 2025 at 8:12 PM James Mcphee <[email-masked]> wrote:

> I wasn't mdadm'ing, so i usually use the fs uuid.  if you want the device
> uuid, it'll need to be that guy and not using ID_FS_UUID.  but it's pretty
> basic down at that level, so as long as you keep your layers right, you
> should be able to find the thing you want to bind to.
>
> On Sun, May 18, 2025 at 8:05 PM James Mcphee <[email-masked]> wrote:
>
>> I've run into things similar and it depends on what you're running.  If
>> it's udev, make a rule in /etc/udev/rules.d/numbered-rule.rules with
>> SUBSYSTEM=="block", ACTION=="add", ENV{ID_FS_UUID}==
>> "123e4567-e89b-12d3-a456-426614174000", NAME="sda"
>> or whatever.  Dunno if this does what you want, but you can pretty much
>> do something like this to handle that kinda thing if you're running udev.
>>
>> On Sat, May 17, 2025 at 10:20 PM der.hans via PLUG-discuss <
>> [email-masked]> wrote:
>>
>>> Am 17. May, 2025 schwätzte Ryan Petris via PLUG-discuss so:
>>>
>>> > You can't, unfortunately. The only thing in /dev you can technically
>>> > rename are network interfaces; the rest you can only add symlinks for,
>>> > which is what for instance /dev/disk/by-partlabel/* is.
>>>
>>> A shame, I like long path names :)
>>>
>>> > Why do you care what mdadm shows for device names anyway? If you're
>>> > concerned that it will pick up the wrong disk on reboot, it won't
>>> > because internally it's using its own identifiers to find the right
>>> > drives, and will snow you whatever /dev/sd* it happens to end up
>>>
>>> It picked up the wrong devices when powering the drive bay down and up
>>> again. mdadm was showing and trying to use the orginal sd names rather
>>> than the newly assigned names.
>>>
>>> I will experiment more with mdadm. It's been a while since I used it, so
>>> was expecting some reacquaintance exercises to be necessary.
>>>
>>> ciao,
>>>
>>> der.hans
>>>
>>> > on when running mdadm commands. If you want to figure out which
>>> > /dev/sd* device belongs to your disk label, you can just run `readlink
>>> > /dev/disk/by-partlabel/raid...`.
>>>
>>>
>>> >
>>> > On Sat, May 17, 2025, at 6:46 PM, der.hans via PLUG-discuss wrote:
>>> >> moin moin,
>>> >>
>>> >> I'm using a USB JBOD enclosure to build a RAID set.
>>> >>
>>> >> Restarting the enclosure ends up with the drives on new names, e.g.
>>> sda,
>>> >> sdb and sdc come back sdd, sde and sdf.
>>> >>
>>> >> I added labels to my disk partitions and was hoping to use them, e.g.
>>> >> /dev/disk/by-partlabel/raid{0,1,2}, but mdadm turned them back to
>>> >> /dev/sd{d,e,f} names as members of the array
>>> >>
>>> >> Anyone know how I can either get /dev/sd names not to change for
>>> removable
>>> >> media or get mdadm to accept the names I want to use?
>>> >>
>>> >> I'd rather the latter.
>>> >>
>>> >> ciao,
>>> >>
>>> >> der.hans
>>> >> --
>>> >> #  https://www.SpiralArray.com   https://www.PhxLinux.org
>>> >> #  <arclight> Delicious red tape, like a Twizzler but flat. And
>>> adhesive.
>>> >> ---------------------------------------------------
>>> >> PLUG-discuss mailing list: [email-masked]
>>> >> To subscribe, unsubscribe, or to change your mail settings:
>>> >> https://lists.phxlinux.org/mailman/listinfo/plug-discuss
>>> >>
>>> >
>>>
>>> --
>>> #  https://www.SpiralArray.com   https://www.PhxLinux.org
>>> #  "Luckily, this is a comic book, for which no idea is too complex."
>>> #    -- Larry Gonick from The Cartoon History of the United
>>> States---------------------------------------------------
>>> PLUG-discuss mailing list: [email-masked]
>>> To subscribe, unsubscribe, or to change your mail settings:
>>> https://lists.phxlinux.org/mailman/listinfo/plug-discuss
>>>
>>
>>
>> --
>> James McPhee
>> [email-masked]
>>
>
>
> --
> James McPhee
> [email-masked]
>

-- 
James McPhee
[email-masked]
---------------------------------------------------
PLUG-discuss mailing list: [email-masked]
To subscribe, unsubscribe, or to change your mail settings:
https://lists.phxlinux.org/mailman/listinfo/plug-discuss