Topic
3 replies Latest Post - ‏2011-08-06T00:03:04Z by WayneBoyer
SystemAdmin
SystemAdmin
706 Posts
ACCEPTED ANSWER

Pinned topic linux newbie question on expanding logical volumes

‏2011-07-29T21:06:05Z |
I am new to linux and have built an lpar with redhat 5.6 loaded.
I need to increase my /var which I created upon os load with only 500g
When I went to increase my logical volume associated with this filesystem I got an error that has really confused me.

Here's my df output for /var:
/dev/mapper/mpath0p5 505572 469682 9788 98% /var

I ran this command to increase:
root@ulrhadm /# lvextend -L +1G /dev/mapper/mpath0p5
Path required for Logical Volume "mpath0p5"
Please provide a volume group name
Run `lvextend --help' for more information.

This failed but it will let me increase an umounted Logical volume LV like this:
root@ulrhadm VolGroup00# lvextend -L +1G /dev/VolGroup00/LogVol00
Extending logical volume LogVol00 to 7.00 GB
Logical volume LogVol00 successfully resized

What am I doing wrong here with var?
Updated on 2011-08-06T00:03:04Z at 2011-08-06T00:03:04Z by WayneBoyer
  • WayneBoyer
    WayneBoyer
    2 Posts
    ACCEPTED ANSWER

    Re: linux newbie question on expanding logical volumes

    ‏2011-08-02T16:43:24Z  in response to SystemAdmin
    Hello,

    From the output that you provided, it looks like /var is not mounted on a logical volume. It looks like it is mounted on a partition that's part of a multipath device.

    The easiest way to fix this is probably going to be reinstalling the system and making sure that you're using lvm to manage all of your storage.
  • SystemAdmin
    SystemAdmin
    706 Posts
    ACCEPTED ANSWER

    Re: linux newbie question on expanding logical volumes

    ‏2011-08-02T20:08:26Z  in response to SystemAdmin
    thanks Wayne, yes, this looks like my problem.

    I'm going to reinstall and set my volumes up to be lvm volumes and not partitions this time.

    But the documentation is confusing. On the Disk Druid screen, you can add what appears to be Logical volumes by clicking New to add them - this is where I created my filesystems before. I'm guessing this is the wrong place to add lvm volumes and this, instead adds partitions, correct?
    There is an LVM button in disk druid - Is this the right place to go when creating lvm volumes that can be managed with lvm?

    Also what makes it confusing is that Disk Druid shows the volumes / and swap as under the volgroup00 and this is where I created my filesystems before and they all showed up wrong as partitions. So it would seem like the / and swap filesysetms are partitions also, is this true? Can these be changd to lvm managed volumes?

    I'm going to create my system with fewer filesystems instaed this time - giong with just the recommended /, /boot, swap, and I'm going to create a separate /var. There's also another volume it mentions called PPC PReP - how do you create this?
    • WayneBoyer
      WayneBoyer
      2 Posts
      ACCEPTED ANSWER

      Re: linux newbie question on expanding logical volumes

      ‏2011-08-06T00:03:04Z  in response to SystemAdmin
      I spoke with Jennifer offline and she was able to reinstall her system with
      the partitioning that she wanted.

      Here's an example of how I was able to do this using one of my machines.
      I've included links to some screenshots to help with the explanation.

      The first step is to select a disk for the installation and then let the
      installer create a default layout. Make sure to select the "Review and
      modify partitioning layout" checkbox.

      http://db.tt/y7fsbfd

      The next two screenshots show the partitioning that gets created. My VNC
      window for the installation is kind of small, so it takes two shots.

      The first one shows the logical volumes that get created. One is for the root
      partition and the other is for the swap partition.

      http://db.tt/5iY0iy0

      The second one shows the physical partitions that get created on the disk.
      Note that there are three partitions. The first is the required PReP Boot
      partition. The second is the /boot partition, which can not be a logical
      volume, and the third is the LVM physical volume that is used for the logical
      volumes.

      http://db.tt/eFsbr9K

      The two logical volumes that get created use up all the space on the physical
      volume. At this point you'll need to do some editing if you want to have
      separate logical volumes for /var, /home, etc.

      To do this, select "VolGroup00" and click Edit. This will bring up a dialog
      that will allow you to edit the existing volumes and create new ones.

      http://db.tt/Hw4gsNg

      In my case I reduced the size of LogVol00 and then added a new volume to use
      for /var.
      http://db.tt/2TATADL

      At this point I continued as normal with the installation.

      Here is the final disk layout.

      Disk /dev/sdb: 73.4 GB, 73400303616 bytes
      255 heads, 63 sectors/track, 8923 cylinders
      Units = cylinders of 16065 * 512 = 8225280 bytes

      Device Boot Start End Blocks Id System
      /dev/sdb1 * 1 1 8001 41 PPC PReP Boot
      /dev/sdb2 2 14 104422+ 83 Linux
      /dev/sdb3 15 8923 71561542+ 8e Linux LVM

      And here are the mount points.

      /dev/mapper/VolGroup00-LogVol00 on / type ext3 (rw)
      /dev/mapper/VolGroup00-LogVol02 on /var type ext3 (rw)
      /dev/sdb2 on /boot type ext3 (rw)