USBMount not mounting problem
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Raspbian |
New
|
Undecided
|
Unassigned |
Bug Description
copied from: https:/
I had a portable harddisk connected using USB to my Raspberry Pi B+ Rev3 running Raspbian 9. The harddisk had two partitions: NTFS and ext4. I had usbmount installed and configured as described here. When Raspbian is booted up with the harddisk already plugged in, I could see using sudo fdisk -l that the ext4 partition was visible. So, usbmount should have automatically mounted this ext4 partition to /media/usb0, but it was not doing that.
I had verbose logging enabled for usbmount as described here. When I searched the system log I could see that usbmount was actually mounting the ext4 partition, but surprisingly it was not visible at /media/usb0:
$ cat /var/log/syslog | grep usbmount
980:May 18 11:42:28 my-pi usbmount[373]: /dev/sda2 contains filesystem type ext4
989:May 18 11:42:28 my-pi usbmount[373]: mountpoint /media/usb0 is available for /dev/sda2
991:May 18 11:42:28 my-pi usbmount[373]: executing command: mount -text4 -osync,
1010:May 18 11:42:28 my-pi usbmount[373]: executing command: run-parts /etc/usbmount/
1013:May 18 11:42:28 my-pi usbmount[373]: usbmount execution finished
Solution
Turned out that systemd was the culprit. Open your /usr/lib/
To change this mount option, run this command:
$ sudo systemctl edit systemd-udevd
Add these lines to the empty file that is opened and save that file:
(for Ubuntu 20.04 or later)
[Service]
PrivateMounts=no
(for Ubuntu 18.04 or older)
[Service]
MountFlags=shared
I found that this created the file /etc/systemd/
Restart systemd:
$ sudo systemctl daemon-reload
$ sudo service systemd-udevd --full-restart
Now, reinsert the storage device or restart the Pi.
After the restart, I found that usbmount had automatically mounted my ext4 partition.
bug still exists in 2022-04- 04-raspios- bullseye- armhf-lite. img