Hi all. I came across this topic while troubleshooting a recent install of the piaware-sd-card-3.7.1.img onto a USB-SSD controller so that I can use an SSD to boot the RPi instead of an SD-CARD.
The problem I found was that the 60-piaware-support.rules script was causing the boot to fail because it was trying to mount the USB device that contains the root file system.
I worked around this temporarily by removing this script from the udev rules.d location, but then found I lost the ability to automount non-bootable USB MSDs.
In order to regain that capability, I modified the script by adding a single line to test for the bootable MSD’s PARTUUID. Not sure if this is the most robust method, but wanted to post it here to see if anyone has a better suggestion.
-----Modified Script Begin-------
pi@piaware:~ $ sudo more /lib/udev/rules.d/60-piaware-support.rules
These rules call generate-usb-mount to automatically generate
systemd mount units for USB removable storage devices when
they are plugged in. systemd then handles mounting the filesystem
asynchronously (so udev is not blocked)
removable USB partitions only
ACTION==“remove”, GOTO=“usb_mount_end”
SUBSYSTEM!=“block”, GOTO=“usb_mount_end”
ENV{DEVTYPE}!=“partition”, GOTO=“usb_mount_end”
ATTR{removable}==“0”, GOTO=“usb_mount_end”
Do not try to mount the bootable drive
ENV{ID_PART_TABLE_UUID}==“6123ecd4”, GOTO=“usb_mount_end”
IMPORT{parent}=“ID_*”
ENV{ID_BUS}!=“usb”, GOTO=“usb_mount_end”
ok, looks like something we want to try to mount
ACTION==“add”,RUN{program}=“generate-usb-mount add %N”
ACTION==“change”,RUN{program}=“generate-usb-mount change %N”
LABEL=“usb_mount_end”
-----Modified Script End-------
-----After reboot from SSD, the USB thumbdrive is mounted automatically----
pi@piaware:~ $ sudo df -k
Filesystem 1K-blocks Used Available Use% Mounted on
/dev/root 230620884 1211048 220003088 1% /
devtmpfs 470116 0 470116 0% /dev
tmpfs 474724 0 474724 0% /dev/shm
tmpfs 474724 13980 460744 3% /run
tmpfs 5120 4 5116 1% /run/lock
tmpfs 474724 0 474724 0% /sys/fs/cgroup
/dev/sdb1 107768 22040 85728 21% /boot
/dev/sda1 7798784 16 7798768 1% /media/usb/sda1
tmpfs 94944 0 94944 0% /run/user/1000
---- Use udevadm to determine the SSD’s PARTUUID for test in script above—
pi@piaware:~ $ sudo udevadm info -a -q all /dev/sdb
P: /devices/platform/soc/3f980000.usb/usb1/1-1/1-1.5/1-1.5.1/1-1.5.1:1.0/host1/target1:0:0/1:0:0:0/block/sdb
N: sdb
S: disk/by-id/usb-KINGSTON_SA400M8240G_3530303236423736383244423034413920202020-0:0
S: disk/by-path/platform-3f980000.usb-usb-0:1.5.1:1.0-scsi-0:0:0:0
E: DEVLINKS=/dev/disk/by-path/platform-3f980000.usb-usb-0:1.5.1:1.0-scsi-0:0:0:0 /dev/disk/by-id/usb-KINGSTON_SA400M8240G_3530303236423736383244423034413920202020-0:0
E: DEVNAME=/dev/sdb
E: DEVPATH=/devices/platform/soc/3f980000.usb/usb1/1-1/1-1.5/1-1.5.1/1-1.5.1:1.0/host1/target1:0:0/1:0:0:0/block/sdb
E: DEVTYPE=disk
E: ID_BUS=usb
E: ID_INSTANCE=0:0
E: ID_MODEL=SA400M8240G
E: ID_MODEL_ENC=\x20SA400M8240G\x20\x20\x20\x20
E: ID_MODEL_ID=0229
E: ID_PART_TABLE_TYPE=dos
E: ID_PART_TABLE_UUID=6123ecd4
E: ID_PATH=platform-3f980000.usb-usb-0:1.5.1:1.0-scsi-0:0:0:0
E: ID_PATH_TAG=platform-3f980000_usb-usb-0_1_5_1_1_0-scsi-0_0_0_0
E: ID_REVISION=SBFK
E: ID_SERIAL=KINGSTON_SA400M8240G_3530303236423736383244423034413920202020-0:0
E: ID_SERIAL_SHORT=3530303236423736383244423034413920202020
E: ID_TYPE=disk
E: ID_USB_DRIVER=usb-storage
E: ID_USB_INTERFACES=:080650:080662:
E: ID_USB_INTERFACE_NUM=00
E: ID_VENDOR=KINGSTON
E: ID_VENDOR_ENC=KINGSTON
E: ID_VENDOR_ID=045b
E: MAJOR=8
E: MINOR=16
E: SUBSYSTEM=block
E: TAGS=:systemd:
E: USEC_INITIALIZED=7478930
E: net.ifnames=0