LinuxMCE Forums

General => Users => Topic started by: purps on April 23, 2009, 08:10:34 PM

Title: Changing the directory for MythTV recordings
Post by: purps on April 23, 2009, 08:10:34 PM
Hello all. I am in a spot of bother and was hoping somebody could help me out please.

I have two hard disks in my core; an 80GB and a 1TB disk. By default, MythTV stores the recordings on the 80GB, and I would like them to be stored on the large disk.

I have tried changing the recording directory in the MythTV backend setup, but it reverts back to the default path upon the core being reset.  I have then tried creating a symbolic link to my preferred recording location (as suggested by jeangot in the threads http://forum.linuxmce.org/index.php?topic=5626.0 and http://forum.linuxmce.org/index.php?topic=5412.0).

Unfortunately, whilst it all seems to work at first, the symbolic link deletes itself when I reset the core (and is replaced by the "normal" 'tv_shows_1' folder, along with 'tv_shows_31' and 'tv_shows_43' for some reason). I have tried checking the "follow symbolic links when deleting files" option in the MythTV backend setup as well, but it doesn't make any difference.

I created the symbolic link by navigating in the terminal to the default recording location (having already deleted 'tv_shows_1') and doing...

ln -s /mnt/device/28/public/data/videos/tv_shows_1 tv_shows_1

Am I missing something? Any help would be very much appreciated.

Title: Re: Changing the directory for MythTV recordings
Post by: purps on April 23, 2009, 09:12:37 PM
I should also have mentioned that I tried that symlink command with "sudo", and also that I deleted the tv_shows_1 folder via the standard file browser (I tried to do it through Web Admin, but the folder did not delete).

Cheers.
Title: Re: Changing the directory for MythTV recordings
Post by: donpaul on April 23, 2009, 11:40:49 PM
Search the forums, you'll find a lot of discussion regarding the mythtv directories. You cannot change them.
Title: Re: Changing the directory for MythTV recordings
Post by: jeangot on April 24, 2009, 07:32:25 AM
Hi guys,
I'm pretty sure I had this working with symbolic links, as it was pointing to a network share which was terribly slow and HD became unwatchable. I then setup the exact same scenario as you are talking about, one small drive for linux, and a big one just for Myth recordings but it seems that I am using mount and munting the drive directly at the tv_shows1 directory.

My mount shows this:
/dev/sdb1 on /home/public/data/videos/tv_shows_1 type ext3 (rw,data=ordered)
And my fstab has this line in it:
/dev/sdb1 /home/public/data/videos/tv_shows_1   ext3

This is working perfectly for over 6 months and being used daily with mutiple concurrent recordings in HD.

Sorry I can't help more with the symlinks, but because I don't have it setup like that anymore, I can't compare what's different in what I was doing. I am not 100% sure if I tested the symlink solution accross reboot, since I only had that running for a few days, going to a network share, then I got the second drive and set it up by mounting it as explained above.

I hope this helps.

Jean

Title: Re: Changing the directory for MythTV recordings
Post by: tschak909 on April 24, 2009, 08:14:16 AM
I love it when people disregard huge warnings the _DEVELOPERS_ say when they mention to _NOT_ do hard mounts or symlinks, as the system tends to break....

...but...whatever, you obviously know better.

-Thom
Title: Re: Changing the directory for MythTV recordings
Post by: purps on April 24, 2009, 11:46:39 AM
Quote from: tschak909 on April 24, 2009, 08:14:16 AM
I love it when people disregard huge warnings the _DEVELOPERS_ say when they mention to _NOT_ do hard mounts or symlinks, as the system tends to break....

...but...whatever, you obviously know better.

-Thom
I knew about the hard mounts being a bad idea, but I wasn't aware that it was the same story for symlinks.

In that case, could you possibly suggest an alternative method for getting the MythTV recording directory onto a 2nd hard disk please? I am out of ideas.
Title: Re: Changing the directory for MythTV recordings
Post by: tschak909 on April 24, 2009, 01:26:17 PM
This issue has been completely solved under 0810. Jondecker just committed code that creates mythTV storage groups dynamically for each disk in the house.

-Thom
Title: Re: Changing the directory for MythTV recordings
Post by: purps on April 24, 2009, 06:45:11 PM
So in 810, would you just change the recording directory under MythTV backend setup, and it would stick? Or is there something else you have to do to keep the recording directory on a second hard disk?

Is there a quick fix for this issue in 710 at all? I would be interested to know why my symlinks keep disappearing. I know that you don't recommend this Thom, but it seems that jeangot has had some success in this area.
Title: Re: Changing the directory for MythTV recordings
Post by: Steve on April 24, 2009, 07:08:14 PM
Quote from: tschak909 on April 24, 2009, 01:26:17 PM
This issue has been completely solved under 0810. Jondecker just committed code that creates mythTV storage groups dynamically for each disk in the house.

-Thom

Does it give you the option to save them where you want them to be saved?
Title: Re: Changing the directory for MythTV recordings
Post by: tschak909 on April 24, 2009, 07:34:22 PM
No, we currently pick the disk with the most space.

-Thom
Title: Re: Changing the directory for MythTV recordings
Post by: purps on April 24, 2009, 09:11:15 PM
No fix for 710 then? May I ask why the option to change the recording directory in MythTV backend setup doesn't stick after a reboot?
Title: Re: Changing the directory for MythTV recordings
Post by: donpaul on April 24, 2009, 09:15:28 PM
Did you search the wiki? I put together a workaround for 7.10 that will allow you to put/move the recording anywhere. You should follow my wiki and put the in tv_shows_0 first. Then after the .id3 is created and DB updated, you can move the media from tv_shows_0 to anywhere you like.

http://wiki.linuxmce.org/index.php/MythTv:_Don%27t_scan_live_tv
Title: Re: Changing the directory for MythTV recordings
Post by: donpaul on April 24, 2009, 09:18:55 PM
Quote from: tschak909 on April 24, 2009, 08:14:16 AM
I love it when people disregard huge warnings the _DEVELOPERS_ say when they mention to _NOT_ do hard mounts or symlinks, as the system tends to break....

...but...whatever, you obviously know better.

-Thom

Hey, I am an IT consultant and have been working with developers of all flavors for longer than I like. And I have to say that developers tend to be wrong more than they are right ;-)

{{no offense, lol}}
Title: Re: Changing the directory for MythTV recordings
Post by: purps on April 24, 2009, 09:47:25 PM
Quote from: donpaul on April 24, 2009, 09:15:28 PM
Did you search the wiki? I put together a workaround for 7.10 that will allow you to put/move the recording anywhere. You should follow my wiki and put the in tv_shows_0 first. Then after the .id3 is created and DB updated, you can move the media from tv_shows_0 to anywhere you like.

http://wiki.linuxmce.org/index.php/MythTv:_Don%27t_scan_live_tv
Thanks for the reply. I did have a look on the wiki, but I didn't see this! I'll have a proper look over the weekend.

You said "You should follow my wiki and put the in tv_shows_0 first" - put the what in where?

Am I right in saying that instead of "mkdir /home/public/data/videos/tv_shows_0" (referring to the wiki), I just put the recording directory of my choice, and reflect this in SaveMythRecording.sh?
Title: Re: Changing the directory for MythTV recordings
Post by: donpaul on April 24, 2009, 09:52:52 PM
You should put shows in tv_shows_0. Then after the .id3 and DB are updated with the meta information, you can move the show and the .id3. I have tried using something other than tv_shows_0, but the .id3 is never created. But you can give it a try if you like, let me know how it goes.
Title: Re: Changing the directory for MythTV recordings
Post by: purps on April 24, 2009, 10:03:01 PM
Sorry, I haven't fully understood. All I care about is getting my MythTV recordings to go straight onto a secondary hard disk (and for this to remain the case after the core has been rebooted!) - regarding your wiki page, which step(s) do I need to modify/change to achieve this?

My apologies for not understanding; your help is appreciated though.
Title: Re: Changing the directory for MythTV recordings
Post by: jondecker76 on April 24, 2009, 11:09:15 PM
I'm about finished with implementing the new MythTV storage groups in for 0810. Here is a brief rundown of what it does:
-As usual, your public will have a videos/tv_shows_X directory
-Now, all users will also have a videos/tv_shows_X directory (so you can save to a private directory)
-Symbolic links are now created from all of the above listed directories to each of your other storage devices.
-A mythTV storage group is created for each of the above directories. This means that you will be able to record to any LMCE storage device, in either the public directory or a private user's directory.
-Each "moon" (myth front end) will only be able to record to its own tv_shows_<moon#> directories. This simplifies the complexity.. For example, in my install with 4 MD's and 1 extra storage device, and 7 users, over 90 storage groups are generated. However, from any front end, you only have storage group options for that front end. For example, from my core, I have available:
Default
LiveTV
/home/public/data/videos/tv_shows_1
user_1/public/data/videos/tv_shows_1
user_2/public/data/videos/tv_shows_1
user_3/public/data/videos/tv_shows_1
user_4/public/data/videos/tv_shows_1
user_5/public/data/videos/tv_shows_1
user_6/public/data/videos/tv_shows_1
user_7/public/data/videos/tv_shows_1
/home/public/data/videos/tv_shows_1/Software Raid 5 [153]
/user_1/public/data/videos/tv_shows_1/Software Raid 5 [153]
/user_2/public/data/videos/tv_shows_1/Software Raid 5 [153]
/user_3/public/data/videos/tv_shows_1/Software Raid 5 [153]
/user_4/public/data/videos/tv_shows_1/Software Raid 5 [153]
/user_5/public/data/videos/tv_shows_1/Software Raid 5 [153]
/user_6/public/data/videos/tv_shows_1/Software Raid 5 [153]
/user_7/public/data/videos/tv_shows_1/Software Raid 5 [153]


Now, on my next MD (device #41), its list of storage groups would be:
Default
LiveTV
/home/public/data/videos/tv_shows_41
user_1/public/data/videos/tv_shows_41
user_2/public/data/videos/tv_shows_41
user_3/public/data/videos/tv_shows_41
user_4/public/data/videos/tv_shows_41
user_5/public/data/videos/tv_shows_41
user_6/public/data/videos/tv_shows_41
user_7/public/data/videos/tv_shows_41
/home/public/data/videos/tv_shows_41/Software Raid 5 [153]
/user_1/public/data/videos/tv_shows_41/Software Raid 5 [153]
/user_2/public/data/videos/tv_shows_41/Software Raid 5 [153]
/user_3/public/data/videos/tv_shows_41/Software Raid 5 [153]
/user_4/public/data/videos/tv_shows_41/Software Raid 5 [153]
/user_5/public/data/videos/tv_shows_41/Software Raid 5 [153]
/user_6/public/data/videos/tv_shows_41/Software Raid 5 [153]
/user_7/public/data/videos/tv_shows_41/Software Raid 5 [153]

... and so on..


-Notice in the above list of Storage Groups, the special "Default" and "LiveTV" storage groups. Default will automatically be selected for new recordings, but you can change it to any other storage group. Also note that Default always points to the device with the most storage. The "LiveTV" storage group always points to the tv_shows_* dir on  your root drive, and is used just for your pvr pause/ff/rew etc. functionality


- One last new feature to 0810 is that recording will be saved with a meaningful filename instead of 3458_200904281700.mpg. The title and subtitle are instead used to make a filename like "Mythbusters - Alaska Myths.mpg", and the lmce database and myth database are sync'd to this so that videos are still available from mythweb, etc.


=========================================

Regarding 0710, if you really wanted to record to a different directory and do it the right way, you would have to compile your own MythTV Plugin. More specifically, modify MythTV_PlugIn::SetPaths() to set your preferred paths and database settings. Then just recompile a new MythTV_Plugin, put it on your core, and it would work fine.
Title: Re: Changing the directory for MythTV recordings
Post by: purps on April 25, 2009, 12:29:05 AM
Quote from: jondecker76 on April 24, 2009, 11:09:15 PM
Regarding 0710, if you really wanted to record to a different directory and do it the right way, you would have to compile your own MythTV Plugin. More specifically, modify MythTV_PlugIn::SetPaths() to set your preferred paths and database settings. Then just recompile a new MythTV_Plugin, put it on your core, and it would work fine.

I wouldn't have a clue where to start. Thanks anyway.
Title: Re: Changing the directory for MythTV recordings
Post by: tschak909 on April 25, 2009, 03:39:05 AM
Hate to tell you, donpaul,

I know this code a lot better than you.

Your work around is NOT a stable solution.

-Thom

<Moderated!>