[mythtv-users] usb mount

James Linder jam at tigger.ws
Mon Jan 1 21:39:55 UTC 2024

> On Jan 1, 2024, at 23:52, Stephen Worthington <stephen_agent at jsw.gen.nz> wrote:
>> Boot with USB plugged in does not generate a udev event (which might be the original problem !
> Ouch! That is a nasty bug.  It would certainly explain the USB drive
> not mounting from fstab.
>> This works
>> [Unit]
>> Description=Mount /Store
>> After=online.target
>> Wants=apache2.service
>> Wants=network-online.target
>> [Service]
>> Type=simple
>> ExecStartPre=bash -c "while [ ! -b /dev/disk/by-label/MYTHTV ]; do sleep 1; done"
>> ExecStart=mount /dev/disk/by-label/MYTHTV /store
>> [Install]
>> WantedBy=multi-user.target
> That looks like a decent workaround.  I think I would also add an
> overall timeout, so it does not keep on going forever if the USB drive
> is not powered on at boot time.  So maybe add a counter and exit the
> loop when it hits 60 seconds?
> It would also likely be a good idea for mythbackend to wait for /store
> to be mounted before it tries to start - if there is a recording
> scheduled for around the time the PC boots, mythbackend can start
> recording directly after it is started, which will not work very well
> if there is nowhere for it to write recording files.  So add:
> [Unit]
> Wants=store.mount
> After=store.mount
> to the mythbackend service.

Why would this not work? I’m displaying my ignorance, so the question is real.



More information about the mythtv-users mailing list