6

I shrunk my windows partition and now have 10 GB of unallocated space that I now want to use to grow my / partition which is an ext4 in an lvm. I'm running Fedora 12.

I ran system-config-lvm but the "Initialize Entry" button is greyed out.

The unallocated space is not adjacent to the lvm but I cannot move the partitions in GParted like I was able to with ext3 in the past. I cannot create a new partition either as it says it cannot have more than 4 primary partitions. I don't see any option to create an extended partition.

So my question is, how do I add that unallocated space to the lvm so I can grow the size of the / partition?

I don't want to reinstall Fedora.

4
  • so what are your four primary partitions?
    – pulegium
    Commented Feb 6, 2010 at 10:15
  • I don't have 4 primary partitions. I have 2 NTFS partitions. 1 ext3 /boot and the lvm
    – Newbie
    Commented Feb 6, 2010 at 10:22
  • well, by the looks of it you do have 4 primary partitions, if it does not allow you to create another one... ok, what does fdisk -l show?
    – pulegium
    Commented Feb 6, 2010 at 10:58
  • @Newbie: we can help you better if you tell us specifically how your partitions are layed out. Commented Feb 10, 2010 at 4:14

3 Answers 3

2

Unfortunately, it sounds like you do indeed have four primary partitions -- two for the NTFS partitions, one for your /boot and one for the lvm. Extended partitions lives inside a primary partition dedicated to holding them, so you won't be able to make any.

I'm not sure there's an easy way out for you, other than to find some secondary storage to move data onto while you shuffle partitions. If you decide to do this, you should be able to copy entire logical volumes rather than the contents of the filesystems. Gparted can't cope with lvm, unfortunately, so you may have to copy the contents of the lvm elsewhere, delete that partition, move the others around (you may be able to move the content of the primary partitions into extended partitions, for future flexibility) then recreate the lvm and copy the data back.

That's a lot of work, sorry :(.

2

The whole point of LVM is that you CAN resize partitions, use multiple physical disks or partitions as one "logical" partition, etc. In order to utilize the free space you will need to create an additional partition using the free space.

Find out which disk the free space resides on using "fdisk -l", then do "fdisk /dev/hda" replacing hda with whichever disk is correct. Once a partition has been created using the free space we can now create a new physical volume:

pvcreate /dev/hda3

Replace hda3 with whatever the name of the new partition is (available within "fdisk -l"). Now we will extend the Volume Group to the new physical volume like so:

vgextend /dev/VolGroup00 /dev/hda3

Where VolGroup00 is the name of whichever VG exists on your system (available by running "vgdisplay"). Where hda3 is the name of the new partition (again). Once the VG has been extended we can now extend the Logical Volume:

lvextend -L +20G /dev/VolGroup01/LogVol00

Where 20G is changed to the amount of free space available and VG and LV changed to their correct names. Once the Logical Volume has been extended we have to extend the ext4 filesystem within that LV:

resize2fs /dev/VolGroup01/LogVol00

Again, change the names to match your system. You can perform all of this on a running system..including the last command. Extending ext4 on a mounted partition works fine since early versions of the 2.6 kernel.

1
0

Given the amount of work required to shuffle the partitions around, you could consider expanding your NTFS partition again, then creating a 10GB file, putting a filesystem in it, then mounting it after mounting your NTFS partition. This solution is less robust than sorting out the partitions properly (and obviously doesn't integrate nicely with lvm) but it may be that it's more achievable.

2
  • 1
    So basically there's no way to grow the LVM? I read somewhere that lvm makes it easier to resize the partition but it doesn't look like it. It adds unnecessary complication for majority of the users. Back when I was in Fedora 7, I've moved/resized my partitions several times but after they introduced this "improvement" in Fedora 11 and left that as default, it's impossible to do anything. I'll probably have to resize again in the future so I guess I should just format, reinstall and stick to ext3.
    – Newbie
    Commented Feb 6, 2010 at 17:37
  • @Newbie: it does "make it easier to resize", but like any technology there's some strings attached. in this case, the first string is that you can't have more than 4 primary partitions, and you need space in a partition in order to add it to LVM. you'd have similar trouble resizing an ext3 partition in this situation. Commented Feb 10, 2010 at 4:12

You must log in to answer this question.