Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

RHEL - how to get LVM to recognize a drive size change

Status
Not open for further replies.

jfmays

ISP
Oct 2, 2008
35
US
Helping out another organization with a server they have. It had 30G disks in a mirror on an LSI disc controller. We changed the disks one at a time so the mirror is now made of 146G disks, so it shows up in the bios as one 146G disk. The LVM in OS still insists on seeing the disk as 30G, though, and refuses to let me grow the size insisting no room is available. How do I get LVM to understand that the size of the disk has now changed in the bios?

The drive as it shows up in dmesg when it first appears:

Code:
sd 2:0:0:0: [sda] 286511105 512-byte logical blocks: (146 GB/136 GiB)

How the OS sees the LVM partition:

Code:
[root@postgres-02 ~]# df
Filesystem           1K-blocks      Used Available Use% Mounted on
/dev/mapper/VolGroup-lv_root
                      28322828  10549072  16335036  40% /

What happens when I try to grow the LVM partition:
Code:
[root@postgres-02 ~]# lvextend -f -L130G /dev/mapper/VolGroup-lv_root
  Extending logical volume lv_root to 130.00 GiB
  Insufficient free space: 26255 extents needed, but only 0 available

Where is the stuck information in LVM that is still telling it this is a 30G disk, and how do I change it to get it to realize it can be more?
 
PV PV PV PV
-----------------------
|
VG
|
---LV----------LV-----

PV Physical Volume
VG Volume Group
LV Logical Volume

#vgdisplay
#vgs
#vgscan

 
If the underlying disk was size X and later was made larger to size Y - as indicated in your description - you will need to do a pvresize on the disk in question to get it to see the new space.

If you do a pvs, you should see your sda device at its original size. If you then do a "pvresize /dev/sda" and then a pvs again, you should now see the additional space.

Once you can see the space, then just use lvextend and resize2fs to make the specified file system larger.

Add a little color to your PUTTY terminal: faq52-6627
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top