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

USBmount fails on Debian Stretch #2

Closed
martignoni opened this issue Aug 19, 2017 · 14 comments
Closed

USBmount fails on Debian Stretch #2

martignoni opened this issue Aug 19, 2017 · 14 comments

Comments

@martignoni
Copy link
Contributor

@martignoni martignoni commented Aug 19, 2017

On Debian Stretch, USBmount doesn't work, notably with vfat formatted drives.

@ravemir
Copy link

@ravemir ravemir commented Aug 26, 2017

I might be experiencing this, as well. From my experience, neither '/media/usb' drives displayed the expected content, nor did '/var/run/usbmount'.

Using fstab to target a mountpoint, while using the drive's UUID would not help, either.

@ravemir
Copy link

@ravemir ravemir commented Aug 26, 2017

Disregard: after a reboot, the drive was mounted, possibly due to fstab itself.

But after unmounting, plugging off and in, the drive was successfully mounted automatically.

Not sure if expected, but both '/media/usb' and '/var/run/usbmount/' mountpoints were non-exiting, although that's likely due to being overriden by the fstab configurations.

@martignoni : have you tried this? if so, could you provide better details on what you have tried to get it to work?

@martignoni
Copy link
Contributor Author

@martignoni martignoni commented Aug 27, 2017

@ravemir: to make automount work, I had to drop USBmount (and that's too bad, as it works very well out of the box on Jessie), and use the mechanism used in project nextcloudpi. This works OK on stretch.

But I would be glad to revert to USBmount, for its simplicity of use.

@42Swampy
Copy link

@42Swampy 42Swampy commented Sep 4, 2017

Can you explain me, how to use the script.
I made it executable and started it. Nothing happened.
I am using raspbian stretch lite.

@mmmmna
Copy link

@mmmmna mmmmna commented Sep 13, 2017

In support of ravemir's initial comment, no /var/run/usbmount, because usbmount is not installed (per Synaptic). I'm using (Debian derived) Point Linux 3.2 amd64.

@georgejhunt
Copy link

@georgejhunt georgejhunt commented Sep 20, 2017

The udev version in stretch does not cooperate with usbmount as well as jessie did. Systemd-udevd.service unit file has an option in stretch which says "MountFlags=slave" which causes the mounted USB drive to disappear after the udev script terminates.
Setting the line to "MountFlages=shared" returns the usbmount function to what worked in jessie.

@martignoni
Copy link
Contributor Author

@martignoni martignoni commented Sep 20, 2017

@georgejhunt Thanks for this info. Do you know a way to invoke this flag at runtime or is it necessary to change permanently the Systemd-udevd.service unit file? (I'm a bit reluctant to make a change that could break something elsewhere.)

@georgejhunt
Copy link

@georgejhunt georgejhunt commented Sep 20, 2017

@martignoni
Copy link
Contributor Author

@martignoni martignoni commented Sep 20, 2017

@georgejhunt: I implemented your suggested fix. It works as intended and doesn't seem to break anything. For reference, this answer on StackExchange details the process.

@rbrito
Copy link
Owner

@rbrito rbrito commented Sep 22, 2017

If anybody has any suggestion and/or improvements that they want me to merge in a new release, please just send a pull request.

@georgejhunt
Copy link

@georgejhunt georgejhunt commented Sep 29, 2017

Another issue on rpi with only some SD cards. Systemd-udevd.service is started when the rootfs is mounted ReadOnly. This causes efforts by the action scripts in /etc/usbmount/mount.d/ to be unable to write symbolic links (etc). The following unit file restarts the udevd later in the boot process when the file system is ReadWrite. Place this file in /etc/systemd/system/ and do "systemctl enable udev-reboot".

[Unit]
Description=Make sure udev is operating on ReadWrite disk
After=network-online.target

[Service]
ExecStart=/bin/systemctl restart systemd-udevd.service

[Install]
WantedBy=multi-user.target
@martignoni
Copy link
Contributor Author

@martignoni martignoni commented Oct 20, 2017

@rbrito Did you see pull request? Is there any chance that it get merged?

Cheers!

@rbrito rbrito closed this in eeb7e3a Nov 1, 2017
rbrito added a commit that referenced this issue Nov 1, 2017
Fix for issue #2, USBmount fails on Stretch.

Thanks @martignoni for the work!
@cinderblock
Copy link

@cinderblock cinderblock commented Nov 5, 2019

In case anyone runs across this issue now (like I did searching for solutions), the latest systemd (used in Buster) has changed this slightly. Now PrivateMounts=no is required instead of MountFlages=shared.

@martignoni
Copy link
Contributor Author

@martignoni martignoni commented Nov 6, 2019

@cinderblock: this issue was about Stretch support. Please refer to #25.

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

Successfully merging a pull request may close this issue.

None yet
7 participants