LVM
1
Вклад в тег
cryptsetup luksOpen /dev/sda3 crypt-volume
parted /dev/sda
p
resizepart 1
yes
p
quit
vgchange -a n ubuntu-vg
cryptsetup luksClose crypt-volume
cryptsetup luksOpen /dev/sda3 crypt-volume
cryptsetup resize crypt-volume
vgchange -a y ubuntu-vg
aaa@bbb:~$ sudo pvdisplay
--- Physical volume ---
PV Name /dev/mapper/dm_crypt-0
VG Name ubuntu-vg
PV Size <299.93 GiB / not usable 2.00 MiB
aaa@bbb:~$ sudo pvresize /dev/mapper/dm_crypt-0
Physical volume "/dev/mapper/dm_crypt-0" changed
1 physical volume(s) resized or updated / 0 physical volume(s) not resized
aaa@bbb:~$ sudo pvdisplay -m
--- Physical volume ---
PV Name /dev/mapper/dm_crypt-0
VG Name ubuntu-vg
PV Size <498.91 GiB / not usable 3.00 MiB
--- Physical Segments ---
Logical volume /dev/ubuntu-vg/ubuntu-lv
aaa@bbb:~$ sudo lvresize -l +100%FREE /dev/mapper/ubuntu--vg-ubuntu--lv
Size of logical volume ubuntu-vg/ubuntu-lv changed from <299.93 GiB (76781 extents) to <498.91 GiB (127720 extents).
Logical volume ubuntu-vg/ubuntu-lv successfully resized.
aaa@bbb:~$ sudo resize2fs /dev/mapper/ubuntu--vg-ubuntu--lv
resize2fs 1.45.5 (07-Jan-2020)
Filesystem at /dev/mapper/ubuntu--vg-ubuntu--lv is mounted on /; on-line resizing required
old_desc_blocks = 38, new_desc_blocks = 63
The filesystem on /dev/mapper/ubuntu--vg-ubuntu--lv is now 130785280 (4k) blocks long.
aaa@bbb:~$ sudo df -h
Filesystem Size Used Avail Use% Mounted on
/dev/mapper/ubuntu--vg-ubuntu--lv <b>491G</b> 125G 344G 27% /
sudo lvresize -l +100%FREE /dev/mapper/ubuntu--vg-ubuntu--lv
sudo resize2fs /dev/mapper/ubuntu--vg-ubuntu--lv