[mythtv-users] usb mount

James Linder jam at tigger.ws
Mon Jan 1 12:25:59 UTC 2024



> On Jan 1, 2024, at 19:06, Stephen Worthington <stephen_agent at jsw.gen.nz> wrote:
> 
> On Mon, 1 Jan 2024 17:27:17 +0800, you wrote:
> 
>> My main mythtv drive is a usb drive.
>> 
>> If I put, in fstab
>> 
>> UUID=6a67da23-0789-42a7-bb24-ab7a1f21008c  /store     ext4 defaults      
>> 1  2
> 
> I would change the second to last field from 1 to 0 and see if that
> helps.  It is used to tell if dump should be run on the drive to do a
> backup, but no-one uses it much any more (and dump may not even be
> installed).  So if you are not deliberately using dump, you should
> have it set to 0.
> 
>> boot fails with a 'Enter Root Password ..." message about bad disk.
>> 
>> if I put
>> 
>> UUID=6a67da23-0789-42a7-bb24-ab7a1f21008c  /store     ext4 
>> defaults,nofail      1  2
>> 
>> Boot is normal, but the disk is not mounted
> 
> For many years, I ran my MythTV box with an external drive on a USB
> mount, and I never had any problems with mounting it automatically
> from fstab.  So I think you must have something misconfigured
> somewhere.

Steven an ongoing set of minor oops have had me go round in circles. I’ve semi settled on openSuSE Leap 15.5.
This is the first time automatic mount has not worked. I’m *certain* configuration and UUID are correct.

If I comment out the fstab entries, boot then comment them back then all works correctly by CLI.
ie
# mount /store

does mount.
The disk label is MYTHTV. Indeed /dev/disk/by-label/MYTHTV exists.

[snip]

> Yes, using a time delay to get around a race condition is not a good
> idea.  You always want to wait for the actual event, rather than just
> delay and hope the event will happen before your selected timeout.  So
> in this case, you want to be waiting for the partition to be available
> to mount, so you want to be waiting for /dev/disk/by-label/MYTHTV to
> exist.
> 
> You seem to have the label MYTHTV on the partition you are mounting on
> that drive, so I would suggest using LABEL=MYTHTV on your fstab line
> instead of UUID=6a67da23-0789-42a7-bb24-ab7a1f21008c.  But that will
> not be the cause of your problem, unless the UUID value is wrong.
> 
> With your current setup, if you disable the mountStore.service and
> boot, then run:
> 
> mount /store

Yup

[snip]

> Check the ownership and permissions.  I normally set mountpoints to
> chmod a-rwx so that if they are not mounted, then there is no access
> to the directory they mount on and any commands using that mountpoint
> will fail, rather than writing to the directory or below it.  And I
> make mountpoint directories chown root:root if they are to be mounted
> from fstab.

Thats a good idea. Are the final permissions set by fstab?

> When a USB drive is plugged in, there is a UDEV event that can be
> matched against and used to mount the drive in the correct place.  I
> run a nice script I found on the net called media-automount.  This
> allows me to configure what happens when any USB device is plugged in
> or unplugged.  I think this is it:
> 
> https://github.com/Ferk/udev-media-automount

Hika made suggestions which I’m gonna try. The bit that troubles me is the usb drive is *never* plugged in or out. Will SuSE’s fiddling mess with udev events.
Trouble is as a linuxgreybeard there are a number of things about ubuntu that I dont like (snap, root, pico come to mind) but it *does* work. (including auto mounting)

James



More information about the mythtv-users mailing list