Digital Media Photography Blogs > Photography

Extending MythTV recording space with LVM


I dearly love my MythTV system. I travel a lot, and it enables me to take TV with me to 35,000 feet. What I love best is that it's growing with me. I recently added an Air2PC HD5000 card, so I now have a three-tuner box. (I hope to write an article on the new tuner in the near future.)

The biggest drawback is one of my own making, which is that my my Myth system only holds about 20 hours of high definition programming. Fortunately, I had used the logical volume manager to create the place where all recordings are stored. I finally had time to install the disk today, so I should find it much less frustrating in the future.

I dearly love my MythTV system. I travel a lot, and it enables me to take TV with me to 35,000 feet. What I love best is that it's growing with me. I recently added an Air2PC HD5000 card, so I now have a three-tuner box. (I hope to write an article on that in the near future.)

One of the few frustrations I have (and it is entirely my own fault) is that I skimped on the disk when I built the system last year. I started with a 120 GB disk, of which I reserved 100 GB for video recording. It's more than my TiVo has, but my TiVo only requires 2 GB/hour. HD recordings can range from 5 GB-8 GB per hour; I find 7 GB/hour to be a good rule of thumb. That makes my Myth system a 14-hour device.

Fortunately (and I think this was even planned), I made /video, the directory where all recordings are stored, a logical volume in Linux so that I could drop additional disks on to it. I'd always intended to get around to expanding it, and today, I finally sat down to do it.

As the day dawned, I had my 100 GB video partition full nearly to the brim. Well, it had 30 GB free, but when you know that there's an 11 GB episode of Saturday Night Live coming up, along with perhaps other things, it doesn't look like much:

myth ~ # df -kh
Filesystem            Size  Used Avail Use% Mounted on
/dev/sda2             9.9G  4.7G  4.7G  51% /
udev                  503M  172K  503M   1% /dev
none                  503M     0  503M   0% /dev/shm
/dev/VolGroup00/LogVol00
                      101G   71G   31G  70% /video

For a while now, I've had a Samsung SpinPoint 250 GB SATA-2 disk sitting on the table. Although it's not the biggest drive on the market, it is one of the quietest. I installed the drive, cursing the state of HTPC cases a year ago. My SilverStone LC03 has only two 3.5" drive bays, and one of them is too close to the CPU heat sink to use. I had to dig around for a 3.5" to 5" drive bay adapter, and figure out how to replace the beige face plate from the adapter with the nice black face plate from my case. Hardware installation: approximately 40 minutes, much of it spent yelling at tiny little screws that wouldn't do what I wanted. When I turned the computer back on, there was the new disk, which the system labeled sdb for me:

SCSI device sdb: 488397168 512-byte hdwr sectors (250059 MB)
SCSI device sdb: drive cache: write back
 sdb: unknown partition table
sd 1:0:0:0: Attached scsi disk sdb

The first task was to run fdisk and create a single partition spanning the entire disk (/dev/sdb1). Next, I added the partition (physical volume, in the LVM lingo) into the volume group. At that point, the volume group had grown dramatically in size, which I could see by running the volume scan tool. Time into software configuration: about 3 minutes.

myth ~ # pvcreate /dev/sdb1
  Physical volume "/dev/sdb1" successfully created
myth ~ # vgextend VolGroup00 /dev/sdb1
  Volume group "VolGroup00" successfully extended
myth ~ # pvscan
  PV /dev/sda5   VG VolGroup00   lvm2 [100.69 GB / 32.00 MB free]
  PV /dev/sdb1   VG VolGroup00   lvm2 [232.88 GB / 232.88 GB free]
  Total: 2 [333.56 GB] / in use: 2 [333.56 GB] / in no VG: 0 [0   ]

However, all that's happened so far is that the volume group underlying /video is now bigger. The file system still thinks its 100 GB. So, the next thing to do is to tell LVM that it's OK to make the logical volume bigger and grow into the new disk. Total time into configuration: about 3 minutes, twenty seconds.

myth ~ # lvextend -L+232G /dev/VolGroup00/LogVol00
  Extending logical volume LogVol00 to 332.66 GB
  Logical volume LogVol00 successfully resized

With a whole lot of new room, the existing file system can be extended across the physical disk boundary. Supposedly, ReiserFS file systems can be resized on-line, but I'm afraid of trying to resize a file system with active writes. I had waited to power down the system until there was no recording, so unmounting /video wasn't a big deal.

myth ~ # umount /video
myth ~ # resize_reiserfs /dev/VolGroup00/LogVol00
resize_reiserfs 3.6.19 (2003 www.namesys.com)
 
ReiserFS report:
blocksize             4096
block count           87203840 (29007872)
free blocks           68820797 (10626605)
bitmap block count    2662 (886)
 
Syncing..done
 
resize_reiserfs: Resizing finished successfully.
 
myth ~ # mount /video

We're now almost at five minutes into the software configuration. Did it work?

myth ~ # df -kh
Filesystem            Size  Used Avail Use% Mounted on
/dev/sda2             9.9G  4.7G  4.7G  51% /
udev                  503M  172K  503M   1% /dev
none                  503M     0  503M   0% /dev/shm
/dev/VolGroup00/LogVol00
                      333G   71G  263G  22% /video

I guess it's time to get to work filling up all that free space!

Categories





AddThis Social Bookmark Button
Comments (10)
Read More Entries by Matthew Gast.

10 Comments

Driser said:

Fantastic website... Good resources for learning, easy to follow... Keep up the good work!!! Make your opinion about my resources :)

Bell said:

Very creative... May be you make new design for my sites?

Erin said:

Where did you find this guestbook by the way??? I'd like to have one like this on one of my sites!!!

Stowers said:


Nikki said:

I will recomend this site... Excelent work!!! May I use your palette at my site?

Andrew said:


Great summary, thank you! I was looking to do the exact same thing -- I rapidy filled up a 160GB drive, and dropped in a 500GB drive for some more elbow room. The instructions worked great. One tidbit, I needed to cross-reference with

http://www.linuxhomenetworking.com/wiki/index.php/Quick_HOWTO_:_Ch27_:_Expanding_Disk_Capacity

as I was using an ext3 filesystem. The resizing commands are slightly different.

oregon scientific colour weather st

liv linderland http://tonuzaka.ittaranto.info liv linderland tonuzaka.ittaranto.info liv linderland sexi

MHM said:

It might be benefical to stick to JFS partitions as they handle larger files better compared to ReiserFS

Leave a comment


Recommended for You

Topics of Interest

Archives


 
 


Or, visit our complete archive.