NOTE! This site uses cookies and similar technologies.

If you not change browser settings, you agree to it.

I understand

Welcome, Guest
Username: Password: Remember me

TOPIC: USB auto mount process in openelec...

USB auto mount process in openelec... 2 years 1 month ago #1

  • allenm
  • allenm's Avatar
  • Offline
  • Fresh Boarder
  • Posts: 3
  • Karma: 0
Hi.. your help with the following is much appreciated...

I would like to understand how openelec auto mounts USB drives especially by the USB volume label. Openelec is awesome but I have moved to Debian jessie only because I'd like to run Plex Media Server on the same machine as Kodi. I am having problems configuring to auto mount a USB flash drive/stick. There are programs (autofs, usbmount, pmount) but when I SSH openelec there seems to be no use of such programs. I'd like to implement the same approach as openelec. It works and works well! I appreciate anyone's help.

Thank you so much,
Allen
The administrator has disabled public write access.

USB auto mount process in openelec... 1 year 9 months ago #2

  • jrochet
  • jrochet's Avatar
  • Offline
  • Fresh Boarder
  • Posts: 7
  • Karma: 0
I would really like to know this too. I am unable to use my USB Seagate Backup Plus as a destination for rtorrent and I believe it has to do with the fact that there are spaces in the mount folder name which is "Seagate Backup Plus" (/storage/media/Seagate Backup Plus/).

I want so badly to just have it mount into /storage/media/2TBUSBHDD/ instead, which I can do manually, but I will never get this on a clean boot until I can figure out how the automount is happening because no matter what, rebooting forces it to remount into the "Seagate Backup Plus" folder.
The administrator has disabled public write access.

USB auto mount process in openelec... 1 year 9 months ago #3

  • lrusak
  • lrusak's Avatar
We use the utility called udevil. We auto mount filesystems with udevil using udev rules. These rules are shown here,

github.com/OpenELEC/OpenELEC.tv/blob/master/packages/sysutils/udevil/udev.d/95-udevil-mount.rules

If you want to stop auto mounting a drive you will need to edit these rules. You can do this by copying them to the writeable udev rules locations
cp /usr/lib/udev/rules.d/95-udevil-mount.rules /storage/.config/udev.rules.d/

then edit the rules to either exit if a specific uuid or filesystem label is found
ENV{ID_FS_LABEL}=="Seagate Backup Plus", GOTO="exit"

Then reboot.

Otherwise the easiest thing to do would to just rename the volume label to something that you want ;)
The administrator has disabled public write access.

USB auto mount process in openelec... 1 year 9 months ago #4

  • jrochet
  • jrochet's Avatar
  • Offline
  • Fresh Boarder
  • Posts: 7
  • Karma: 0
lrusak wrote:
We use the utility called udevil. We auto mount filesystems with udevil using udev rules. These rules are shown here,

github.com/OpenELEC/OpenELEC.tv/blob/master/packages/sysutils/udevil/udev.d/95-udevil-mount.rules

If you want to stop auto mounting a drive you will need to edit these rules. You can do this by copying them to the writeable udev rules locations
cp /usr/lib/udev/rules.d/95-udevil-mount.rules /storage/.config/udev.rules.d/

then edit the rules to either exit if a specific uuid or filesystem label is found
ENV{ID_FS_LABEL}=="Seagate Backup Plus", GOTO="exit"

Then reboot.

Otherwise the easiest thing to do would to just rename the volume label to something that you want ;)

I'd be so happy to just rename the volume label, but doing that in OpenElec I have no idea how.
The administrator has disabled public write access.

USB auto mount process in openelec... 1 year 9 months ago #5

  • jrochet
  • jrochet's Avatar
  • Offline
  • Fresh Boarder
  • Posts: 7
  • Karma: 0
Specifically, when I try this is what happens:

OpenELEC:/var/media # e2label /dev/sdb1 2TBUSBHDD
e2label: Bad magic number in super-block while trying to open /dev/sdb1
Couldn't find valid filesystem superblock.
OpenELEC:/var/media #

So instead I've been working around it by creating autostart.sh and chmod 407 to that, then inside I have:

seep 2
udevil umount /dev/sdb1
mount.ntfs /dev/sdb1 /storage/media/2TBUSBHDD

This works 50% of the time because since the mounting at bootup is still happening with the original volume label, my library and SMB both hang onto that name and so I have to do systemctl restart smbd.service, and I just have to live with my video library not being able to forget about "Seagate_Backup_Plus".

If I could redo the volume label, then factory reset and have it start out from day 1 as a no-spaces name, I'd be super happy.
The administrator has disabled public write access.

USB auto mount process in openelec... 1 year 9 months ago #6

  • jrochet
  • jrochet's Avatar
  • Offline
  • Fresh Boarder
  • Posts: 7
  • Karma: 0
I ended up plugging the USB drive into my Windows 10 laptop and just renamed the drive in there. Then I killed my autostart.sh file, and rebooted OpenElec with the drive reattached - everything is good!

rtorrent is working after reboots 100% of the time that I've tested with reboots so I think I'm all set. Thanks for the help.
The administrator has disabled public write access.

USB auto mount process in openelec... 1 year 9 months ago #7

  • lrusak
  • lrusak's Avatar
Just an FYI e2label is only good for ext[2,3,4] filesystems.
The administrator has disabled public write access.

USB auto mount process in openelec... 3 months 1 week ago #8

  • eungenue
  • eungenue's Avatar
  • Offline
  • Fresh Boarder
  • Posts: 1
  • Karma: 0
Hi,

I moved to Openelec 7.0.1 from 8.0.4 because the slideshows are dead slow on 8.0.3 and 8.0.4, but unfortunately, it seems that 7.0.1 can't automount usb disks/flash drives. The /dev/sda (or the like) device is there, but nothing in /media. Manual mounting works, but I'd like it to do this automatically. Did anyone face this problem?
The administrator has disabled public write access.