[mythtv-users] Moving recordings to a different physical drive

Stephen Worthington stephen_agent at jsw.gen.nz
Thu May 19 04:14:11 UTC 2022


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.


More information about the mythtv-users mailing list