HDDs automounted erratically get trailing "_" (underscore) or not as /media/... path

Since latest update (or previous as I have fresh Vero V replacing older Vero4k), external HDD labelled xxx get mounted erratically as /media/xxx_ or /media/xxx.
I had adjusted all the links once, and then it goes back now again without “_” and vice-et-versa, between the plug/unplug events after I update HDD content.
This is makes my Vero unusable by other Kodi devices.
Any idea how to fix this, preferrably without trailing underscore?

The drives get disconnected or the system crashes and the mount point gets stuck as a folder. When the drives go to mount again that folder prevents the drive from using that mount point name. One option is to safely remove (unmount) the connected drives, manually delete the folders in /media and then plug the drives back in. Optionally, and probably better for the long haul, would be to switch from the automounter to manually configuring the mount to /mnt using autofs which is much more graceful with mounts…

To fix the mount point change without much fuss you can use path substitution…

Stabilize your system, the harddrive should not connect/disconnect without a reason

my system is OSMC, so yes I’d like to stabilize OSMC system.
Thanks for the links but the issue is NOT samba, but osmc core automount naming mechanism itself.

I will rephrase: I need to unplug my hdd occasionnally to add/remove files via another computer (it is way faster and easier).
I never got this issue in 4 years until recently, that the automount add link in /media/ path, either with a trailing _ either without it. Regardless if I don’t change anything on the hdd nor plug it to another computer (ex: by simply switch on/off plug on the official usb hub).
Very strange.

How is your hard drive powered?
Which file system are you using?
Are you experiencing any system crash before the _ issue happens?

Are you ejecting it via the respective menu point before unplugging?

You say you didn’t have this problem, for a long time. Then I got to ask did you have a fstab-mount using label/UUID/PartiotionUID. Anything that made fstab take care of that specific drive, instead of automount.

Becuase as long as I’ve used OSMC, if i have an automounted drive and power cycles for the drive or usb gets interupted temporartly. Any kind of mishap that make the OS loses connection to the drive,if you hadn’t “dismounted”/“ejected” it via software, as soon as the drive got power again, you would have a new automountpoint /media/[label]- How ever if you did a restart of your OSMC device, or even just udisk-glue service. There would be a cleansing of “folders” in /media. and no "-"folder would be created.

The links didn’t have anything to do with samba. There is a mechanism in place whereas a drive that is plugged in and not manually mounted gets automatically mounted to /media and the mount point is preferentially titled the same as the drive label. If something happens and a mount point or folder exists in /media using that name then the mount point will get a different path. What I was suggesting was to manually setup an autofs mount point for your drive to /mnt. In this way the mount point will never move and additionally it does a better job of mounting and unmounting drives. The second link was a quick and easy way of telling Kodi to look in a different file path so you can make a change such as this without needing to rebuild your library.

But speaking of samba if your sharing your media to other devices using SMB and you switched to a manual mount point them you would also need to manually configure a share for this new mount point. The automation script that adds samba shares to auto-mounted drives doesn’t touch manual mounts. If your sharing your media via UPnP then it should be a non-issue.

are you using docker by any chance?

Hi All,
Thanks for all the valuable input… I think I figured out what is happening.
Likely linked to disk label similar to any of the directories… I’ll test something and come back to you. Seems I’ve been really unlucky with a code change (??)

Nothing has changed with how we mount disks for years…

1 Like