6

I want to grow my volume group to use the unallocated space next to it.

 Name              Flags            Part Type    FS Type                  [Label]               Size (MB)

                                                     Unusable                                            1.05       *
  sda1              Boot              Primary        ext3                                            27563.92   *
                                      Logical        Free Space                                          1.02   *
  sda5                                Logical        ext4                                              524.33   *
  sda6              NC                Logical        LVM2_member                                    125002.85   *
                                      Logical        Free Space                                     824910.55   *
  sda2                                Primary        swap                                             6652.17   *
                                                     Unusable                                            0.64   *
  sda3                                Primary        ntfs                     [BackUp]             1015740.26   *
                                                     Unusable                                            2.19   *

So the free space after sda6 should be added to sda6 (which is my volume group). How can I achieve this?

sda5, sda6 and the unallocated space (824GB) are part of the extended partition sda4.

1 Answer 1

5
  1. fdisk to create a new partition #7 containing the space after sda6
  2. reboot to ensure that all partitions are registered properly and the device names are created.
  3. pvcreate /dev/sda7
  4. vgextend [volumegroupname] /dev/sda7
  5. vgdisplay -v [volumegroupname] ;; to see the added size and # extents

Now more space is contained in volumegroup.

I presume that you are extending one of the logical volumes within the VG that already contains an ext2/ext3 filesystem. For safety I'd suggest unmounting the logical volume that you want to expand.

  1. lvextend -l +[numberextentsfreefrom#5] [logicalvolumepath]
  2. resize2fs [logicalvolumepath]

Your logicalvolumepath will now have more available space.

6
  • Hi, after step 4 I can remove sda7 isn't it?
    – Roderik
    Aug 4, 2011 at 16:28
  • Can I do that by issuing vgreduce --all [volumegroupname]?
    – Roderik
    Aug 4, 2011 at 16:48
  • Once /dev/sda7 is contained in the VG, you CANNOT remove it from the partitioning information.
    – mdpc
    Aug 4, 2011 at 17:27
  • If the question is how to reduce the space, then you'll have to do things in the reverse order: resize2fs DOWN, lvreduce, and then finally vgreduce.
    – mdpc
    Aug 4, 2011 at 17:29
  • I was wondering what the aim is of the extra created partition. It works so I am happy, its probably not in my way, but its an extra partition without any meaning.
    – Roderik
    Aug 4, 2011 at 17:59

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .