lvm

lvm my VG has no free PE but it has a lot of space indeed, why?


everyone:

I use lvm on my Gentoo Linux, and it has a HHD and a SSD, so I use SSD to be the cache of HHD to accelerate the speed. However, after several days, I think it's even slower than only use HHD. Then I try to find the reason but unfortunately I failed till now. Here is a question puzzling me as I write in title:

As it shows below, my PV has no free PE to allocate:

lgl@pGentoo ~ $ sudo pvdisplay
  --- Physical volume ---
  PV Name               /dev/sdb5
  VG Name               pika
  PV Size               150.00 GiB / not usable 1.69 MiB
  Allocatable           yes (but full)
  PE Size               4.00 MiB
  Total PE              38400
  Free PE               0
  Allocated PE          38400
   PV UUID               O1Db1I-zXss-5OLP-nlN6-OUFH-oqDf-8UjOFY

  --- Physical volume ---
  PV Name               /dev/sda7
  VG Name               pika
  PV Size               20.00 GiB / not usable 4.00 MiB
  Allocatable           yes 
  PE Size               4.00 MiB
  Total PE              5119
  Free PE               235
  Allocated PE          4884
  PV UUID               4Hy6zL-gcpi-aRmI-GeUB-rEsw-Sa3R-Fd4Kpb

However, if I check my space used with df -h, I can see that only 21% is used by /(\ is mounted on /dev/sdb5) while in pvdislay it says that I have no free PE to allocate, why?

lgl@pGentoo ~ $ sudo df -h
filesystem             total used  free   used% mountpoint
none                   3.8G  1.6M  3.8G    1% /run
udev                    10M     0   10M    0% /dev
tmpfs                  3.8G  116M  3.7G    3% /dev/shm
/dev/mapper/pika-data  148G   29G  112G   21% /
tmpfs                  3.8G     0  3.8G    0% /sys/fs/cgroup
tmpfs                  3.8G  1.9M  3.8G    1% /tmp
/dev/sda8              2.0G   43M  1.8G    3% /boot
/dev/sda1              496M   59M  438M   12% /boot/efi
/dev/sdb6               99G  4.5G   89G    5% /home
tmpfs                  776M   20K  776M    1% /run/user/1000

thanks.


Solution

  • OK, i have found the answer on this question myself.....

    thanks for the answer of Lone_Wolf.

    Allocatable yes (but full) from pvdisplay means that you have assigned the space on that PV to a logical volume. DF doesn't show LVM physical volumes, it only displays data about filesystems on logical volumes.