daveraver
Posts: 11
Joined: Thu Apr 28, 2016 7:39 pm

usbmount doesnt work

Fri Sep 01, 2017 9:03 pm

after upgrading to strech, usbmount doesnt work, and usb hdd device can only be mounted manually on console. has anybody experimented the same issue?
thanks

daveraver
Posts: 11
Joined: Thu Apr 28, 2016 7:39 pm

Re: usbmount doesnt work

Sat Sep 02, 2017 1:17 pm

I little deceptioned with raspbian lite 9, some of the configurations for jessie doesnt work with stretch. Where to learn about new stretch setup ?

DirkS
Posts: 10421
Joined: Tue Jun 19, 2012 9:46 pm
Location: Essex, UK

Re: usbmount doesnt work

Sat Sep 02, 2017 1:24 pm

daveraver wrote:
Sat Sep 02, 2017 1:17 pm
I little deceptioned with raspbian lite 9, some of the configurations for jessie doesnt work with stretch. Where to learn about new stretch setup ?
Probably in various places...
Which setups / configurations do you have problems with?

(Of course there's always Google. Adding Raspbian Stretch or Debian Stretch to any search may find some good sources)

klricks
Posts: 7239
Joined: Sat Jan 12, 2013 3:01 am
Location: Grants Pass, OR, USA
Contact: Website

Re: usbmount doesnt work

Sat Sep 02, 2017 1:29 pm

Auto mounting of a USB 'stick'' worked fine for me in Stretch same as Jessie.
Unless specified otherwise my response is based on the latest and fully updated RPiOS Buster w/ Desktop OS.

mina
Posts: 30
Joined: Sun Sep 03, 2017 11:49 am
Location: Switzerland
Contact: Website

Re: usbmount doesnt work

Sun Sep 03, 2017 11:51 am

daveraver wrote:
Fri Sep 01, 2017 9:03 pm
after upgrading to strech, usbmount doesnt work, and usb hdd device can only be mounted manually on console. has anybody experimented the same issue?
thanks
Yes, see https://github.com/rbrito/usbmount/issues/2
Maintainer of MoodleBox, a Moodle server on Raspberry Pi

User avatar
Swampy42
Posts: 15
Joined: Sat Sep 02, 2017 9:19 pm
Location: Kempten (Germany)
Contact: Website

Re: usbmount doesnt work

Fri Sep 08, 2017 5:47 pm

For me usbmount doesn't work in Raspbian Stretch too.
Because I must use usb automount for my webradio I saw this solution:

https://raspberrypi.stackexchange.com/q ... thout-uuid
(last entry for now)

It's not as easy as usbmount, but it works for me.
I only had to change the rights:

Code: Select all

sudo chmod 0777 /usr/local/bin/cpmount
Last edited by Swampy42 on Sat Sep 16, 2017 9:42 am, edited 1 time in total.
Linux is like wigwam: no Gates, no Windows and Apache inside.

User avatar
yy502
Posts: 30
Joined: Sun Aug 03, 2014 2:15 am
Location: Cambridge, UK

Re: usbmount doesnt work

Thu Sep 14, 2017 10:31 pm

Here's my solution based on the one mentioned in previous post.

Code: Select all

sudo apt-get install pmount

Add the following to /etc/udev/rules.d/usbstick.rules

Code: Select all

ACTION=="add", KERNEL=="sd[a-z][0-9]", TAG+="systemd", ENV{SYSTEMD_WANTS}="usbstick-handler@%k"

Add the following to /lib/systemd/system/usbstick-handler@.service

Code: Select all

[Unit]
Description=Mount USB sticks
BindsTo=dev-%i.device
After=dev-%i.device

[Service]
Type=oneshot
RemainAfterExit=yes
ExecStart=/usr/local/bin/automount %I
ExecStop=/usr/bin/pumount /dev/%I

Add the following to /usr/local/bin/automount

Code: Select all

#!/bin/bash

PART=$1
FS_LABEL=`lsblk -o name,label | grep ${PART} | awk '{print $2}'`

if [ -z ${FS_LABEL} ]
then
    /usr/bin/pmount --umask 000 --noatime -w --sync /dev/${PART} /media/${PART}
else
    /usr/bin/pmount --umask 000 --noatime -w --sync /dev/${PART} /media/${FS_LABEL}_${PART}
fi

Code: Select all

sudo chmod +x /usr/local/bin/automount
Reboot.

The mount points/folders names will be in the format of /media/<PartitionLabel>_<sdxy>. In case a partition has no label, it will just be /media/<sdxy>.

I normally label my USB drives with their capacity. e.g. 8G, 16G. When I plug in multiple USB disks with the same label, I can still distinguish them as, for example:

Code: Select all

/media/500G_sdb1
/media/500G_sdc1
I will update the automount script to ignore root partition on USB drive, if not using SD card for root, so the USB root partition is not mounted twice, i.e. at / and /media/xxx

User avatar
micksulley
Posts: 178
Joined: Sat Mar 03, 2012 11:48 am
Location: Melton Mowbray, England

Re: usbmount doesnt work

Tue Oct 03, 2017 3:03 pm

This link https://github.com/rbrito/usbmount/issues/2 has the solution.
Edit /lib/systemd/system/systemd-udevd.service and change the line
MountFlags=slave
to
MountFlags=shared
then reboot

blackhawk60
Posts: 1
Joined: Tue Jan 30, 2018 6:33 pm

Re: usbmount doesnt work

Tue Jan 30, 2018 6:34 pm

Thanks! Your response helped me a lot.
(I even registered for posting this)

User avatar
AlbertB
Posts: 1
Joined: Fri Mar 02, 2018 2:30 pm
Location: Germany

Re: usbmount doesnt work

Fri Mar 02, 2018 2:46 pm

I am on Stretch as well and had the same issue. usbmount won't work out of the box. To fix this issue I cloned the newest version (0.0.24) from github and built a new Debian package myself.

Try this:

• As we are going to create a Debian package on our own we have to install debhelper package

Code: Select all

sudo apt-get install debhelper
• Clone usbmount from github

Code: Select all

git clone https://github.com/rbrito/usbmount.git
• Creata Debian package

Code: Select all

cd usbmount
sudo dpkg-buildpackage -us -uc -b
• Install newly created package

Code: Select all

cd ..
sudo apt install  ./usbmount_0.0.24_all.deb
• Reboot

Code: Select all

sudo shutdown -r now

eschik123
Posts: 3
Joined: Wed Jan 06, 2016 9:18 pm

Re: usbmount doesnt work

Mon Aug 26, 2019 5:15 pm

I know this is an old post.. but I figured I would update the answer that worked for me in Buster:

https://raspberrypi.stackexchange.com/q ... ot-working

Return to “Raspberry Pi OS”