fallocate -l 4G cripto
modprobe nbd
qemu-nbd -c /dev/nbd0 -f raw cripto
fdisk /dev/nbd0
Uma de 1G e outra com restante
cryptsetup luksFormat --type luks2 /dev/nbd0p1
ls -l /dev/mapper/
cryptsetup luksOpen /dev/nbd0p1 cripto1
ls -l /dev/mapper/
cryptsetup luksFormat --type luks2 /dev/nbd0p2
cryptsetup luksOpen /dev/nbd0p2 cripto2
apt install lvm2
vgcreate vg00 /dev/mapper/cripto1
vgdisplay
lvcreate -n raiz -L 500M vg00
lvcreate -n home -l 100%FREE vg00
pvs
lvs
vgs
mkfs.ext4 /dev/mapper/vg00-home
mkfs.ext4 /dev/mapper/vg00-raiz
lsblk
lvextend /dev/vg00/home /dev/mapper/cripto2
mount /dev/mapper/vg00-home /mnt/
df -h
resize2fs /dev/mapper/vg00-home
df -h
umount /mnt
vgchange -an vg00
vgdisplay
lsblk
cryptsetup close cripto2
cryptsetup close cripto1
lsblk
qemu-nbd -d /dev/nbd0
modprobe -r nbd