扩展 luks 加密分区

扩展 luks 加密分区

我在 VMWare 中运行 Ubuntu,并使用 luks 加密的根分区。我正在关注调整加密分区的大小(来自 help.ubuntu.com)并且卡在第 11 步。

ubuntu@ubuntu:~$ sudo lvresize -L +10G /dev/ubuntu-vg/root
Extending logical volume root to 25.74 GiB
Insufficient free space: 2560 extents needed, but only 4 available

fdisk -l显示物理驱动器上可用的额外空间,我只是不确定什么命令阻止我使用 lvresize。

ubuntu@ubuntu:~$ sudo fdisk -l

Disk /dev/sda: 32.2 GB, 32212254720 bytes
255 heads, 63 sectors/track, 3916 cylinders, total 62914560 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x000f36ef

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *        2048      499711      248832   83  Linux
/dev/sda2          501758    41940991    20719617    5  Extended
/dev/sda5          501760    41940991    20719616   83  Linux

Disk /dev/mapper/crypt1: 21.2 GB, 21214789632 bytes
255 heads, 63 sectors/track, 2579 cylinders, total 41435136 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00000000

Disk /dev/mapper/crypt1 doesn't contain a valid partition table

Disk /dev/mapper/ubuntu--vg-root: 16.9 GB, 16903045120 bytes
255 heads, 63 sectors/track, 2055 cylinders, total 33013760 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00000000

Disk /dev/mapper/ubuntu--vg-root doesn't contain a valid partition table

Disk /dev/mapper/ubuntu--vg-swap_1: 4290 MB, 4290772992 bytes
255 heads, 63 sectors/track, 521 cylinders, total 8380416 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00000000

Disk /dev/mapper/ubuntu--vg-swap_1 doesn't contain a valid partition table

有关我的物理卷的信息

lvm> pvdisplay --- Physical volume --- PV Name /dev/dm-0 VG Name ubuntu-vg PV Size 19.76 GiB / not usable 3.81 MiB Allocatable yes PE Size 4.00 MiB Total PE 5057 Free PE 4 Allocated PE 5053 PV UUID b6DksK-NYal-Wvai-0iUc-ku1J-PwZy-wWZtLB

答案1

用于pvdisplay查看在 LVM 中设置的物理卷上有多少可用空间。您可能需要先向其中添加空间。

pvdisplay显示哪些设备(例如 /dev/sda1 等)设置为由 LVM 管理。

vgdisplay显示由不同物理卷组成的卷组的信息。一个卷组可以跨越多个物理卷。

lvdisplay显示有关卷组中逻辑卷的信息。

要扩展逻辑卷,卷组中需要有可用空间/区段。要扩展卷组,卷组所在的物理卷上需要有空间。您可以添加物理卷并对其进行扩展。

相关内容