You are not logged in.

#1 2015-10-11 18:36:48

toni
Member
Registered: 2011-10-15
Posts: 437

[SOLVED] LVM different sizes and free space in device

I have a device with a LVM partition, below the information:

[toni@toni ~]$ sudo pvdisplay
  --- Physical volume ---
  PV Name               /dev/sdb3
  VG Name               VolGroup00
  PV Size               296,84 GiB / not usable 3,00 MiB
  Allocatable           yes 
  PE Size               4,00 MiB
  Total PE              75991
  Free PE               35031
  Allocated PE          40960
  PV UUID               Q5w0H1-Efb8-H03m-un9v-wsqG-vT8t-3yeSY3
   
[toni@toni ~]$ sudo vgdisplay
  --- Volume group ---
  VG Name               VolGroup00
  System ID             
  Format                lvm2
  Metadata Areas        1
  Metadata Sequence No  13
  VG Access             read/write
  VG Status             resizable
  MAX LV                0
  Cur LV                4
  Open LV               4
  Max PV                0
  Cur PV                1
  Act PV                1
  VG Size               296,84 GiB
  PE Size               4,00 MiB
  Total PE              75991
  Alloc PE / Size       40960 / 160,00 GiB
  Free  PE / Size       35031 / 136,84 GiB
  VG UUID               4LYVkD-Kt4l-XEDj-YX6e-AF8L-9LXi-5gYDTD
   
[toni@toni ~]$ sudo lvdisplay
  --- Logical volume ---
  LV Path                /dev/VolGroup00/lvolswap
  LV Name                lvolswap
  VG Name                VolGroup00
  LV UUID                SFdg8X-Nu3K-oDB0-Kf9k-rsYj-HtDP-PdmvNd
  LV Write Access        read/write
  LV Creation host, time archiso, 2013-09-15 14:43:50 +0200
  LV Status              available
  # open                 2
  LV Size                8,00 GiB
  Current LE             2048
  Segments               1
  Allocation             contiguous
  Read ahead sectors     auto
  - currently set to     256
  Block device           254:0
   
  --- Logical volume ---
  LV Path                /dev/VolGroup00/lvolhome
  LV Name                lvolhome
  VG Name                VolGroup00
  LV UUID                Akyc8h-Gp27-UsIM-4lQr-hO98-5c0Q-OALCjl
  LV Write Access        read/write
  LV Creation host, time archiso, 2013-09-15 14:49:42 +0200
  LV Status              available
  # open                 1
  LV Size                85,00 GiB
  Current LE             21760
  Segments               2
  Allocation             inherit
  Read ahead sectors     auto
  - currently set to     256
  Block device           254:1
   
  --- Logical volume ---
  LV Path                /dev/VolGroup00/lvolroot
  LV Name                lvolroot
  VG Name                VolGroup00
  LV UUID                k0dft3-CBfM-jXO7-7iRh-RIpR-14au-grpanw
  LV Write Access        read/write
  LV Creation host, time archiso, 2013-09-15 14:51:12 +0200
  LV Status              available
  # open                 1
  LV Size                55,00 GiB
  Current LE             14080
  Segments               3
  Allocation             inherit
  Read ahead sectors     auto
  - currently set to     256
  Block device           254:2
   
  --- Logical volume ---
  LV Path                /dev/VolGroup00/lvolvar
  LV Name                lvolvar
  VG Name                VolGroup00
  LV UUID                5Nz65L-DYQE-G38g-f5k3-Ev0V-RzMl-rWo8In
  LV Write Access        read/write
  LV Creation host, time archiso, 2013-09-15 14:52:19 +0200
  LV Status              available
  # open                 1
  LV Size                12,00 GiB
  Current LE             3072
  Segments               1
  Allocation             inherit
  Read ahead sectors     auto
  - currently set to     256
  Block device           254:3
   
[toni@toni ~]$ sudo pvs
  PV         VG         Fmt  Attr PSize   PFree  
  /dev/sdb3  VolGroup00 lvm2 a--  296,84g 136,84g
[toni@toni ~]$ sudo vgs
  VG         #PV #LV #SN Attr   VSize   VFree  
  VolGroup00   1   4   0 wz--n- 296,84g 136,84g
[toni@toni ~]$ sudo lvs
  LV       VG         Attr       LSize  Pool Origin Data%  Meta%  Move Log Cpy%Sync Convert
  lvolhome VolGroup00 -wi-ao---- 85,00g                                                    
  lvolroot VolGroup00 -wi-ao---- 55,00g                                                    
  lvolswap VolGroup00 -wc-ao----  8,00g                                                    
  lvolvar  VolGroup00 -wi-ao---- 12,00g                                                    
[toni@toni ~]$ 

I have resized (using lvresize -L amount logical_volume) the logical volume lvolroot, now it has 85GB as last command shows. Also I have resized lvolhome but if I launch below command sizes do not match with those shown by pvs or lvdisplay:

[toni@toni ~]$ LC_ALL=C df -hP | column -t
Filesystem                       Size  Used  Avail  Use%  Mounted                                               on
dev                              3.9G  0     3.9G   0%    /dev
run                              3.9G  1.4M  3.9G   1%    /run
/dev/mapper/VolGroup00-lvolroot  30G   25G   3.2G   89%   /
tmpfs                            3.9G  22M   3.9G   1%    /dev/shm
tmpfs                            3.9G  0     3.9G   0%    /sys/fs/cgroup
tmpfs                            3.9G  56K   3.9G   1%    /tmp
/dev/mapper/VolGroup00-lvolhome  79G   71G   4.0G   95%   /home
/dev/mapper/VolGroup00-lvolvar   12G   3.7G  7.5G   33%   /var
/dev/sdb4                        247M  125M  122M   51%   /boot
tmpfs                            790M  12K   790M   1%    /run/user/120
tmpfs                            790M  24K   790M   1%    /run/user/1000
/dev/sdb2                        976M  38M   872M   5%    /run/media/toni/d95a78a9-f22c-4558-ac49-cec0cf2f980f
[toni@toni ~]$ 

Why sizes do not match?

I mean lvdisplay shows 55,00 GiB of size for lvolroot and  85,00 GiB of size for lvolhome but this last command (df) shows 30G for lvolroot and 79G for lvolhome. Why? They do not match.

EDIT: I have solved by executing below command missed:

resize2fs /dev/VolGroup00/lvolhome
resize2fs /dev/VolGroup00/lvolroot

Sorry, I forgot last command.....

Last edited by toni (2015-10-11 18:56:08)

Offline

Board footer

Powered by FluxBB