Due to all the stuff we’re taping from TV using our MythTV setup (Gardener’s World, A New Year at Kew, Top Gear, The Apprentice, Baumeister Solness, Thomas Ostermeier-Inszenierungen auf 3sat und arte, …), the 280 GB are no longer enough. I bought a Seagate Barracuda 320 GB from LDLC which I installed tonight, just in time for The Apprentice.
Here’s the run through, note there’s no reboot or anything, after the hard drive was physically put in the box, everything was done while the machine was up and running, MythTV was running, and I was watching BBC2.
Have a look whether the drive was correctly recognized.
dmesg extract:
Probing IDE interface ide0...
hda: FUJITSU MPE3136AT, ATA DISK drive
hdb: Maxtor 6Y160P0, ATA DISK drive
ide0 at 0x1f0-0x1f7,0x3f6 on irq 14
Probing IDE interface ide1…
hdc: ST3320620A, ATA DISK drive
ide1 at 0×170-0×177,0×376 on irq 15
Partition the new hard drive, just one partition, type being Linux LVM (8E), not bootable:
mythtv@blancheneige:~$ sudo cfdisk /dev/hdc
Create the XFS file system on the partition:
mythtv@blancheneige:~$ sudo mkfs -t xfs /dev/hdc1
meta-data=/dev/hdc1 isize=256 agcount=16, agsize=4883885 blks
= sectsz=512 attr=0
data = bsize=4096 blocks=78142160, imaxpct=25
= sunit=0 swidth=0 blks, unwritten=1
naming =version 2 bsize=4096
log =internal log bsize=4096 blocks=32768, version=1
= sectsz=512 sunit=0 blks
realtime =none extsz=4096 blocks=0, rtextents=0
Initialize the physical volume by running pvcreate:
mythtv@blancheneige:~$ sudo pvcreate /dev/hdc1
Physical volume "/dev/hdc1" successfully created
Have a look at the fstab, and comment out the previous settings for hdc which was a CD-ROM drive.
mythtv@blancheneige:~$ cat /etc/fstab
# /etc/fstab: static file system information.
#
# <file system> <mount point> <type> <options> <dump> <pass>
proc /proc proc defaults 0 0
/dev/hda1 / ext3 defaults,errors=remount-ro 0 1
/dev/hda9 /home ext3 defaults 0 2
/dev/hda8 /tmp ext3 defaults 0 2
/dev/hda5 /usr ext3 defaults 0 2
/dev/hda6 /var ext3 defaults 0 2
/dev/hda7 none swap sw 0 0
#/dev/hdc /media/cdrom0 iso9660 ro,user,noauto 0 0
#/dev/hdd /media/cdrom1 iso9660 ro,user,noauto 0 0
/dev/fd0 /media/floppy0 auto rw,user,noauto 0 0
/dev/vol01/music /var/music xfs defaults 0 0
/dev/vol01/video /var/video xfs defaults 0 0
#10.0.1.5:/home/jakob /mnt/grumpy nfs soft,intr,rsize=8192,wsize=8192 0 0
Make the hard drive (or rather the physical volume) part of the volume group:
mythtv@blancheneige:~$ sudo vgextend vol01 /dev/hdc1
Volume group "vol01" successfully extended
Now extend the logical volume by 289 GB (that number has been found by trial and error, quite small actually compared to the 320 GB printed on the drive case …)
mythtv@blancheneige:~$ sudo lvextend -L+289G /dev/vol01/video
Extending logical volume video to 584.00 GB
Logical volume video successfully resized
Let’s have a look whether it’s been taken into account:
mythtv@blancheneige:~$ sudo lvdisplay /dev/vol01/video
--- Logical volume ---
LV Name /dev/vol01/video
VG Name vol01
LV UUID tNRSPj-wzQ1-rV3x-EVWE-gxTR-3pIY-MAYiRn
LV Write Access read/write
LV Status available
# open 1
LV Size 584.00 GB
Current LE 149504
Segments 5
Allocation inherit
Read ahead sectors 0
Block device 254:0
Yep, looks like it. But we need to grow the file system, otherwise we won’t profit of the new disk:
mythtv@blancheneige:~$ sudo xfs_growfs /var/video/
meta-data=/dev/vol01/video isize=256 agcount=45, agsize=1638400 blks
= sectsz=512 attr=0
data = bsize=4096 blocks=73400320, imaxpct=25
= sunit=0 swidth=0 blks, unwritten=1
naming =version 2 bsize=4096
log =internal bsize=4096 blocks=12800, version=1
= sectsz=512 sunit=0 blks
realtime =none extsz=65536 blocks=0, rtextents=0
data blocks changed from 73400320 to 153092096
Check:
mythtv@blancheneige:~$ df -h
Filesystem Size Used Avail Use% Mounted on
/dev/hda1 250M 112M 126M 48% /
tmpfs 442M 0 442M 0% /dev/shm
/dev/hda9 4.6G 3.1G 1.4G 70% /home
/dev/hda8 361M 8.1M 334M 3% /tmp
/dev/hda5 4.4G 2.4G 1.8G 57% /usr
/dev/hda6 2.3G 513M 1.7G 24% /var
/dev/mapper/vol01-music 20G 8.5G 12G 43% /var/music
/dev/mapper/vol01-video 584G 262G 323G 45% /var/video