我想从 lvm2 卷组中回收一些空间来创建一个新的物理分区,以便安装第二个操作系统以实现双启动。我担心我所做的磁盘配置可能会让我陷入困境,如下所述。
如您所见,我的卷组中有超过 200GB 的未使用空间。
我想到的是按所示顺序进行的操作:
- 将物理卷 /dev/mapper/nvme0n1p3_crypt 缩小约 200 GB
- 将 cryptsetup 分区缩小约 200GB
- 将物理分区 /dev/nvme0n1p3 缩小约 200 GB
- 在剩余空间上为新操作系统创建新分区 /nvme0n1p4
有人有什么想法吗?
lsblk /dev/nvme0n1
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINTS
nvme0n1 259:0 0 931,5G 0 disk
├─nvme0n1p1 259:1 0 512M 0 part /boot/efi
├─nvme0n1p2 259:2 0 3,7G 0 part /boot
└─nvme0n1p3 259:3 0 927,3G 0 part
└─nvme0n1p3_crypt 253:0 0 927,3G 0 crypt
├─vgubuntu-root 253:1 0 672,8G 0 lvm /var/snap/firefox/common/host-hunspell
│ /
└─vgubuntu-swap_1 253:2 0 20G 0 lvm [SWAP]
-----
sudo gdisk -l /dev/nvme0n1
GPT fdisk (gdisk) version 1.0.8
Partition table scan:
MBR: protective
BSD: not present
APM: not present
GPT: present
Found valid GPT with protective MBR; using GPT.
Disk /dev/nvme0n1: 1953525168 sectors, 931.5 GiB
Model: Samsung SSD 970 EVO Plus 1TB
Sector size (logical/physical): 512/512 bytes
Disk identifier (GUID): E530359E-4120-494C-8BD0-601BDA6DE269
Partition table holds up to 128 entries
Main partition table begins at sector 2 and ends at sector 33
First usable sector is 34, last usable sector is 1953525134
Partitions will be aligned on 8-sector boundaries
Total free space is 2014 sectors (1007.0 KiB)
Number Start (sector) End (sector) Size Code Name
1 2048 1050623 512.0 MiB EF00 EFI System Partition
2 1050624 8885955 3.7 GiB 8300
3 8885956 1953525134 927.3 GiB 8300
-----
sudo cryptsetup status /dev/mapper/nvme0n1p3_crypt
/dev/mapper/nvme0n1p3_crypt is active and is in use.
type: LUKS2
cipher: aes-xts-plain64
keysize: 512 bits
key location: keyring
device: /dev/nvme0n1p3
sector size: 512
offset: 32768 sectors
size: 1944606411 sectors
mode: read/write
flags: discards
------
sudo pvs
PV VG Fmt Attr PSize PFree
/dev/mapper/nvme0n1p3_crypt vgubuntu lvm2 a-- <927,26g <234,42g
-----
sudo vgs
VG #PV #LV #SN Attr VSize VFree
vgubuntu 1 2 0 wz--n- <927,26g <234,42g
------
sudo lvs
LV VG Attr LSize Pool Origin Data% Meta% Move Log Cpy%Sync Convert
root vgubuntu -wi-ao---- <672,84g
swap_1 vgubuntu -wi-ao---- 20,00g
答案1
问题解决了。我使用了 Ubuntu 22.04,并安装了 KDE 分区管理器,它满足了我的所有要求。