Extend Your MythDora Video Partition using LVM

One nice feature in MythDora is that it places the partition that stores video on a LVM volume.

LVM permits a single disk partition to "span" across more than one physical disk. When adding additional disks to grow your media library, you can expand your existing media partition right onto and across the new drives instead of having to figure out how to split things up.

If you know your way around things, the Quick Summary may be all you need. If you want to see everything I went through to add a disk to my volume, the Detailed Steps shows every screen, prompt, and all user input.

Quick Summary:

  1. fdisk /dev/hdb - Create a new partition of type "8e" to expand into. In this example "/dev/hdb1".
  2. pvcreate /dev/hdb1 - Create the new physical volume on the new partition.
  3. vgscan - Scan the volume groups.
  4. vgdisplay videovg - Display current volume group information. Note "Cur PV" value.
  5. vgextend videovg /dev/hdb1 - Add the new physical volume to the "videovg" volume group.
  6. vgdisplay videovg - Confirm "Cur PV" count has increased by 1. Note the "VG Size" to use for lvextend later.
  7. lvscan - Scan the logical volumes. Make note of the path of the videovg path for use in lvextend.
  8. lvextend -L 291.09G /dev/videovg/videolv01 - Extend the logical volume using the "VG Size" and videovg path noted earlier.
  9. ext2online /video - expand the ext3 partition to fill the newly expanded disk.

Detailed Steps:

[root@mythserver ~]# fdisk -l /dev/hda

Disk /dev/hda: 160.0 GB, 160041885696 bytes
255 heads, 63 sectors/track, 19457 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
   Device Boot      Start         End      Blocks   Id  System
/dev/hda1   *           1          19      152586   83  Linux
/dev/hda2              20         911     7164990   8e  Linux LVM
/dev/hda3             912       19457   148970745   8e  Linux LVM

[root@mythserver ~]# fdisk /dev/hdb

The number of cylinders for this disk is set to 19457.
There is nothing wrong with that, but this is larger than 1024,
and could in certain setups cause problems with:
1) software that runs at boot time (e.g., old versions of LILO)
2) booting and partitioning software from other OSs
   (e.g., DOS FDISK, OS/2 FDISK)

Command (m for help): p

Disk /dev/hdb: 160.0 GB, 160041885696 bytes
255 heads, 63 sectors/track, 19457 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

   Device Boot      Start         End      Blocks   Id  System

Command (m for help): n
Command action
   e   extended
   p   primary partition (1-4)
p
Partition number (1-4): 1
First cylinder (1-19457, default 1): 1
Last cylinder or +size or +sizeM or +sizeK (1-19457, default 19457): 19457

Command (m for help): t
Selected partition 1
   
Hex code (type L to list codes): 8e
Changed system type of partition 1 to 8e (Linux LVM)

Command (m for help): p

Disk /dev/hdb: 160.0 GB, 160041885696 bytes
255 heads, 63 sectors/track, 19457 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

   Device Boot      Start         End      Blocks   Id  System
/dev/hdb1               1       19457   156288321   8e  Linux LVM

Command (m for help): w
The partition table has been altered!

Calling ioctl() to re-read partition table.
Syncing disks.

[root@mythserver ~]# pvcreate /dev/hdb1

  Physical volume "/dev/hdb1" successfully created

[root@mythserver ~]# vgscan

  Reading all physical volumes.  This may take a while...
  Found volume group "videovg" using metadata type lvm2
  Found volume group "rootvg" using metadata type lvm2

[root@mythserver ~]# vgdisplay videovg

  --- Volume group ---
  VG Name               videovg
  System ID             
  Format                lvm2
  Metadata Areas        1
  Metadata Sequence No  2
  VG Access             read/write
  VG Status             resizable
  MAX LV                0
  Cur LV                1
  Open LV               1
  Max PV                0
  Cur PV                1
  Act PV                1
  VG Size               142.06 GB
  PE Size               32.00 MB
  Total PE              4546
  Alloc PE / Size       4545 / 142.03 GB
  Free  PE / Size       1 / 32.00 MB
  VG UUID               TmE0AD-HORo-biHu-1N40-1rEq-gWSM-K0iDmG

[root@mythserver ~]# vgextend videovg /dev/hdb1

  Volume group "videovg" successfully extended

[root@mythserver ~]# vgdisplay videovg

  --- Volume group ---
  VG Name               videovg
  System ID             
  Format                lvm2
  Metadata Areas        2
  Metadata Sequence No  3
  VG Access             read/write
  VG Status             resizable
  MAX LV                0
  Cur LV                1
  Open LV               1
  Max PV                0
  Cur PV                2
  Act PV                2
  VG Size               291.09 GB
  PE Size               32.00 MB
  Total PE              9315
  Alloc PE / Size       4545 / 142.03 GB
  Free  PE / Size       4770 / 149.06 GB
  VG UUID               TmE0AD-HORo-biHu-1N40-1rEq-gWSM-K0iDmG

[root@mythserver ~]# lvscan

  ACTIVE            '/dev/videovg/videolv01' [142.03 GB] inherit
  ACTIVE            '/dev/rootvg/rootlv01' [5.88 GB] inherit
  ACTIVE            '/dev/rootvg/rootlv02' [928.00 MB] inherit

[root@mythserver ~]# lvextend -L 291.09G /dev/videovg/videolv01

  Rounding up size to full physical extent 291.09 GB
  Extending logical volume videolv01 to 291.09 GB
  Logical volume videolv01 successfully resized

[root@mythserver ~]# ext2online /video

ext2online v1.1.18 - 2001/03/18 for EXT2FS 0.5b

[root@mythserver ~]#

References:
LVM HOWTO

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.

The ext2online program has

The ext2online program has been merged with resize2fs in fedora core 6 (mythdora 4). The command is `resize2fs /dev/VolGroup00/LogVol01` depending on your volgroup.

Insufficient free space, extents needed

When adding a terabyte drive to my MythDora 5 install, I received the following error:

> lvextend -L 1005.81G /dev/VolGroup00/LogVol01
Rounding up size to full physical extent 1005.81 GB
Extending logical volume LogVol01 to 1005.81 GB
Insufficient free space: 30161 extents needed, but only 29809 available

All the suggested fixes I found online involved upgrading lvextend but I was already using a newer version than the fix. To fix this I ended up extending the volume twice.

  1. First, run vgdisplay VolGroup00 and look for the line "Free PE / Size". Mine listed 29809 / 931.53 GB, so I ran lvextend -L 931.53G /dev/VolGroup00/LogVol01. This worked, but I wasn't using all of the available space.
  2. To add in the remaining space, repeat the steps above. The second time I ran vgdisplay I had 2025 / 63.28 GB available. 63.28 + 931.53 = 931.53, so I ran lvextend -L 994.81G /dev/VolGroup00/LogVol01 and it added the rest of the space.
  3. Finally I ran the command resize2fs /dev/VolGroup00/LogVol01 as listed in the other comment and I had all 1TB available.

Fantastic thank you. Find

Fantastic thank you. Find the files you are looking for at f-torrents.com the most comprehensive source for free-to-try files downloads on the Web

you have only 30161 of

you have only 30161 of extents free. can can use that much.....