Adding a Second Hard Drive to Knoppmyth

mythtvI switched back to Knoppmyth a couple months ago for my MythTV fix and I’m pretty happy with it except for a few minor glitches I’m still trying to work out. One of those glitches is that sometimes when the backend gets busy the video can become choppy and sometimes even effect the video as it’s written to the disk. This page states that this is caused by I/O problems with the disk and suggests changing the /myth partition from ext3 to the XFS file system using the instructions on this page. Since I have been using the box for a while, it has a lot of recorded and other video on it and their instructions are for a fresh system . I am also nearly out of space on this system so i’m also adding a second hard drive which further complicates matters.

Since there are no instructions I’ve found for exactly what I’m trying to do, this is how I went about it. The basic Idea is that I’m going to format the new drive with xfs, backup the /myth partition to the new drive, format the old /myth partition to XFS, copy the backup back to the old drive, untar the backup onto the new drive, mount the new drive to /myth, move the /myth/video folder to the old drive, then mount the old partition to /myth/video. This way the old partition contains all my shared videos and the new drive contains the recorded video. This has the advantage of recordings going to a seperate spindle from the OS.

After installing the new drive, format it and mount it to a temp folder:

(this is all done as root)

mkfs.xfs -f /dev/hda1

mkdir /mnt/tmp

mount /dev/hda1 /mnt/tmp

Backup the /myth partition:

tar cvvpPf /mnt/tmp/myth.tar /myth

Format the old myth partition:

umount /myth

mkfs.xfs -f /dev/sda3

Edit fstab to change the mount points:

nano /etc/fstab

make the begining look like this:

/dev/sda1  /  ext3 defaults,errors=remount-ro  0  1
/dev/hda1  /myth  auto  defaults,auto  0  2
/dev/sda3  /myth/video  auto  defaults,auto  0  2

Temporarly mount the old partition:

mkdir /mnt/old

mount /dev/sda3 /mnt/old

Move the backup to the old drive:

mv /mnt/tmp/myth.tar /mnt/old

Untar the backup to the new drive:

cd /mnt/tmp

tar xvf /mnt/old/myth.tar

Move the contents of the /myth/video folder to the old partition:

rm /mnt/old/myth.tar

(the untar put everything in a folder called “myth” instead of the tmp folder, so at this point I had to move everything up a level)

mv /mnt/tmp/myth/* /mnt/tmp

mv /mnt/tmp/video/* /mnt/old

Then re-mount the partitions where they go:

umount /dev/hda1

umount /dev/sda3

mount /dev/sda3

mount /dev/hda1

At this point I could have restarted the services, but I thought it would be easier to just reboot and cross my fingers. everything restarted fine and it’s working as expected. I just finished it up this morning though, so I can’t tell if it has fixed the performance issues yet.

Leave a Reply

Your email address will not be published. Required fields are marked *