[mythtv-users] storage drives unmountion

Stephen Worthington stephen_agent at jsw.gen.nz
Fri Jul 17 12:28:12 UTC 2020


On Fri, 17 Jul 2020 06:54:37 -0400, you wrote:

>Last summer, when OTA recordings declined, I used Kodi more frequently. I
>replaced every component suspecting a hardware failure. After some serious
>head knocking I figured my drives were becoming corrupt due to some
>imported recordings from my daughter's failing windows laptop. Things
>settled down and a new season of OTA recordings proved my theory, I
>thought. This summer, as kodi usage increased I would see crawling messages
>indicating that a drive had been successfully unmounted. I guess I was
>wrong, so I bought an Android TV box for Kodi, suspecting tha Kodi didn't
>play nice with Mythtv.
>Now I see Chewit's post, from this:
>https://forum.kodi.tv/showthread.php?tid=297545 article and I'm wondering
>if my drives were corrupted last year because Kodi unmounted them during
>recordings, because they had "labels" storage1,2, or 3. Has anyone else had
>problems using kodi and Mythtv on the same box with labeled recordings
>storage space?  TIA  Daryl
>
>last year Ubuntu 18.04 and myth 0.29, this year Ubuntu 20.04 and myth 31,
>same labeling system throughout.

Whenever you have a partition that is not unmounted before the drive
is shut down (eg power failure, the system crashed, the USB cable got
pulled out), you always want to run a full fsck on it before using it
again.  If you have not been doing that, you could have corrupt
partitions.  So you should do "fsck -C -f <partition>" on all your
suspect partitions.  If you get any errors that need fixing, fix them
and then run fsck -C -f again and keep doing it until it runs and says
there are no errors.  If you fail to do this and leave the filesystem
on a partition in a corrupted state, and then write to that partition,
the corruption only gets worse until the partition becomes unusable.

If you are using labels on your partitions for mounting them, this is
no different these days than using UUIDs or directly specifying the
partition using /dev/sdXn.  A long time ago, there could be problems
with using labels with some filesystems, but those problems were
fixed.  Ubuntu 18.04 is well beyond the kernels where those fixes
happened.

The article you referred to is about LibreELEC, a specialised distro
for running Kodi.  The article looks as though it is about using UDEV
rules to do automounting of partitions, and is irrelevant for Ubuntu
unless you have added such UDEV rules yourself.  It could be relevant
to your Kodi boxes if they were running LibreELEC, but you said they
are Android.

Importing recordings from a failing laptop can not corrupt the system
the files are copied to.  The only effect the imported recordings can
have is that the files themselves may be corrupt and not play
properly.

Kodi when working with MythTV uses a plugin that allows it to be a
client of a MythTV server.  Kodi does not have any way of affecting
the recording files except by asking the MythTV server to do
something.  It does not have direct access to the recordings, but just
gets the data from a recording streamed to it by MythTV.  I can not
see any way that using Kodi could cause corrupt recordings.  There are
lots of MythTV users who use Kodi with no problems.

You need to tell us more about the crawling messages about unmounting.
Partitions should not be being unmounted unless you told the system to
do that.  Are those messages about network mounts, or actual
partitions?  I have never seen messages like that - are they being
displayed by Kodi?  What partitions do they refer to?  If they contain
recordings, and the unmounting is happening on the Ubuntu/MythTV box,
then you may get failed recordings due to not having a partition to
record to.  But unmounting could not happen with a recording in
progress as any open file on a mounted partition prevents unmounting
from being possible.  The system simply will not and can not unmount
any partition that is actually being used.

What is the basic problem you are getting?  Are you getting filesystem
corruption of your partitions (so that running fsck reports errors)?
Or are you getting corrupt recordings which do not play properly?

You should be able to see all labeled partitions here:

ls -al /dev/disk/by-label

Here is what I get on my MythTV box:

root at mypvr:~# ll /dev/disk/by-label/
total 0
drwxr-xr-x 2 root root 460 Jul 17 07:53  ./
drwxr-xr-x 8 root root 160 Jul 17 07:52  ../
lrwxrwxrwx 1 root root  10 Jul 17 07:52  rec1 -> ../../sdb3
lrwxrwxrwx 1 root root  10 Jul 17 07:52  rec1boot -> ../../sdb1
lrwxrwxrwx 1 root root  10 Jul 17 07:52  rec2 -> ../../sdd2
lrwxrwxrwx 1 root root  10 Jul 17 07:52  rec2boot -> ../../sdd1
lrwxrwxrwx 1 root root  10 Jul 17 07:52  rec3 -> ../../sda5
lrwxrwxrwx 1 root root  10 Jul 17 07:52  rec3boot1 -> ../../sda2
lrwxrwxrwx 1 root root  10 Jul 17 07:52  rec3boot2 -> ../../sda3
lrwxrwxrwx 1 root root  10 Jul 17 07:52  rec3boot3 -> ../../sda4
lrwxrwxrwx 1 root root  10 Jul 17 07:53  rec4 -> ../../sdp1
lrwxrwxrwx 1 root root  10 Jul 17 07:52  rec5 -> ../../sdc1
lrwxrwxrwx 1 root root  10 Jul 17 07:53  rec6 -> ../../sdo1
lrwxrwxrwx 1 root root  10 Jul 17 07:52  rec7 -> ../../sde1
lrwxrwxrwx 1 root root  15 Jul 17 07:52  ssd1 -> ../../nvme0n1p3
lrwxrwxrwx 1 root root  15 Jul 17 07:52  ssd2 -> ../../nvme0n1p4
lrwxrwxrwx 1 root root  11 Jul 17 07:52
'Ubuntu\x2018.04\x20LTS\x20amd64' -> ../../loop2
lrwxrwxrwx 1 root root  10 Jul 17 07:53  UUI -> ../../sdf1
lrwxrwxrwx 1 root root  10 Jul 17 07:53  vid1 -> ../../sdl2
lrwxrwxrwx 1 root root  10 Jul 17 07:53  vid1boot -> ../../sdl1
lrwxrwxrwx 1 root root  10 Jul 17 07:53  vid2 -> ../../sdm1
lrwxrwxrwx 1 root root  10 Jul 17 07:53  vid3 -> ../../sdn1
lrwxrwxrwx 1 root root  10 Jul 17 07:53  vid4 -> ../../sdk1

Here is the fstab entry for my rec1boot partition:

LABEL=rec1boot		/mnt/rec1boot	ext3
relatime,errors=remount-ro,nofail 0  2

(sorry, my email client wraps long lines)

So if I need to do fsck on my rec1boot drive, I would do this:

sudo su
umount /mnt/rec1boot
fsck -C -f /dev/disk/by-label/rec1boot
mount /mnt/rec1boot
exit


More information about the mythtv-users mailing list