Last night completed the second to the last step of my Mythbuntu adventure: Adding in the second hard drive.
Well, this would all be easier if I wasn’t trying to do it so low rent. Right now in the Myth box there is only 512MB of RAM and two 40GB Western Digital Hard drives. After everything is setup that only gives me about 65-ish GB for video recording. Not alot, but not great either–right around 40 hours of recording space.
So, I should get a larger hard drive…
Well, when I do, I’ll have to repeat this same process. Obviously, first one has to install the hardware and make sure that the BIOS can see it. If you don’t have this, you don’t have anything. Now to the Linux part:
- Partition – Setup the drive to hold data. The main drive is probably /dev/sda, making the OS install to be on /dev/sda1 and the swap partition to be on /dev/sda5 (at least on my box). The second hard drive will probably be /dev/sdb, and so a third physical hard disk will be /dev/sdc, and etc. I created one big partition on the new drive.
- sudo fdisk /dev/sdb
- n (new partition)
- p (primary partition)
- 1 (first primary partition)
- <enter> (default first cylinder)
- <enter> (default last cylinder)
- w (write the new partition table to disk)
- Format – Prepare the new partition for data. Nothing big here, but one small caveat. Since this is not a the boot drive, theres no need for reserve space. Usually a format reserves 5% space incase the drive fills up–this helps keep from crashing on full drives. I set the second drive to 1% reserve.
- sudo mkfs -t ext3 /dev/sdb1
- sudo tune2fs -m 1 /dev/sdb1
- Mounting – Add the new space to the filesystem. Linux sees everything like one big directory tree–there are no C: and D: drives. So, to mount this new drive I created a directory called /video on the root and some subdirectories called /video/livetv and /video/media. And while I was doing it, I made a backup spot for my Myth database. After the directories are made, I changed the file rights so they could be used by Myth.
- sudo mkdir /video
- sudo mkdir /video/livetv
- sudo mkdir /video/media
- sudo mkdir /var/dbbackup
- chmod a+wrx /video/livetv
- chmod a+wrx /video/media
- chmod a+wrx /var/dbbackup
- FSTAB – Edit the /etc/fstab so that the drive is mounted on bootup. I don’t know if you like Vi, but I hate it. So, I installed GEdit to make my life easier.
- sudo apt-get install gedit
- gksudo gedit /etc/fstab
- <add a line>/dev/sdb1 /video/media ext3 defaults 0 0
- Save and Reboot (or sudo mount -a)
- Test – Make sure that the new drive is seen (sudo mount -l)
- MythTV Storage Groups. I wanted to help utilize my space as well as possible. Inside the MythTV Backend Setup, I set:
- LiveTV to /video/livetv/
- Default to /video/media/
- DBBackup to /var/dbbackup/
My theory is that the Live TV buffering will all happen on the drive with the least amount of space, as well as the dbbackups. And (hopefully) all of the actual recordings will go to the second hard drive. We’ll see how it works out.
It has been running Live TV on The Weather Channel for the last sixteen hours and the capture files are all going to the right spot. One problem is that my demo subscription to Schedules Direct has ran out–I’ll have to pay the twenty dollars before I can go on to the last step–changing channels on the cable box.
Bryan said he doesn’t remember if he ever got this working a few years ago. It is probably easier to do, now, with the new releases. After I accomplish this last step, I will post a quick recap and include some other extremely cool stuff I found that works with MythTV. Until then.
See you, Space Cowboy.