USB automount not working for Debian Stretch
#1
Hello, folks!

I installed Kodi Krypton on my Debian Stretch system. In contrast to further versions I now cannot access to USB devices I plug in – they are not mounted automatically, and it seems that you cannot do it manually, too. I suppose the reason for this behaviour is that Stretch does not have the package usbmount. When I start Gnome instead of Kodi automount works as expected.

I know there are several topics online how to reach automount functionality (even in this forum), but some don’t work, some are very complicated, some are too old. So: Is there perhaps someone here who also uses debian stretch as a base for his kodi system and who can help me?

I just want to have back the default behavior. Perhaps there is just a kodi option or a debian package to be needed to install? I would appreciate a simple, straightforward solution :-)

Thanks,
Frank
Reply
#2
kodi 17 supports udisks for automounting, but debian has migrated to udisks2.
Kodi 18 supports udisks2
Reply
#3
Ok, but what can I do considering that my debian stretch uses 17? Somehow switch back to udisks?
Reply
#4
yes, or compile kodi 18 from source. Debians kodi package is not supported here, just fyi
Reply
#5
Kodi from source is a little bit too sophisticated for me.

It seems plausible not to support every linux distribution, but as this is the Linux subforum and debian is not the most eccentric distribution, I thought someone perhaps has the same problem. So still kindly asking for a simple solution.
Reply
#6
you can try udevil or a plain udev rule for automounting outside of kodi
Reply
#7
udev, udevil and udisks all sound good, but I need some details – a step-by-step guidance would be great. As I said there are a lot of howtos in the Internet, but none fits sufficiently to my case.
Reply
#8
kodi is just an application in that case. So any tutorial for udevil should work.

Add the polkit file from https://forum.kodi.tv/showthread.php?tid=231955 and
start devmon in the background (devmon &) before (auto) starting kodi.
Reply
#9
First of all, as there is no “trick” within Kodi (that was one of my questions), this is a non-Kodi issue and this thread is a little bit misplaced here in a Kodi forum.

wsnipex, thanks for clarifying that and thanks for trying to help. I did not use your hint with the polkit file (amongst other things because that script seems basically to be designed for shutdown and suspend permissions).

I tried www.axllent.org/docs/view/auto-mounting-usb-storage without success (even added exfat as filetype!) and also saw that this seems to be a common problem. See a German and an English forum thread, both without a real solution.

Nevertheless, the last link helped to give a very dirty workaround: Just add the line
Code:
UUID=bla-bla /mnt/usb auto auto,nofail 0 2
to /etc/fstab.

Indeed, automount when Kodi is already running, works – but only for this certain USB stick. As I always use the same one, that’s ok. Furthermore, you cannot unmount the stick manually.

I am not going to mark this topic as solved, but for now I am halfway satisfied.
Reply
#10
I did it in the past with following solution with kodi v17, working on debian or ubuntu:
Code:
apt install usbmount ntfs-3g

nano /etc/usbmount/usbmount.conf
Code:
FILESYSTEMS="vfat ntfs fuseblk ext2 ext3 ext4 hfsplus"
FS_MOUNTOPTIONS="-fstype=ntfs-3g,nls=utf8,umask=007,gid=46 -fstype=fuseblk,nls=utf8,umask=007,gid=46 -fstype=vfat,gid=1000,uid=1000,umask=007"

nano /etc/udev/rules.d/usbmount.rules
Code:
KERNEL=="sd*", DRIVERS=="sbp2",         ACTION=="add",  PROGRAM="/bin/systemd-escape -p [email protected] $env{DEVNAME}", ENV{SYSTEMD_WANTS}+="%c"
KERNEL=="sd*", SUBSYSTEMS=="usb",       ACTION=="add",  PROGRAM="/bin/systemd-escape -p [email protected] $env{DEVNAME}", ENV{SYSTEMD_WANTS}+="%c"
KERNEL=="ub*", SUBSYSTEMS=="usb",       ACTION=="add",  PROGRAM="/bin/systemd-escape -p [email protected] $env{DEVNAME}", ENV{SYSTEMD_WANTS}+="%c"
KERNEL=="sd*",                          ACTION=="remove",       RUN+="/usr/share/usbmount/usbmount remove"
KERNEL=="ub*",                          ACTION=="remove",       RUN+="/usr/share/usbmount/usbmount remove"

nano /etc/systemd/system/[email protected]
Code:
[Unit]
BindTo=%i.device
After=%i.device

[Service]
Type=oneshot
TimeoutStartSec=0
Environment=DEVNAME=%I
ExecStart=/usr/share/usbmount/usbmount add
RemainAfterExit=yes
Asrock J5040 powered by Ubuntu 23.10 and KODI
Reply
#11
As I wrote in the beginning, there is no package usbmount in Debian Stretch. Probably working for most other distros.
Reply
#12
You can try to build usbmount from github:
Code:
apt-get install debhelper
git clone https://github.com/rbrito/usbmount.git
cd usbmount
dpkg-buildpackage -us -uc -b
cd ..
dpkg -i usbmount_0.0.24_all.deb
Asrock J5040 powered by Ubuntu 23.10 and KODI
Reply
#13
Sorry for the delay, I finally found time to do it. usbmount should now be installed.

Schenckmeier, could you please help me one more time? As I experienced, the adjustments from your first post are still necessary, of course. My USB stick uses exfat – could you please tell me the content of /etc/usbmount/usbmount.conf once again? Or is it absolutly easy, that is just add exfat to the first line “FILESYSTEMS”?
Reply

Logout Mark Read Team Forum Stats Members Help
USB automount not working for Debian Stretch0