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.
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 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: PLUG-discuss@lists.phxlinux.org
> To subscribe, unsubscribe, or to change your mail settings:
> https://lists.phxlinux.org/mailman/listinfo/plug-discuss
>
---------------------------------------------------
PLUG-discuss mailing list:
PLUG-discuss@lists.phxlinux.org
To subscribe, unsubscribe, or to change your mail settings:
https://lists.phxlinux.org/mailman/listinfo/plug-discuss