I’m trying to set up a small build farm on a RasPi 3B+ for STM32 embedded µC boards. These all have an ST-Link USB interface which appears as serial port and as usb drive. The trouble is how to keep them apart, since they all end up being some /dev/ttyACM and the drives all have UUID 2702-1974 (stlink-org/stlink on GitHub helps with this). If I manually connect them using dietpi-drivemanager, I see this:
$ lsblk
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
sda 8:0 1 228K 0 disk
sdb 8:16 1 228K 0 disk
sdc 8:32 1 416K 0 disk
sdd 8:48 1 84K 0 disk
sde 8:64 1 1.5M 0 disk
sdf 8:80 1 420K 0 disk
sdg 8:96 1 6M 0 disk /mnt/l432
sdh 8:112 1 804K 0 disk
mmcblk0 179:0 0 14.8G 0 disk
├─mmcblk0p1 179:1 0 128M 0 part /boot
└─mmcblk0p2 179:2 0 14.7G 0 part /
Trouble is, that “l432” drive is not the right one - after a reboot, drive-manager seems to randomly connect each drive to the /dev/sd devices. Not a surprise, as they are all the same, here’s /etc/fstab:
UUID=2702-1974 /mnt/l053 vfat noatime,lazytime,rw,nofail,noauto,x-systemd.automount
UUID=2702-1974 /mnt/f303 vfat noatime,lazytime,rw,nofail,noauto,x-systemd.automount
UUID=2702-1974 /mnt/f103 vfat noatime,lazytime,rw,nofail,noauto,x-systemd.automount
UUID=2702-1974 /mnt/l011 vfat noatime,lazytime,rw,nofail,noauto,x-systemd.automount
UUID=2702-1974 /mnt/f722 vfat noatime,lazytime,rw,nofail,noauto,x-systemd.automount
UUID=2702-1974 /mnt/g431 vfat noatime,lazytime,rw,nofail,noauto,x-systemd.automount
UUID=2702-1974 /mnt/h743 vfat noatime,lazytime,rw,nofail,noauto,x-systemd.automount
UUID=2702-1974 /mnt/l432 vfat noatime,lazytime,rw,nofail,noauto,x-systemd.automount
There is a way to disambiguate, though:
$ ls -l /dev/disk/by-label/
total 0
lrwxrwxrwx 1 root root 9 Aug 18 10:45 NODE_F303K8 -> ../../sdb
lrwxrwxrwx 1 root root 9 Aug 18 10:45 NODE_F722ZE -> ../../sde
lrwxrwxrwx 1 root root 9 Aug 18 10:45 NODE_H743ZI -> ../../sdg
lrwxrwxrwx 1 root root 9 Aug 18 10:45 NODE_L011K4 -> ../../sdd
lrwxrwxrwx 1 root root 9 Aug 18 10:45 NODE_L053R8 -> ../../sda
lrwxrwxrwx 1 root root 9 Aug 18 10:45 NODE_L432KC -> ../../sdh
lrwxrwxrwx 1 root root 9 Aug 18 10:45 NOD_G431KB -> ../../sdf
lrwxrwxrwx 1 root root 9 Aug 18 10:45 NUCLEO -> ../../sdc
As you can see, L432 got mis-assigned after a reboot (sdg iso sdh).
Is there a way in dietpi to make use of the label information, somehow?
Or some other workaround, outside of dietpi-drivemanager perhaps?
Otherwise, I don’t see how I can avoid these random drive assignments on each reboot.
-jcw