Skip to content


expending disk to grow volume group in Red Hat without a reboot.

In my work queue, there is a request to add space to a file system.

]# df -hP
Filesystem                    Size  Used Avail Use% Mounted on
.........................
/dev/mapper/vg_sys-lv_var     3.9G  2.0G  1.8G  53% /var
/dev/mapper/oracle_vg-u01_lv   49G   45G  1.7G  97% /u01

Unfortunately, there is almost no free space remaining in the volume group where this file system resides.

# pvs
  PV         VG        Fmt  Attr PSize  PFree
  /dev/sda2  vg_sys    lvm2 a--  69.69g  47.69g
  /dev/sdb   oracle_vg lvm2 a--  49.75g 768.00m

To resolve the request, I could either add another disk to oracle_vg or I could “grow” /dev/sdb to “grow” its volume group to deliver enough free space to grow the /u01 file system. Since, this is a “VMWare” guest, I grow /dev/sdb by increasing its size to 60GB. Next, I need to make LVM aware of the new size. This is done following the next steps. If your host has more than two disks, you may have more sub-directories that the two shown next. Repeat the echo statements for all of them unless you know exactly which sub-directory represents the disk you want to “grow”.

# cd /sys/class/scsi_disk;ls
2:0:0:0  2:0:1:0
# echo '1' > 2:0:0:0/device/rescan
# echo '1' > 2:0:1:0/device/rescan
# pvscan
# pvs
  PV         VG        Fmt  Attr PSize  PFree
  /dev/sda2  vg_sys    lvm2 a--  69.69g  47.69g
  /dev/sdb   oracle_vg lvm2 a--  59.75g 768.00m

With the additional disk capacity recognized by LVM, we extend the file system by extending its logical volume.

# lvextend -r -L +10G /dev/mapper/oracle_vg-u01_lv

To really make sure that the action completed OK.

# df -hP
Filesystem                    Size  Used Avail Use% Mounted on
........................................
/dev/mapper/vg_sys-lv_var     3.9G  2.0G  1.8G  53% /var
/dev/mapper/oracle_vg-u01_lv   58G   45G   11G  81% /u01

This all was possible because this host (guest) had VMWare tools installed…..

Posted in LINUX.

Tagged with , .


0 Responses

Stay in touch with the conversation, subscribe to the RSS feed for comments on this post.



Some HTML is OK

or, reply to this post via trackback.

WordPress Anti Spam by WP-SpamShield



Copyright © 2016 - 2018 Waldemar Mark Duszyk. All Rights Reserved. Created by Blog Copyright.