I want to decrease the size of an encrypted lvm partition, but 100% of the space is used. How do I figure out where the junk data is and resize the partition.
if theres no space in the volume group… you can add another another physical volume to grow the space… or you could get a larger physical volume to migrate all your LVs to, then reinstall the boot loader on the new physical drive.
No, its a 500GB drive with only 100GB used. LUKS writes junk data to the unused space as an added security feature, and I cannot figure out how to map it. Even after the LUKS is opened.
post the output from
vgs
lvs
dmsetup ls
df -h
lsblk
pop-os@pop-os:~$ sudo lsblk
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
loop0 7:0 0 2.1G 1 loop /rofs
sda 8:0 1 14.6G 0 disk
├─sda1 8:1 1 2.3G 0 part /cdrom
├─sda2 8:2 1 4M 0 part
└─sda3 8:3 1 12.3G 0 part /var/crash
nvme0n1 259:0 0 477G 0 disk
├─nvme0n1p1 259:1 0 498M 0 part
├─nvme0n1p2 259:2 0 4G 0 part
├─nvme0n1p3 259:3 0 468.5G 0 part
│ └─nvme0n1p3_crypt 253:0 0 468.4G 0 crypt
└─nvme0n1p4 259:4 0 4G 0 part
pop-os@pop-os:~$ sudo lvs
LV VG Attr LSize Pool Origin Data% Meta% Move Log Cpy%Sync Convert
root data -wi------- <468.43g
pop-os@pop-os:~$ sudo dmsetup ls
nvme0n1p3_crypt (253:0)
pop-os@pop-os:~$ sudo vgs
VG #PV #LV #SN Attr VSize VFree
data 1 1 0 wz--n- <468.43g 0
if all the space was allocated, i dont know if you can shrink a luks volume.
might have to recreate it.
pop-os@pop-os:~$ df -h
Filesystem Size Used Avail Use% Mounted on
udev 6.8G 0 6.8G 0% /dev
tmpfs 1.4G 9.9M 1.4G 1% /run
/dev/sda1 2.3G 2.3G 0 100% /cdrom
/dev/loop0 2.2G 2.2G 0 100% /rofs
/cow 6.9G 201M 6.7G 3% /
/dev/disk/by-label/writable 13G 47M 12G 1% /var/log
tmpfs 6.9G 0 6.9G 0% /dev/shm
tmpfs 5.0M 0 5.0M 0% /run/lock
tmpfs 6.9G 0 6.9G 0% /sys/fs/cgroup
tmpfs 6.9G 8.0K 6.9G 1% /tmp
tmpfs 1.4G 44K 1.4G 1% /run/user/999
Booted into OS
username@pop-os:~$ df -h
Filesystem Size Used Avail Use% Mounted on
udev 6.8G 0 6.8G 0% /dev
tmpfs 1.4G 2.1M 1.4G 1% /run
/dev/mapper/data-root 461G 74G 364G 17% /
tmpfs 6.9G 0 6.9G 0% /dev/shm
tmpfs 5.0M 0 5.0M 0% /run/lock
tmpfs 6.9G 0 6.9G 0% /sys/fs/cgroup
/dev/nvme0n1p1 498M 324M 174M 66% /boot/efi
/dev/nvme0n1p2 4.0G 2.3G 1.8G 57% /recovery
tmpfs 1.4G 16K 1.4G 1% /run/user/110
tmpfs 1.4G 28K 1.4G 1% /run/user/1000