proxmox ve (PVE) 增加 local 目录的大小即扩容方法 2024年笔记

proxmox ve (PVE) 增加 local 目录的大小即扩容

1T的SSD, proxmox 安装完后默认分配给了 local 目录100G,local-lvm 是900G

由于虚拟机备份文件VZDump默认是存储到local目录的,再加上上传的IOS镜像,100G很经常不够用,那怎么扩容增加空间呢?

首先 fdisk -l 命令,查看/dev/mapper/pve-root大小,下边这个是我的

fdisk -l

 

root@www:/var/lib/vz/dump# fdisk -l
Disk /dev/sda: 238.47 GiB, 256060514304 bytes, 500118192 sectors
Disk model: GJN 256G
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: 3610F4A9-2A54-4DD7-8B98-E3ADF9E2D5CA

Device Start End Sectors Size Type
/dev/sda1 34 2047 2014 1007K BIOS boot
/dev/sda2 2048 2099199 2097152 1G EFI System
/dev/sda3 2099200 500118158 498018959 237.5G Linux LVM


Disk /dev/sdb: 476.94 GiB, 512110190592 bytes, 1000215216 sectors
Disk model: DERLER SSD 512GB
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: 0x2a5c381b

Device Boot Start End Sectors Size Id Type
/dev/sdb1 2048 1000215215 1000213168 476.9G 83 Linux


Disk /dev/sdc: 447.13 GiB, 480103981056 bytes, 937703088 sectors
Disk model: Colorful SL500 4
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: 0xfef1589a

Device Boot Start End Sectors Size Id Type
/dev/sdc1 2048 937703087 937701040 447.1G 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: 84.37 GiB, 90592772096 bytes, 176939008 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-vm--100--disk--0: 20 GiB, 21474836480 bytes, 41943040 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 65536 bytes / 65536 bytes
root@www:/var/lib/vz/dump#

然后对 /dev/mapper/pve-root 扩容,命令如下,即增加10G的空间

lvextend -L +10G /dev/mapper/pve-root

 

root@xxx:/# lvextend -L +1G /dev/mapper/pve-root
Size of logical volume pve/root changed from 96.00 GiB (24576 extents) to 97.00 GiB (24832 extents).
Logical volume pve/root successfully resized.

执行后实际大小其实是还不会变化的,还需要下边的命令, 作用是执行上边的扩容操作

resize2fs /dev/mapper/pve-root

 

root@xxx:/# resize2fs /dev/mapper/pve-root
resize2fs 1.44.5 (15-Dec-2018)
Filesystem at /dev/mapper/pve-root is mounted on /; on-line resizing required
old_desc_blocks = 12, new_desc_blocks = 13
The filesystem on /dev/mapper/pve-root is now 25690112 (4k) blocks long.

 

以上操作结束,就可以在pve的web ui上看到空间的增加了

欢迎加入我们

欢迎加入我们!

如需搭建或二次开发,请加QQ群:

点击这里加入QQ群

或加入飞机群:

点击这里加入飞机群

© 版权声明
THE END
喜欢就支持一下吧
点赞5279 分享
评论 抢沙发

请登录后发表评论

    暂无评论内容