-2

I get the following details from RHEL 7.2 machine , sda DISK is using LVM

lsblk
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
sda 8:0 0 250G 0 disk
├─sda1 8:1 0 500M 0 part /boot
├─sda2 8:2 0 199.5G 0 part
│ ├─vg-cluster-lv_root 253:0 0 183G 0 lvm /
│ ├─vg-cluster-lv_swap 253:1 0 16G 0 lvm [SWAP]
│ └─vg-cluster-lv_var 253:2 0 100G 0 lvm /var
└─sda3 8:3 0 50G 0 part
└─vg-cluster-lv_root 253:0 0 183G 0 lvm /
sde 8:64 0 50G 0 disk
└─sde1 8:65 0 50G 0 part
└─vg-cluster-lv_root 253:0 0 183G 0 lvm /
sr0 11:0 1 1024M 0 rom




df -h
Filesystem Size Used Avail Use% Mounted on
/dev/mapper/vg-cluster-lv_root 183G 69G 115G 38% /
devtmpfs 95G 0 95G 0% /dev
tmpfs 95G 96K 95G 1% /dev/shm
tmpfs 95G 4.1G 91G 5% /run
tmpfs 95G 0 95G 0% /sys/fs/cgroup
/dev/sda1 497M 158M 340M 32% /boot
/dev/mapper/vg-cluster-lv_var 100G 86G 15G 86% /var


blockdev --getsize64 /dev/sda | awk '{ printf "%.2f\n", $1/1024/1024/1024; }'
250.00

as we can see above the size of the disk is 250g

but on other hand we can see that root file system is 183g

/dev/mapper/vg-cluster-lv_root 183G 69G 115G 38% /

and /var file system is 100g

/dev/mapper/vg-cluster-lv_var 100G 86G 15G 86% /var

so how it can be ? ( 183+100 = 283 ) , while disk size is only 250g

what I am missing here ?

1 Answer 1

3

Your VG vg-cluster has three PVs -- /dev/sda2 (199.5G), /dev/sda3 (50G), and /dev/sde1 (50G) on the second disk, so you have approximately 300 GiB of space in the VG that is all used by your lv_root, lv_swap and lv_var LVs.

Note: When gathering information about storage when LVM is involved, using lvs/pvs/vgs is usually better than lsblk which cannot display detailed information about the LVM setup, it shows only basic information about block devices. And displaying devices with multiple "parents" (not only LVM but also MD RAID for example) is always a little confusing with lsblk. In this case you case vg-cluster-lv_root has three "parents" in the output.

4
  • I need to extend the /var by +100g , so do we need to add additional disk and use this disk + extend the VG + Extend the logical volume and finally extend the /var filesystem ? Commented Dec 2, 2021 at 14:25
  • Yes. (You can do the LV + filesystem resize in one step with lvresize --resizefs.) Commented Dec 2, 2021 at 14:35
  • I prefer to do this --> pvcreate /dev/sdX + vgextend vg-cluster /dev/sdX + lvresize --size +100g /dev/mapper/vg-cluster-lv_var , and xfs_growfs /var , is it ok ? Commented Dec 2, 2021 at 14:40
  • In case anyone ever lands here like I did, trying to figure out the final step to extend VirtualBox drive capacity, I finished it up with sudo xfs_growfs /dev/etc1/etc2: After running lvs, I saw that my target drive had the "LSize" I expected, even though the Disk Usage Analyzer showed the actual size. From the lvs output, I then took the VG and LV column values for that drive, and used those in the place of "etc1" and "etc2" respectively. In the end, for my VirtualBox Red Hat guest system, my final command was sudo xfs_growfs /dev/rhel/root Commented Jul 29, 2022 at 16:35

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.