usbmount icon indicating copy to clipboard operation
usbmount copied to clipboard

Noting that Raspbian Buster requires documentation update

Open OutsourcedGuru opened this issue 6 years ago • 17 comments

I've noticed that the format of the /lib/systemd/system/systemd-udevd.service configuration file in Buster has changed from Stretch. The following adjustment is often required, at least for my setup to allow the pi user to be able to see the drive:

Stretch

MountFlags=shared # defaults to "slave"

Buster

PrivateMounts=no # defaults to "yes"

Plot twist

Unfortunately, if you perform a routine sudo apt-get update && sudo apt-get upgrade it will revert this file back to the default, rendering your USB automount seemingly inoperative.

OutsourcedGuru avatar Jul 30 '19 18:07 OutsourcedGuru

Does this apply for the Raspbian version of usbmount (0.22) or the current one from GitHub (0.24)? When manually installing the current GitHub version it seems to work fine, I think this was fixed in 0.24.

nicokaiser avatar Aug 02 '19 10:08 nicokaiser

I'm reasonably sure that this would have been from a combination of actions on Buster:

sudo apt-get install usbmount
sudo apt-get update
sudo apt-get upgrade

I'm not sure what you mean by "fixed"; the Debian interface with attributes has changed. (Or did you mean that the upgrade won't clobber the config file?)

OutsourcedGuru avatar Aug 02 '19 15:08 OutsourcedGuru

The version that is installed by apt-get install usbmount is quite old. I think with the current version (provided by this GitHub repository) it is not necessary to override the service settings. However the current version is a bit tricky to install, as there is no package in Debian yet.

nicokaiser avatar Aug 02 '19 18:08 nicokaiser

I'll say that this is a very useful package when it's working especially for the Lite versions of the OS.

OutsourcedGuru avatar Aug 02 '19 22:08 OutsourcedGuru

Just facing the same problem, and then I discovered devmon witch works flawlessly. it's bundled with the udevil utility.

sudo apt install udevil

And then you can just type devmon to see it working.

It will mount usb drives under /media/USER/USB_LABEL automatically

pi@raspberrypi:~ $ devmon
device: [/dev/sda1]
    systeminternal: [0]
    usage:          [filesystem]
    type:           [vfat]
    label:          [UNTITLED]
    ismounted:      [0]
    nopolicy:       [0]
    hasmedia:       [1]
    opticaldisc:    []
    numaudiotracks: []
    blank:          []
    media:          []
    partition:      [1]
devmon: /usr/bin/udevil --mount /dev/sda1 --mount-options "noexec,nosuid,nodev,noatime"    # (UNTITLED)
Mounted /dev/sda1 at /media/pi/UNTITLED

dezmob avatar Aug 03 '19 08:08 dezmob

Just facing the same problem, and then I discovered devmon witch works flawlessly. it's bundled with the udevil utility.

I think this is no solution for me because I use usbmount on a headless raspi (ssh-ing into it) and it seems that devmon has to be invoked on user-level via the gui-login (perhaps it could be integrated in the login-scripts of the shell, but nothing about this in the docs…).

But I think this thread will be off-topic...

thoschworks avatar Aug 03 '19 09:08 thoschworks

I just added this line in /etc/rc.local to start the daemon when the pi startup

( sleep 5 && sudo -u pi devmon ) &

dezmob avatar Aug 03 '19 09:08 dezmob

Could you try installing version 0.0.24? https://github.com/nicokaiser/usbmount/releases/download/0.0.24/usbmount_0.0.24_all.deb You can install it via dpkg -i usbmount_0.0.24_all.deb after downloading. This updates the Debian/Raspbian version (0.0.22) to the current GitHub master (0.0.24).

nicokaiser avatar Aug 04 '19 20:08 nicokaiser

@nicokaiser Thanks, I'll apply this today.

Does this version revert back to the original configuration file syntax?

mkdir ~/tmpu && cd ~/tmpu
wget https://github.com/nicokaiser/usbmount/releases/download/0.0.24/usbmount_0.0.24_all.deb
sudo dpkg -i usbmount_0.0.24_all.deb
 (Reading database ... 67332 files and directories currently installed.)
 Preparing to unpack usbmount_0.0.24_all.deb ...
 Unpacking usbmount (0.0.24) over (0.0.22) ...
 Setting up usbmount (0.0.24) ...
cd ~ && rm -Rf ~/tmpu

OutsourcedGuru avatar Aug 05 '19 18:08 OutsourcedGuru

Does this version revert back to the original configuration file syntax?

I run this version without any modification in existing configuration files. So, yes, I think so.

nicokaiser avatar Aug 05 '19 18:08 nicokaiser

@dezmob Thank you so much for the udevil solution. This was very easy and worked first try for me.

torsoreaper avatar Aug 30 '19 18:08 torsoreaper

Instead of editing the main .service file, why not use the "drop-in" config file option? https://www.freedesktop.org/software/systemd/man/systemd.unit.html

I suspect even that this "drop-in" file could be automatically installed by Usbmount.

Alternate ways of editting the "drop-in" file include sudo systemctl edit systemd-udevd.

File contents (on Buster) should be simply:

[Service]
PrivateMounts=no

These "drop-in" conf files don't get wiped on updates afaik.

cinderblock avatar Nov 06 '19 22:11 cinderblock

@cinderblock Did you try the version I linked above? It is the latest GitHub version (0.0.24), packaged for Debian (which only has 0.0.22), it should run without modifications or drop-ins.

nicokaiser avatar Nov 06 '19 23:11 nicokaiser

@nicokaiser I did not install from GitHub and just used whatever version apt had, so likely 0.0.22. I'm curious about the systemd based solution! Looks like it will work better in many ways.

cinderblock avatar Nov 06 '19 23:11 cinderblock

I think (!) version 0.0.24 is way more systemd based than 0.0.22, so it may be worth a look.

nicokaiser avatar Nov 06 '19 23:11 nicokaiser

Yes, looking forward to it. Unfortunately, I don't quite have the time to muck around with non-apt installation at this point.

cinderblock avatar Nov 06 '19 23:11 cinderblock

I think (!) version 0.0.24 is way more systemd based than 0.0.22, so it may be worth a look.

Just came across this post because my SD card wouldn't automount anymore on my Octoprint/Raspbian Buster upgrade. Updated usbmount per your instructions to 0.0.24 and now it works again. Thanks!

hapklaar avatar Nov 09 '19 11:11 hapklaar