increasing a logical volume
Solution 1
As I expected from the name /dev/root
, you're not using LVM. You have a few options:
- Reinstall
- Hope that your partitioning scheme allows you to grow the root partition with (g)parted.
- Create a new partition as LVM volume, create a vg and and an lv for /var and move /var over
- 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.
Related videos on Youtube
mahieddine
Updated on September 18, 2022Comments
-
mahieddine over 1 year
I need to increase the logical volume of the
var
directory, the maximum size ofvar
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 getVolume group "root" not found
If i do
lvextend -L +40G /dev/var
I getPath 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 getPath 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 outputNo volume groups found
-
Dennis Kaarsemaker about 11 yearsCan you add the output of pvs, vgs and lvs please.
-
-
mahieddine about 11 yearsplease read my edit sir
-
vonbrand about 11 yearsOr use something like parted, as OP isn't using LVM.
-
mahieddine about 11 yearsoption 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