Mon 7 Jun 2004
Well it was time to add some space to my Media Server. I started with one 80GB for the OS and Music. Then added a 200GB for MythTV, but using mpeg2 fills up the drive fast. I had the foresight to use LVM so I could add room when needed. I was always running at 90% so I went and bought a new 160GB. This is what I did to install it.
IDE id’s go like this in Linux
hda Primary Master
hdb Primary Slave
hdc Secondary Master
hdd Secondary Slave
I added the 160GB drive to the Secondary Master
I created the partition with fdisk and changed the id (type) to 8e(LVM).
pvcreate /dev/hdc
This gave me and error saying that there was partitions on the selected drive. I had to run the following 2 commands to fix this.
dd if=/dev/zero of=/dev/hdc bs=1k count=1
blockdev –rereadpt /dev/hdc
I then ran the extend command, you will need to unmount the LVM first
umount /dev/VGforMyth/video
vgextend VGforMyth /dev/hdc video2
but this resulted in an error. After googling around I found I had to use the full path and not the link
vgextend VGforMyth /dev/ide/host0/bus1/target0/lun0/disc video2
You can find the full paths to your drives by doing a
ls -la /dev /hd*
You should see something similar after using the pvdisplay command
pvdisplay /dev/hdc
--- Physical volume --- PV Name /dev/ide/host0/bus1/target0/lun0/disc VG Name VGforMyth PV Size 152.67 GB [320173056 secs] / NOT usable 64.19 MB [LVM: 137 KB] PV# 2 PV Status available Allocatable yes Cur LV 1 PE Size (KByte) 65536 Total PE 2441 Free PE 140 Allocated PE 2301 PV UUID UH7WvH-KmdN-wYv1-Rrgz-dDju-MmdW-DBkLwn
Now to extend the existing LVM partition to use the extra space. This command will extend the partition and also extend the file system, and do a disk check.
e2fsadm -L+150G /dev/VGforMyth/video
This will take a few minutes to complete.
You are now ready to remount your LVM and you should see the extra space.
mount /dev/VGforMyth/video
df
Filesystem 1K-blocks Used Available Use% Mounted on /dev/root 74897024 56218544 14873888 80% / none 257508 0 257508 0% /dev/shm /dev/VGforMyth/video 340600744 159349488 163949752 50% /mnt/store
Leave a Reply
You must be logged in to post a comment.
