[GTALUG] RaspberryPi won't automount USB memory stick

Nicholas Krause xerofoify at gmail.com
Sat Jan 15 17:06:04 EST 2022



On 1/15/22 10:36, mwilson--- via talk wrote:
>>
>>
>> On 1/14/22 23:24, Kevin Cozens via talk wrote:
>>> Greetings, all.
>>>
>>> I have an embedded system that uses a Raspberry Pi 3. I have it set up
>>> and running with the latest Raspbian and all is well, almost. For some
>>> reason the Raspbian system is not set up to automount memory sticks when
>>> they are inserted in to a USB port on the machine.
>>>
>>> On another embedded system I needed to install the usbmount package to
>>> get the system to automount a memory stick when it is inserted. I have
>>> installed usbmount on the RPi but it still won't automount a USB memory
>>> stick. The output from dmesg reports that it is seeing the insertion of
>>> the USB memory device. The device is also reported under lsusb.
>>>
>>> Why is Raspbian not set up to automount a memory stick like is done on a
>>> normal Linux based desktop? My desktop does it and I don't have an
>>> usbmount package installed. How do I configure Raspbian to automount a
>>> memory stick?
>>>
>>
>> Normally it's something with systemd or udev rule flags. I had to google
>> it as I'm
>> not aware of all the rules. See if this works:
>>
>> Make sure it works  by changing MountFlags=slave to MountFlags=shared
>> here:
>>
>> sudo nano /lib/systemd/system/systemd-udevd.service
>>
>> Not sure this helps,
>> Nick
> 
> On a headless web server here, up-to-date Raspbian,  dmesg shows that
> plugging in a USB flash drive creates a device  /dev/sda and /dev/sda1 .
> These devices disappear when the flash drive is unplugged.
> 
> The SD chip serving as the 'hard-drive' is present as /dev/mmcblk0 .
> 
> In Raspbian with the full GUI, something in the GUI catches a plugged-in
> flash drive and mounts it under /media/username .  I don't know how.
> udev?
> 

That is correct it's udev or the part of systemd that does it. I mentioned it my
previous email but your package should work. The problem is the flag in
/lib/systemd/system/systemd-udevd.service. Seems this needs to be  MountFlags=shared
instead of slave. I would check to see if MountFlags in that file is set correctly
first.

Nick

> 
> ---
> Post to this mailing list talk at gtalug.org
> Unsubscribe from this mailing list https://gtalug.org/mailman/listinfo/talk
> 


More information about the talk mailing list