I have a need to shrink lvm2 partition, that was created by CentOS 7.4 installer. I am confused with what I see by lvm commands:
root@ubuntu:/home/ubuntu# pvdisplay --- Physical volume --- PV Name /dev/sdb2 VG Name sample-group PV Size 28.32 GiB / not usable 3.00 MiB Allocatable yes (but full) PE Size 4.00 MiB Total PE 7250 Free PE 0 Allocated PE 7250 PV UUID xutuoL-6546d-rttert-n7tH-eeXu-24t3-dgf33
root@ubuntu:/home/ubuntu# vgdisplay --- Volume group --- VG Name sample-group System ID Format lvm2 Metadata Areas 1 Metadata Sequence No 3 VG Access read/write VG Status resizable MAX LV 0 Cur LV 2 Open LV 0 Max PV 0 Cur PV 1 Act PV 1 VG Size 28.32 GiB PE Size 4.00 MiB Total PE 7250 Alloc PE / Size 7250 / 28.32 GiB Free PE / Size 0 / 0 VG UUID ytjytj-QWT5-sdf-vSMj-rKtj-gfhdfh-76885
root@ubuntu:/home/ubuntu# lvdisplay --- Logical volume --- LV Path /dev/sample-group/swap LV Name swap VG Name sample-group LV UUID JIZL0D-kNfL-aEsR-y6Rl-1mzx-wWpO-ngcElh LV Write Access read/write LV Creation host, time cube, 2018-04-20 07:15:29 +0000 LV Status available # open 0 LV Size 2.93 GiB Current LE 751 Segments 1 Allocation inherit Read ahead sectors auto - currently set to 256 Block device 253:0 --- Logical volume --- LV Path /dev/sample-group/root LV Name root VG Name sample-group LV UUID 4OIJBb-6MSa-y5Ua-62bI-O6Lf-pjWZ-Qnz4Gv LV Write Access read/write LV Creation host, time cube, 2018-04-20 07:15:30 +0000 LV Status suspended # open 0 LV Size 25.39 GiB Current LE 6499 Segments 1 Allocation inherit Read ahead sectors auto - currently set to 256 Block device 253:1
From the above output we see that there is totally no free space on the disk, but this is what I see in file-manager:
Almost the whole disk is empty, but why it lies me in console?
I cannot estimate how much space do I have and cannot shrink it. Tried with kvpm and it shows the same.
After the Emmanuel's manipulations on
parted resizepart step it throws
Error: can't have the end before the start (start sector=2099200 length=-2073809)
And here is what pvs/vgs shows:
PV VG Fmt Attr PSize PFree /dev/sdb2 sample-group lvm2 a-- 4.00g 1.06g
Successfully resized the partition, but now xfsdump refuses to restore my filesystem:
xfsdump: using file dump (drive_simple) strategy xfsdump: version 3.1.6 (dump format 3.0) - type ^C for status and control xfsdump: WARNING: most recent level 0 dump was interrupted, but not resuming that dump since resume (-R) option not specified xfsdump: level 0 dump of ubuntu:/mnt/root xfsdump: dump date: Sat May 26 18:14:53 2018 xfsdump: session id: 2c905a06-6e7d-400e-8a03-5e0e20ea4583 xfsdump: session label: "new" xfsdump: ino map phase 1: constructing initial dump list xfsdump: ino map phase 2: skipping (no pruning necessary) xfsdump: ino map phase 3: skipping (only one dump stream) xfsdump: ino map construction complete xfsdump: estimated dump size: 20800 bytes xfsdump: positioned at media file 0: dump 0, stream 0 xfsdump: ERROR: media contains valid xfsdump but does not support append xfsdump: dump size (non-dir files) : 0 bytes xfsdump: NOTE: dump interrupted: 8 seconds elapsed: may resume later using -R option xfsdump: Dump Summary: xfsdump: stream 0 /media/ubuntu/SYSTEM/root.backup ERROR (operator error or resource exhaustion) xfsdump: Dump Status: INTERRUPT