Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mount failed, reason unclear #32

Open
RBJRBJ opened this issue Dec 21, 2020 · 1 comment
Open

Mount failed, reason unclear #32

RBJRBJ opened this issue Dec 21, 2020 · 1 comment

Comments

@RBJRBJ
Copy link

RBJRBJ commented Dec 21, 2020

Running usbmount on Ubuntu 18.04 on a Raspberry Pi 4:
$ uname -a
Linux hfpsrv-simu 5.4.0-1025-raspi #28~18.04.1-Ubuntu SMP PREEMPT Thu Dec 10 03:37:31 UTC 2020 aarch64 aarch64 aarch64 GNU/Linux

Fails to auto mount, see syslog:

Dec 21 09:53:47 hfpsrv-simu usbmount[1820]: /dev/sda2 contains filesystem type ext4
Dec 21 09:53:47 hfpsrv-simu usbmount[1820]: mountpoint /media/sandisk is available for /dev/sda2
Dec 21 09:53:47 hfpsrv-simu usbmount[1820]: executing command: mount -text4 /dev/sda2 /media/sandisk
Dec 21 09:53:47 hfpsrv-simu systemd[1]: [email protected]: Main process exited, code=exited, status=1/FAILURE
Dec 21 09:53:47 hfpsrv-simu systemd[1]: [email protected]: Failed with result 'exit-code'.
Dec 21 09:53:47 hfpsrv-simu systemd[1]: Failed to start [email protected].

$ sudo systemctl status [email protected]
[email protected]
Loaded: loaded (/lib/systemd/system/[email protected]; static; vendor preset: enabled)
Active: failed (Result: exit-code) since Mon 2020-12-21 09:53:47 UTC; 1h 23min ago
Process: 1820 ExecStart=/usr/share/usbmount/usbmount add (code=exited, status=1/FAILURE)
Main PID: 1820 (code=exited, status=1/FAILURE)

Dec 21 09:53:47 hfpsrv-simu systemd[1]: Starting [email protected]...
Dec 21 09:53:47 hfpsrv-simu usbmount[1833]: trying to acquire lock /var/run/usbmount/.mount.lock
Dec 21 09:53:47 hfpsrv-simu usbmount[1840]: acquired lock /var/run/usbmount/.mount.lock
Dec 21 09:53:47 hfpsrv-simu systemd[1]: [email protected]: Main process exited, code=exited, status=1/FAILURE
Dec 21 09:53:47 hfpsrv-simu systemd[1]: [email protected]: Failed with result 'exit-code'.
Dec 21 09:53:47 hfpsrv-simu systemd[1]: Failed to start [email protected].

Manually mounting works fine:
$ sudo mount -text4 /dev/sda2 /media/sandisk
$ df -h
Filesystem Size Used Avail Use% Mounted on
...
/dev/sda2 14G 256M 13G 2% /media/sandisk

Any ideas?

@mpashka
Copy link

mpashka commented Feb 15, 2021

TLDR: Current version already has appropriate changes but raspberry repository still has very old version (2011) and appropriate changes were made in 2017. So solution is take latest version, build as described in readme and install manually.

Reason is described here: https://unix.stackexchange.com/a/551952/240004
In a recent versions of systemd, the udev service file has SystemCallFilter=@System-service @module @raw-io. This doesn't allow the system calls required to mount a filesystem.

Possible fix is to reimplement usbmount as a service rather than raw executable file.
Example for arch linux (russian): https://wiki.archlinux.org/index.php/USB_storage_devices_(%D0%A0%D1%83%D1%81%D1%81%D0%BA%D0%B8%D0%B9)#.D0.90.D0.B2.D1.82.D0.BE.D0.BC.D0.BE.D0.BD.D1.82.D0.B8.D1.80.D0.BE.D0.B2.D0.B0.D0.BD.D0.B8.D0.B5_.D1.81_.D0.B8.D1.81.D0.BF.D0.BE.D0.BB.D1.8C.D0.B7.D0.BE.D0.B2.D0.B0.D0.BD.D0.B8.D0.B5.D0.BC_systemd

Also it is possible to use udisks2 or udevil. Strange thing is udevil claims as a tiny udisks2 replacement but udevil package also requires udisks2. I tried to Use this solution https://holyhead.de/index.php?title=Raspberry_Pi#External_USB_drives with this udev rule https://github.com/souramoo/OpenELECconfig/blob/master/udev.rules.d/95-udevil-mount.rules but it still doesn't work since there is no udevil-mount service installed by udevil.

So issue can be closed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants