Storage Group Setup (Newbie Question)

For discussion of topics specific to MythTV on linux
Post Reply
two.dogs
Newcomer
Posts: 4
Joined: Fri Apr 27, 2018 3:09 am
United States of America

Storage Group Setup (Newbie Question)

Post by two.dogs »

I'm abandoning Windows MCE and going to Lubuntu/Kodi/MythTV and almost have things working. I can watch TV but not record and playback shows. Pretty sure I haven't set up the storage group correctly and I haven't been able to absorb the complicated (to me) instructions.

I have a solid state drive for the Lubuntu/Kodi/MythTV and a standard 1TB drive that I want to hold all TV recordings. The idea is to prevent doing a lot of read/write to the SSD. I don't think I need or want to do anything else like movies, coverart, or any of the other things I see when I search about this topic. I'm trying to develop a to-do list to solve my problem but its probably off by a mile.

format the 1TB drive to ext4
create a file structure in the 1TB drive that looks like what?
Create a mount point for MythTV on the SSD but exactly how and where? (/var/lib/mythtv?)
Set permissions how?

John
Last edited by two.dogs on Fri Apr 27, 2018 6:16 pm, edited 1 time in total.
User avatar
bill6502
Developer
Posts: 2323
Joined: Fri Feb 07, 2014 5:28 pm
United States of America

Re: Storage Group Setup (Newbie Question)

Post by bill6502 »

/var/lib/mythtv/ is a good choice. Then when the 1TB drive is mounted, create a
recordings directory under it. That way, if the 1TB drive fails to mount, recordings won't
be written to the SSD (and likely fill it up.) You should create a directory for
db_backups at a minimum and that most likely would be on another drive or even
system, read NAS. [Note that /var/lib/mythtv should be owned by root:root.]

The Default Storage Group could then contain the single /var/lib/mythtv/recodings
Storage Directory. I assume you're reading the Wiki page for Storage Directories.
https://www.mythtv.org/wiki/Setup_Storage_Directories

The recommended way to run the backend is as user mythtv (that user is in group mythtv
too.) Then all directories/files from /var/lib/mythtv/recordings and below should belong
to mythtv:mythtv. Use chmod u=rwx,go=rx /var/lib/mythtv/recodings etc. See man chmod
for more detail.
MikeB2013
Senior
Posts: 519
Joined: Mon Jul 25, 2016 4:16 pm
Great Britain

Re: Storage Group Setup (Newbie Question)

Post by MikeB2013 »

Assuming a mythtv install from a package such as ppa:mythbuntu/0.29 on Ubuntu (or variant Xubuntu etc) mythtv directories will already have been created under /var/lib/mythtv/

Code: Select all

mike@mike-AB350-Gaming-3:/var/lib/mythtv$ ls -lha
total 60K
drwxr-xr-x 12 root   root   4.0K Apr  2 14:18 .
drwxr-xr-x 78 root   root   4.0K Apr 18 18:57 ..
drwxrwsr-x  2 mythtv mythtv 4.0K Mar 27 05:06 banners
drwxrwsr-x  2 mythtv mythtv 4.0K Mar 27 05:06 coverart
drwxrwsr-x  2 mythtv mythtv 4.0K Mar 27 05:06 db_backups
drwxrwsr-x  2 mythtv mythtv 4.0K Mar 27 05:06 fanart
drwxrwsr-x  2 mythtv mythtv 4.0K Mar 27 05:06 livetv
drwxrwsr-x  2 mythtv mythtv  16K Apr 10 17:54 recordings
drwxrwsr-x  2 mythtv mythtv 4.0K Mar 27 05:06 screenshots
drwxrwsr-x  2 mythtv mythtv 4.0K Mar 27 05:06 streaming
drwxrwsr-x  2 mythtv mythtv 4.0K Mar 27 05:06 trailers
drwxrwsr-x  2 mythtv mythtv 4.0K Mar 27 05:06 videos
Given that these are on the SSD, I suggest they are not used.

As with linux there are many different ways of doing things, I prefer to use /srv/.... as described in Example 1 from https://www.mythtv.org/wiki/Setup_Storage_Directories

So in this case I would use a mount point of /srv/mythtv/tv/a/ for the 1 TB drive with two directories recordings and db_backups. Note that these have to be setup using mythtv-setup>Storage Groups. The recordings directory full path /srv/mythtv/tv/a/recordings being Default Storage Group with db_backups full path /srv/mythtv/tv/a/db_backups

Also an entry in /etc/fstab (make a copy just in case before editing) will be required, something like

Code: Select all

# storage for mythtv 1TB drive 
UUID="f733220d-f771-4023-a7ae-fec680eca2ea" /srv/mythtv/tv/a/ ext4 defaults,noatime 0 2
The UUID will be different (run blkid in a terminal to get the correct UUID after formatting the 1 TB drive to ext4)

Then create the directories
sudo mkdir /srv/mythtv/tv/a/recordings /srv/mythtv/tv/a/db_backups

Use sudo chown -R mythtv:mythtv <directory> to set ownership and
sudo chmod -R u=rwx,g=rwxs,o=rx <directory> to set permissions for both recordings and db_backups

If all goes well you should see

Code: Select all

mike@mike-AB350-Gaming-3:~$ ls -lha /srv/mythtv/tv/a/
total 64K
drwxr-xr-x 5 root   root   4.0K Apr 27 18:05 .
drwxr-xr-x 3 root   root   4.0K Apr 27 16:37 ..
drwxrwsr-x 2 mythtv mythtv 4.0K Apr 27 18:05 db_backups
drwx------ 2 root   root    16K Mar  3 08:51 lost+found
drwxrwsr-x 2 mythtv mythtv  36K Apr 27 17:52 recordings
edit:
now use mythtv-setup to set the Storage Groups

Mike
User avatar
bill6502
Developer
Posts: 2323
Joined: Fri Feb 07, 2014 5:28 pm
United States of America

Re: Storage Group Setup (Newbie Question)

Post by bill6502 »

I agree with Mike re: /srv, that's where I have mine on my production box. But if
/var/lib/mythtv is there, I'd save the trouble and just use it. You can read:
http://refspecs.linuxfoundation.org/FHS ... 03s17.html
if you like and could decide that /var/lib is the proper place (depends on how
you define consumer.)

Just be sure that the recordings directory is on the mounted device as mentioned
above!
two.dogs
Newcomer
Posts: 4
Joined: Fri Apr 27, 2018 3:09 am
United States of America

Re: Storage Group Setup (Newbie Question)

Post by two.dogs »

Thanks for the helpful replies. I had some hardware problems and switched to a newer computer. Now I'm working at getting my Hauppauge WinTV-HVR-1800 working and re-installing Kodi and MythTV. Then I can try the storage group suggestions.
two.dogs
Newcomer
Posts: 4
Joined: Fri Apr 27, 2018 3:09 am
United States of America

Re: Storage Group Setup (Newbie Question)

Post by two.dogs »

I seem to be making negative progress. Perhaps I'm not going about it the right way. I'd like to get the Kodi/MythTV set working good in my new computer before decommissioning the Windows MC. I only have one HD Homerun Prime and I assumed that I couldn't experiment with it on the Kodi/Myth box or it would mess up my WMC installation. That's why I got the Hauppauge card. But now that this card is proving a pain to set up, I'm wondering if it's possible for both of these computers to share the HD Homerun?
User avatar
bill6502
Developer
Posts: 2323
Joined: Fri Feb 07, 2014 5:28 pm
United States of America

Re: Storage Group Setup (Newbie Question)

Post by bill6502 »

MythTV can have just one of the three tuners defined. I don't speak
WMC, but if you can remove the tuner that MythTV uses, then they
should be able to co-exist. Or, in MythTV, you can set the LiveTV and
Scheduled Orders. Typically, they'd be 1,2,3 for the Scheduled Order
and 3,2,1 for LiveTV. But if you set any of them to 0, the tuner won't
be selected.
two.dogs
Newcomer
Posts: 4
Joined: Fri Apr 27, 2018 3:09 am
United States of America

Re: Storage Group Setup (Newbie Question)

Post by two.dogs »

Progress! I stole the HDHomerun Prime tuner-0 from Windows Media Center (requiring me to completely redo the WMC TV setup and reimport the guide to keep things running while I experiment). I followed the instrutions above from MikeB2013 and did the setups for mythtv and Kodi. It looks like live and recorded tv is now stored on the 1TB drive. So it looks like my original issue is solved.

Is there a trick to watching HBO or is that an unsolvable encryption issue? I hear that some channels will work on Windows Media Center, but not MythTV
Post Reply