我有一个完整的驱动器映像2022-06-11_fedora.iso
,我正试图在另一台计算机上操作它的分区。(例如调整 LVM 逻辑卷的大小、移动 ESP 和扩展/boot
分区)。
解密 LUKS 分区后,我似乎无法挂载 LVM 卷。如何在解密它们所在的 LUKS 分区后挂载 LVM 卷,以便使用 LVM 命令套件操作卷?
图像内容的 fdisk
3个分区:
2022-06-11_fedora.iso1
是/boot
2022-06-11_fedora.iso2
是ESP2022-06-11_fedora.iso3
是 LUKS 上的 LVM
$ fdisk -l 2022-06-11_fedora.iso
Disk 2022-06-11_fedora.iso: 238.47 GiB, 256060514304 bytes, 500118192 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
Disklabel type: gpt
Disk identifier:
Device Start End Sectors Size Type
2022-06-11_fedora.iso1 2048 514047 512000 250M Linux filesystem
2022-06-11_fedora.iso2 514048 808959 294912 144M EFI System
2022-06-11_fedora.iso3 808960 500117503 499308544 238.1G Linux filesystem
解密第三个分区
$ sudo cryptsetup plainOpen --offset=808960 2022-06-11_fedora.iso cryptdisk
Enter passphrase for 2022-06-11_fedora.iso:
$ lsblk
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINTS
loop0 7:0 0 238.5G 0 loop
└─cryptdisk 253:2 0 238.1G 0 crypt
sda 8:0 0 1.8T 0 disk
└─sda1 8:1 0 1.8T 0 part
nvme0n1 259:0 0 1.8T 0 disk
├─nvme0n1p1 259:1 0 487M 0 part /boot/efi
├─nvme0n1p2 259:2 0 3.8G 0 part /recovery
└─nvme0n1p3 259:3 0 1.8T 0 part
└─cryptdata 253:0 0 1.8T 0 crypt
└─data-root 253:1 0 1.8T 0 lvm /
$ sudo fdisk -l /dev/mapper/cryptdisk
Disk /dev/mapper/cryptdisk: 238.09 GiB, 255646326784 bytes, 499309232 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
尝试挂载/dev/mapper/cryptdisk
$ sudo mount /dev/mapper/cryptdisk /mnt/crypt
mount: /mnt/crypt: wrong fs type, bad option, bad superblock on /dev/mapper/cryptdisk, missing codepage or helper program, or other error.
解密 LUKS 分区后如何挂载 LVM 卷?