jyskim
Posts: 2
Joined: Sat Aug 29, 2015 5:56 pm

how to disable kodi automount

Sat Aug 29, 2015 6:14 pm

Hi all,

I like to get your help how to disable kodi automount under RASPBIAN.

This problem troubles me 3 days - I have a usb disk with volume "MYDISK",
which is mounted at /home/usb (on /etc/fstab). This contains videos I watch
on kodi and I also setup SMB to share with my other PC's.

Problem is after some moments, kodi automounts the same usb as another
mount "MYDISK" itself, then fstab setting is switched off itself and my
watching movie stops.

Initially fstab was set /dev/sda1 and for a try now I switched it to use UUID,
then fstab setting stays, but the file system access becomes very slow.
I guess it's due to double mounting - 1stly on MYDISK, 2ndly on /home/usb.

Suspecting MYDISK might be due to my own setup, I redo the complete
setup starting from downloading RASPBIAN and reinstalling, but in vain.
And I am now sure that kodi automounts the usb disk by the label name.

best regards,
Johan

beta-tester
Posts: 1221
Joined: Fri Jan 04, 2013 1:57 pm
Location: de_DE

Re: how to disable kodi automount

Sun Aug 30, 2015 6:50 am

i am not sure, if this will help you, because i guess you are not using OpenELEC.
but under OpenELEC, you can prevent to automount certen drives by using/changing udev.rules.d

see here: viewtopic.php?f=56&t=95252&p=665452&hil ... ec#p665452

depending to your used distro, you have to change the path, where udev.rules.d is located on yours
(maybe /lib/udev/rules.d/, to find a proper template and /etc/udev/rules.d/, where to put the rules to)

here the template of the rule, in case you dont have that template:

Code: Select all

# dont run in "installer" mode
IMPORT{cmdline}="installer"
ENV{installer}=="1", GOTO="exit"

# check for blockdevices, /dev/sd*, /dev/sr* and /dev/mmc*
SUBSYSTEM!="block", KERNEL!="sd*|sr*|mmc*", GOTO="exit"

# check for special partitions we dont want mount
IMPORT{builtin}="blkid"
ENV{ID_FS_LABEL}=="BOOT*|root*", GOTO="exit"

# /dev/sd* and /dev/mmc* ith partitions/disk and filesystems only and /dev/sr* disks only
KERNEL=="sd*|mmc*", ENV{DEVTYPE}=="partition|disk", ENV{ID_FS_USAGE}=="filesystem", GOTO="harddisk"
KERNEL=="sr*", ENV{DEVTYPE}=="disk", GOTO="optical"
GOTO="exit"

# mount or umount for hdds
LABEL="harddisk"
ACTION=="add", RUN+="/usr/bin/systemctl restart [email protected]/dev/%k.service"
ACTION=="remove", RUN+="/usr/bin/systemctl stop [email protected]/dev/%k.service"
GOTO="exit"

# mount or umount for opticals
LABEL="optical"
ACTION=="add|change", RUN+="/usr/bin/systemctl restart [email protected]/dev/%k.service"
GOTO="exit"

# Exit
LABEL="exit"
{ I only give negative feedback }
RPi Model B (rev1, 256MB) & B (rev2, 512MB) & B+, RPi2B (1GB), 64GB microSDXC1 class 10, HDMI 1920x1080, keyboard-mouse-combo (wireless), PiCamera, ethernet-cable, 5V/1.2A power supply, Wifi dongle (rt5370)

jyskim
Posts: 2
Joined: Sat Aug 29, 2015 5:56 pm

Re: how to disable kodi automount

Sun Aug 30, 2015 2:11 pm

Hi beta-tester, thanks for advice.
This morning i made a work-around fix by using udev rule to explicitly specify the mount point and gave up using fstab.
Now on the mount point I want (regardless how it's arranged), I could configure samba, transmission and webdav and use them stably.

openbelec
Posts: 2
Joined: Thu Feb 23, 2017 7:03 pm

Re: how to disable kodi automount

Thu Feb 23, 2017 7:05 pm

i made a work-around fix by using udev rule to explicitly specify the mount point
Hi jyskim, could you please share how you did it? I am looking for exactly that and it seems you found the answer. Thanks in advance!

openbelec
Posts: 2
Joined: Thu Feb 23, 2017 7:03 pm

Re: how to disable kodi automount

Thu Feb 23, 2017 10:25 pm

openbelec wrote:
i made a work-around fix by using udev rule to explicitly specify the mount point
Hi jyskim, could you please share how you did it? I am looking for exactly that and it seems you found the answer. Thanks in advance!
I actually spent some time trying to figure out how to do that and came to a solution. I posted it here:
http://openelec.tv/forum/65-storage/831 ... ame#168063

As you can see it is tailored to OpenELEC but it can apply to similar environments.

butchertkd
Posts: 2
Joined: Sun Oct 14, 2018 10:14 am

Re: how to disable kodi automount

Sun Oct 14, 2018 10:17 am

openbelec wrote:
openbelec wrote:
i made a work-around fix by using udev rule to explicitly specify the mount point
Hi jyskim, could you please share how you did it? I am looking for exactly that and it seems you found the answer. Thanks in advance!
I actually spent some time trying to figure out how to do that and came to a solution. I posted it here:
http://openelec.tv/forum/65-storage/831 ... ame#168063

As you can see it is tailored to OpenELEC but it can apply to similar environments.
The URL doesn't work anymore. Could please share it again? Does you solution still work on current OpenELEC/LibreELEC installations?

Thanks

beta-tester
Posts: 1221
Joined: Fri Jan 04, 2013 1:57 pm
Location: de_DE

Re: how to disable kodi automount

Mon Oct 15, 2018 12:59 pm

butchertkd wrote:
Sun Oct 14, 2018 10:17 am
openbelec wrote:
openbelec wrote:
Hi jyskim, could you please share how you did it? I am looking for exactly that and it seems you found the answer. Thanks in advance!
I actually spent some time trying to figure out how to do that and came to a solution. I posted it here:
http://openelec.tv/forum/65-storage/831 ... ame#168063

As you can see it is tailored to OpenELEC but it can apply to similar environments.
The URL doesn't work anymore. Could please share it again? Does you solution still work on current OpenELEC/LibreELEC installations?

Thanks
you know, that there is a search functionlity in the OpenELEC forum...
but here you have: https://forum.openelec.tv/showthread.php?tid=83111
{ I only give negative feedback }
RPi Model B (rev1, 256MB) & B (rev2, 512MB) & B+, RPi2B (1GB), 64GB microSDXC1 class 10, HDMI 1920x1080, keyboard-mouse-combo (wireless), PiCamera, ethernet-cable, 5V/1.2A power supply, Wifi dongle (rt5370)

butchertkd
Posts: 2
Joined: Sun Oct 14, 2018 10:14 am

Re: how to disable kodi automount

Mon Oct 15, 2018 5:57 pm

beta-tester wrote:
Mon Oct 15, 2018 12:59 pm
butchertkd wrote:
Sun Oct 14, 2018 10:17 am
openbelec wrote:

I actually spent some time trying to figure out how to do that and came to a solution. I posted it here:
http://openelec.tv/forum/65-storage/831 ... ame#168063

As you can see it is tailored to OpenELEC but it can apply to similar environments.
The URL doesn't work anymore. Could please share it again? Does you solution still work on current OpenELEC/LibreELEC installations?

Thanks
you know, that there is a search functionlity in the OpenELEC forum...
but here you have: https://forum.openelec.tv/showthread.php?tid=83111
I am sorry I thought that post wasn't available anymore. Thank you anyway.

Return to “Troubleshooting”