0

I am running CentOS 6.5 in Hyper-V. It originally started off with a 5GB virtaul hard disk (VHDX) but I later decided I wanted to increase the size. I changed it in Hyper-V settings to 20GB, then booted partition magic live CD and changed /dev/sda to 20GB. I then ran the following to increase the LVM:

lvextend -l +100%FREE /dev/mapper/vg_condor-lv_root

I though this was enough, but it still seems to be limited to the original ~4GB. Here's some details, but please ask for any specific stuff you need as I'm pretty new to this:

[root@condor leonard]# fdisk -l

Disk /dev/sda: 21.5 GB, 21474836480 bytes
255 heads, 63 sectors/track, 2610 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x0006a679

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *           1          64      512000   83  Linux
Partition 1 does not end on cylinder boundary.
/dev/sda2              64        2611    20458496   8e  Linux LVM

Disk /dev/mapper/vg_condor-lv_root: 20.4 GB, 20409483264 bytes
255 heads, 63 sectors/track, 2481 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00000000


Disk /dev/mapper/vg_condor-lv_swap: 536 MB, 536870912 bytes
255 heads, 63 sectors/track, 65 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00000000

[root@condor leonard]# df -h
Filesystem            Size  Used Avail Use% Mounted on
/dev/mapper/vg_condor-lv_root
                      3.9G  1.1G  2.6G  29% /
tmpfs                 495M     0  495M   0% /dev/shm
/dev/sda1             477M   82M  370M  19% /boot

[root@condor leonard]# lsblk
NAME                         MAJ:MIN RM  SIZE RO TYPE MOUNTPOINT
sr0                           11:0    1 1024M  0 rom
sda                            8:0    0   20G  0 disk
├─sda1                         8:1    0  500M  0 part /boot
└─sda2                         8:2    0 19.5G  0 part
  ├─vg_condor-lv_root (dm-0) 253:0    0   19G  0 lvm  /
  └─vg_condor-lv_swap (dm-1) 253:1    0  512M  0 lvm  [SWAP]

Ultimately, how do I correctly increase the space available to the / folder?

1 Answer 1

2

You still need to resize the filesystem contained in the LV (assuming it's one of the ext filesystems):

resize2fs /dev/mapper/vg_condor-lv_root

If you want to resize a logical volume and its filesystem in a single operation, use fsadm:

fsadm resize /dev/mapper/vg_condor-lv_root

This supports the ext filesystems as well as ReiserFS and XFS.

0

You must log in to answer this question.

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