howto extendlvm

madunix madunix at gmail.com
Wed May 19 08:01:52 UTC 2010


I want to extend an existing lvm ( volume group "VolGroup00" using
metadata type lvm2)
[root at linux2 ~]# df -kh
Filesystem            Size  Used Avail Use% Mounted on
/dev/mapper/VolGroup00-LogVol00
                       58G   12G   44G  21% /
/dev/sda1              99M   27M   68M  29% /boot
tmpfs                 7.9G     0  7.9G   0% /dev/shm
[root at linux2 ~]# vgscan
  Reading all physical volumes.  This may take a while...
  Found volume group "VolGroup00" using metadata type lvm2
[root at linux2 ~]# lvmdiskscan
  /dev/ram0                [       16.00 MB]
  /dev/root                [       58.84 GB]
  /dev/ram                 [       16.00 MB]
  /dev/sda1                [      101.94 MB]
  /dev/VolGroup00/LogVol01 [        8.78 GB]
  /dev/ram2                [       16.00 MB]
  /dev/sda2                [       67.65 GB] LVM physical volume
  /dev/ram3                [       16.00 MB]
  /dev/ram4                [       16.00 MB]
  /dev/ram5                [       16.00 MB]
  /dev/ram6                [       16.00 MB]
  /dev/ram7                [       16.00 MB]
  /dev/ram8                [       16.00 MB]
  /dev/ram9                [       16.00 MB]
  /dev/ram10               [       16.00 MB]
  /dev/ram11               [       16.00 MB]
  /dev/ram12               [       16.00 MB]
  /dev/ram13               [       16.00 MB]
  /dev/ram14               [       16.00 MB]
  /dev/ram15               [       16.00 MB]
  2 disks
  17 partitions
  0 LVM physical volume whole disks
  1 LVM physical volume
[root at linux2 ~]# fdisk -l

Disk /dev/sda: 72.7 GB, 72746008576 bytes
255 heads, 63 sectors/track, 8844 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *           1          13      104391   83  Linux
/dev/sda2              14        8844    70935007+  8e  Linux LVM
[root at linux2 ~]#

Can you point out the safe way to do it?
Am thinking to do the following steps on my RHEL5.1
vgs
pvcreate /dev/lun2
vgextend vg01 /dev/lun2
lvextend -L +1G /dev/vg01/lv01
resize2fs /mount/point/of/lv01

Thanks




More information about the redhat-list mailing list