Mailing List Archive

Moving recordings to a different physical drive
Hi,

I've been using a NAS-resident iSCSI LUN of 2 TB to store the majority
of my MythTV recordings. The NAS has two 4 TB drives in a RAID-1 array.
Now I'm thinking of converting the NAS from spinning to SSD drives but 4
TB SSD drives are very expensive (given the ongoing supply chain &
inflation woes, I doubt they'll get cheaper any time soon). This gave me
the idea of using two 1 TB SSD drives I have on hand as local storage on
my backend box. First, I'd move the recordings off the iSCSI LUN onto
the local SSDs. Then I could rebuild the NAS from scratch using a pair
of 2 TB SSD drives which are far more affordable than 4 TB drives.

So, to migrate from the NAS to the local SSDs, I think I'll do the
following:

1. Stop mythbackend.
2. Copy the recordings from the NAS to the SSDs.
3. Remove the recordings from the NAS.
4. Remove the iSCSI LUN's mount point from the MythTV storage groups.
5. Start mythbackend.

Will this cover everything? Will MythTV be able to find the recordings
OK as long as they are present under a directory in the right storage
group, or do I have to do anything with MythTV's MySQL database?

Thanks,
Dave
_______________________________________________
mythtv-users mailing list
mythtv-users@mythtv.org
http://lists.mythtv.org/mailman/listinfo/mythtv-users
http://wiki.mythtv.org/Mailing_List_etiquette
MythTV Forums: https://forum.mythtv.org
Re: Moving recordings to a different physical drive [ In reply to ]
On Wed, 18 May 2022 17:29:38 -0500, you wrote:

>Hi,
>
>I've been using a NAS-resident iSCSI LUN of 2 TB to store the majority
>of my MythTV recordings. The NAS has two 4 TB drives in a RAID-1 array.
>Now I'm thinking of converting the NAS from spinning to SSD drives but 4
>TB SSD drives are very expensive (given the ongoing supply chain &
>inflation woes, I doubt they'll get cheaper any time soon). This gave me
>the idea of using two 1 TB SSD drives I have on hand as local storage on
>my backend box. First, I'd move the recordings off the iSCSI LUN onto
>the local SSDs. Then I could rebuild the NAS from scratch using a pair
>of 2 TB SSD drives which are far more affordable than 4 TB drives.
>
>So, to migrate from the NAS to the local SSDs, I think I'll do the
>following:
>
>1. Stop mythbackend.
>2. Copy the recordings from the NAS to the SSDs.
>3. Remove the recordings from the NAS.
>4. Remove the iSCSI LUN's mount point from the MythTV storage groups.
>5. Start mythbackend.
>
>Will this cover everything? Will MythTV be able to find the recordings
>OK as long as they are present under a directory in the right storage
>group, or do I have to do anything with MythTV's MySQL database?
>
>Thanks,
>Dave

There is no definitive need to stop mythbackend while moving recording
files around. All you need to do is make sure that nothing is going
to be using a recording file when you move it. You may want to still
stop mythbackend to prevent it from trying to record to drives that
are too busy with their full bandwidth being used to move files.

The way to move recordings to a new location is to first create the
new location and add it to your storage groups. Do not add it to the
"Default" storage group, to prevent mythbackend from trying to record
to it yet. Just create a temporary storage group. Then just move the
recording files to the new locations. While a file is being moved,
its filename will be visible in both the new and old locations at the
same time. That will not cause any problems unless you try to use the
file, like playing it from a frontend. Once all the recordings have
been moved, remove the old locations from the storage groups and move
the new locations to the "Default" storage group.

If you want to do the moving while still running the system and making
recordings, I have a Python program (mythsgu) which can be used to do
this. It has to be set up so that it can see the current MythTV
status, and it will pause moving files whenever it sees any activity
(such as a recording or playback). I have been using it for years now
every time I upgrade one of my recording drives to a larger size one.
I add the new recording drive to the PC on a temporary mount and move
the old drive's storage group entry out of "Default" and add a storage
group entry for the new drive. Then I use mythsgu to copy all the
files from the old drive to the new one. Once done, I remove the old
drive and its storage group entry and move the new drive to where the
old one was.
_______________________________________________
mythtv-users mailing list
mythtv-users@mythtv.org
http://lists.mythtv.org/mailman/listinfo/mythtv-users
http://wiki.mythtv.org/Mailing_List_etiquette
MythTV Forums: https://forum.mythtv.org
Re: Moving recordings to a different physical drive [ In reply to ]
On 5/18/22 11:14 PM, Stephen Worthington wrote:
>
> There is no definitive need to stop mythbackend while moving recording
> files around. All you need to do is make sure that nothing is going
> to be using a recording file when you move it. You may want to still
> stop mythbackend to prevent it from trying to record to drives that
> are too busy with their full bandwidth being used to move files.
>
> The way to move recordings to a new location is to first create the
> new location and add it to your storage groups. Do not add it to the
> "Default" storage group, to prevent mythbackend from trying to record
> to it yet. Just create a temporary storage group. Then just move the
> recording files to the new locations. While a file is being moved,
> its filename will be visible in both the new and old locations at the
> same time. That will not cause any problems unless you try to use the
> file, like playing it from a frontend. Once all the recordings have
> been moved, remove the old locations from the storage groups and move
> the new locations to the "Default" storage group.
>
> If you want to do the moving while still running the system and making
> recordings, I have a Python program (mythsgu) which can be used to do
> this. It has to be set up so that it can see the current MythTV
> status, and it will pause moving files whenever it sees any activity
> (such as a recording or playback). I have been using it for years now
> every time I upgrade one of my recording drives to a larger size one.
> I add the new recording drive to the PC on a temporary mount and move
> the old drive's storage group entry out of "Default" and add a storage
> group entry for the new drive. Then I use mythsgu to copy all the
> files from the old drive to the new one. Once done, I remove the old
> drive and its storage group entry and move the new drive to where the
> old one was.
I've finished moving my recordings to the two new SSD drives. Your
temporary storage group suggestion worked out well. I moved all the
recordings while mythbackend was running. I didn't have any issues with
new recordings, I'd previously added one SSD drive which had priority
over the iSCSI LUN so no new recordings have been saved to the LUN in
over six months.

Although the iSCSI LUN worked without issue, I feel better about storing
the recordings right on the backend's own storage.

Thanks,
Dave
_______________________________________________
mythtv-users mailing list
mythtv-users@mythtv.org
http://lists.mythtv.org/mailman/listinfo/mythtv-users
http://wiki.mythtv.org/Mailing_List_etiquette
MythTV Forums: https://forum.mythtv.org
Re: Moving recordings to a different physical drive [ In reply to ]
On 5/19/22 6:31 PM, Dave Ulrick wrote:
> I've finished moving my recordings to the two new SSD drives. Your
> temporary storage group suggestion worked out well. I moved all the
> recordings while mythbackend was running. I didn't have any issues
> with new recordings, I'd previously added one SSD drive which had
> priority over the iSCSI LUN so no new recordings have been saved to
> the LUN in over six months.
>
> Although the iSCSI LUN worked without issue, I feel better about
> storing the recordings right on the backend's own storage.

Update:

I've discovered an "oops!" issue related to my moving the recordings
from a 2 TB iSCSI LUN to two 1 TB SSDs.

Back when I had all of my MythTV recordings on a disk that was shared
for other purposes, I set

Setup / Video / General / Auto-Expire / Extra Disk Space

to 200 GB and forgot about it. When I moved the recording files, I
filled the new SSDs so that < 200 GB was free. I think this is why some
older recordings seem to have gone away since I moved them.

I think the Extra Disk Space setting is per file system as opposed to
per storage group. So, after I finished moving the files, the backend
removed the oldest auto-expire recordings from each file system until
the free space reached or exceeded 200 GB. Thankfully, I didn't lose any
recordings that I really wanted to keep!

All of my new MythTV storage drives are dedicated for MythTV--no need to
keep space free for other uses--so just now I dialed this setting back
to 10 GB.

Summary: if you intend to set up new storage devices for MythTV, make
sure you revisit the Extra Disk Space setting, and as you copy files to
a new device make sure to leave the Extra Disk Space free.

Dave
_______________________________________________
mythtv-users mailing list
mythtv-users@mythtv.org
http://lists.mythtv.org/mailman/listinfo/mythtv-users
http://wiki.mythtv.org/Mailing_List_etiquette
MythTV Forums: https://forum.mythtv.org