Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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.

share|improve this question

migrated from Apr 10 '10 at 6:53

This question came from our site for system and network administrators.

so what are your four primary partitions? – pulegium Feb 6 '10 at 10:15
I don't have 4 primary partitions. I have 2 NTFS partitions. 1 ext3 /boot and the lvm – Newbie Feb 6 '10 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 Feb 6 '10 at 10:58
@Newbie: we can help you better if you tell us specifically how your partitions are layed out. – quack quixote Feb 10 '10 at 4:14

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 :(.

share|improve this answer

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.

share|improve this answer
Thanks for the info. BTW, this website has extra hints on how to use vgdisplay and similar commands to discover the volume groups, etc. – Mr Fooz Feb 17 '13 at 19:32

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.

share|improve this answer
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 Feb 6 '10 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. – quack quixote Feb 10 '10 at 4:12

You must log in to answer this question.

protected by Community Jun 7 '11 at 18:12

Thank you for your interest in this question. Because it has attracted low-quality or spam answers that had to be removed, posting an answer now requires 10 reputation on this site (the association bonus does not count).

Would you like to answer one of these unanswered questions instead?