Proxmox PVE 删除local-lvm分区,将剩余空间扩容到根分区的方法

# 移除local-lvm

root@pve:~# lvremove pve/data
Do you really want to remove active logical volume pve/data? [y/n]: y
Logical volume "data" successfully removed.

# 查看空间

root@pve:~# vgdisplay pve | grep Free
Free PE / Size 207358 / 809.99 GiB

# 将卷组中的空闲空间扩展到根目录

root@pve:~# lvextend -l +100%FREE -f pve/root
Size of logical volume pve/root changed from 1.04 TiB (272863 extents) to 1.83 TiB (480221 extents).
Logical volume pve/root successfully resized.

# 查看

root@pve:~# fdisk -l
Disk /dev/nvme0n1: 931.51 GiB, 1000204886016 bytes, 1953525168 sectors
Disk model: Samsung SSD 980 PRO 1TB
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: 8079A4CA-03E9-4EC8-A89E-D00456E8FDE6

Device Start End Sectors Size Type
/dev/nvme0n1p1 34 2047 2014 1007K BIOS boot
/dev/nvme0n1p2 2048 2099199 2097152 1G EFI System
/dev/nvme0n1p3 2099200 1952448512 1950349313 930G Linux LVM

Disk /dev/nvme1n1: 953.87 GiB, 1024209543168 bytes, 2000409264 sectors
Disk model: Predator SSD GM7 M.2 1TB
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: dos
Disk identifier: 0x79d04f9e

Device Boot Start End Sectors Size Id Type
/dev/nvme1n1p1 2048 2000409263 2000407216 953.9G 83 Linux

Disk /dev/mapper/pve-swap: 8 GiB, 8589934592 bytes, 16777216 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 /dev/mapper/pve-root: 1.83 TiB, 2014192861184 bytes, 3933970432 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

# 刷新扩容分区

root@pve:~# resize2fs /dev/mapper/pve-root
resize2fs 1.47.2 (1-Jan-2025)
Filesystem at /dev/mapper/pve-root is mounted on /; on-line resizing required
old_desc_blocks = 134, new_desc_blocks = 235
The filesystem on /dev/mapper/pve-root is now 491746304 (4k) blocks long.

# 在 数据中心>存储> local-lvm,删除,所有的ISO 镜像, 容器模板, 备份都在根分区
注意:WARNING 根分区不能使用快照功能,只有LVM或LVM-THIN格式的分区才能使用快照功能

Proxmox PVE 删除local-lvm分区,将剩余空间扩容到根分区的方法
Proxmox PVE 删除local-lvm分区,将剩余空间扩容到根分区的方法

原创文章,作者:开心电脑网,如若转载,请注明出处。

(0)
上一篇 2025年11月1日
下一篇 2025年11月2日

相关推荐

发表回复

您的邮箱地址不会被公开。 必填项已用 * 标注