increasing a logical volume

8,696

Solution 1

As I expected from the name /dev/root, you're not using LVM. You have a few options:

  1. Reinstall
  2. Hope that your partitioning scheme allows you to grow the root partition with (g)parted.
  3. Create a new partition as LVM volume, create a vg and and an lv for /var and move /var over
  4. Clean up the current system so you don't need the space

Options 2 and 3 are best done when booting from a rescue cd or rescue netboot.

Solution 2

Your /var is inside the root mountpoint, so you'll want to increase the size of /dev/root, if that is an LVM volume.

Share:
8,696

Related videos on Youtube

mahieddine
Author by

mahieddine

Updated on September 18, 2022

Comments

  • mahieddine
    mahieddine over 1 year

    I need to increase the logical volume of the var directory, the maximum size of var right now is 10GB, I need to make it 50GB. I have a Centos 6 server.

    The output of df -h is:

    Filesystem            Size  Used Avail Use% Mounted on
    rootfs                 10G   10G     0 100% /
    /dev/root              10G   10G     0 100% /
    none                  991M  312K  990M   1% /dev
    /dev/sda2             455G  3.6G  429G   1% /home
    tmpfs                 991M     0  991M   0% /dev/shm
    /dev/root              10G   10G     0 100% /var/named/chroot/etc/named
    /dev/root              10G   10G     0 100% /var/named/chroot/var/named
    /dev/root              10G   10G     0 100% /var/named/chroot/etc/named.conf
    /dev/root              10G   10G     0 100% /var/named/chroot/etc/named.rfc1912.zones
    /dev/root              10G   10G     0 100% /var/named/chroot/etc/rndc.key
    /dev/root              10G   10G     0 100% /var/named/chroot/usr/lib64/bind
    /dev/root              10G   10G     0 100% /var/named/chroot/etc/named.iscdlv.key
    /dev/root              10G   10G     0 100% /var/named/chroot/etc/named.root.key
    

    I followed this tutorial. In order to increase the volume you have to do:

    lvextend -L +40G /Path/To/var

    My problem is simple, I don't know where my var is located.

    If i do lvextend -L +40G /dev/root/var I get Volume group "root" not found

    If i do lvextend -L +40G /dev/var I get

      Path required for Logical Volume "var"
      Please provide a volume group name
      Run `lvextend --help' for more information.
    

    I tried every possible path, still can't find the right path to var, so where my var is located?

    EDIT

    If i do lvextend -L +40G /dev/root I get

      Path required for Logical Volume "root"
      Please provide a volume group name
      Run `lvextend --help' for more information.
    

    pvs gives no output at all.

    lvs gives this output No volume groups found

    • Dennis Kaarsemaker
      Dennis Kaarsemaker about 11 years
      Can you add the output of pvs, vgs and lvs please.
  • mahieddine
    mahieddine about 11 years
    please read my edit sir
  • vonbrand
    vonbrand about 11 years
    Or use something like parted, as OP isn't using LVM.
  • mahieddine
    mahieddine about 11 years
    option 1: do you mean reinstall centos? if so what to do during the installation to insure that i'm using lvm volume? Basically i have nothing on the server right now so i can do a reinstallation