Find the answer to your Linux question:
Results 1 to 3 of 3
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 ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined!
    Join Date
    Jul 2012
    Posts
    4

    How to get LVM to recognize a disk size change.


    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:

    sd 2:0:0:0: [sda] 286511105 512-byte logical blocks: (146 GB/136 GiB)
    How the OS sees the LVM partition:

    [root ~]# 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:

    [root ~]# 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?

  2. #2
    Linux Newbie
    Join Date
    Jan 2013
    Posts
    116
    To increase lv there should space in vg, have you also incresed vg to extend lv, because lv extend from vg not directly from disk.
    For this if you have added new disk then make a new pv physical volum and add to vg then extend lv.

  3. #3
    Linux Guru Rubberman's Avatar
    Join Date
    Apr 2009
    Location
    I can be found either 40 miles west of Chicago, in Chicago, or in a galaxy far, far away.
    Posts
    11,662
    Quote Originally Posted by NixSavy View Post
    To increase lv there should space in vg, have you also incresed vg to extend lv, because lv extend from vg not directly from disk.
    For this if you have added new disk then make a new pv physical volum and add to vg then extend lv.
    And then you will need to extend the file system with the resize2fs tool (assuming it is an ext2/3/4 file system). There are resize tools in /sbin for other file system types as well.
    Sometimes, real fast is almost as good as real time.
    Just remember, Semper Gumbi - always be flexible!

  4. $spacer_open
    $spacer_close

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •