Resizing (or removing) Local-LVM
When installing Proxmox to an ext4 volume, the installer assigns the majority of your boot disk to "Local-LVM". This may not be desirable if you plan on using a secondary disk for VM storage, and would like to store more ISO images and backups in the root volume (known in Proxmox as "Local").
First, run lvdisplay (Logical Volume display) as root to check the current layout:
root@pve:~# lvdisplay
--- Logical volume ---
LV Path /dev/pve/swap
LV Name swap
VG Name pve
LV UUID DkDV6A-7iqo-70kO-i9Gx-d9qo-XaCu-VUCAYb
LV Write Access read/write
LV Creation host, time proxmox, 2021-03-13 22:40:36 +0000
LV Status available
# open 2
LV Size 8.00 GiB
Current LE 2048
Segments 1
Allocation inherit
Read ahead sectors auto
- currently set to 256
Block device 253:0
--- Logical volume ---
LV Path /dev/pve/root
LV Name root
VG Name pve
LV UUID pqcv3c-Csis-fBqQ-ARkb-3xzo-7xau-DaRzxT
LV Write Access read/write
LV Creation host, time proxmox, 2021-03-13 22:40:37 +0000
LV Status available
# open 1
LV Size 58.00 GiB
Current LE 14848
Segments 1
Allocation inherit
Read ahead sectors auto
- currently set to 256
Block device 253:1
--- Logical volume ---
LV Name data
VG Name pve
LV UUID tyoWtm-fyEr-PqRg-5Sn2-dcTq-tE69-qKHprl
LV Write Access read/write
LV Creation host, time proxmox, 2021-03-13 22:40:37 +0000
LV Pool metadata data_tmeta
LV Pool data data_tdata
LV Status available
# open 0
LV Size <147.38 GiB
Allocated pool data 0.00%
Allocated metadata 1.08%
Current LE 37728
Segments 1
Allocation inherit
Read ahead sectors auto
- currently set to 256
Block device 253:4
Based on the above output, we see that pve-data (local-lvm in the Proxmox GUI) is almost 3 times the size of the root volume. To resize this, you will first need to remove it. This will delete all contents of local-lvm, so please back up any virtual machines and remove them first so you don't lose anything!
root@pve:~# lvremove /dev/pve/data -y
Logical volume "data" successfully removed
Optional - If you still require a local-lvm partition (but want to give it less space) you can recreate it with the following command (in this example, 40G is specified to give it 40 Gibibytes).
root@pve:~# lvcreate -L 40G -n data pve -T
Thin pool volume with chunk size 64.00 KiB can address at most 15.81 TiB of data.
Logical volume "data" created.
The logical volume for root can then be resized to give it all available free space:
root@pve:~# lvresize -l +100%FREE /dev/pve/root
Size of logical volume pve/root changed from 58.00 GiB (14848 extents) to 224.38 GiB (57442 extents).
Logical volume pve/root successfully resized.
Once the logical volume has been resized, the ext4 partition must also be resized using resize2fs:
root@pve:~# 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 = 8, new_desc_blocks = 29
The filesystem on /dev/mapper/pve-root is now 58820608 (4k) blocks long.
Once resized, run lvdisplay again to verify the changes have taken effect.
root@pve:~# lvdisplay
--- Logical volume ---
LV Path /dev/pve/swap
LV Name swap
VG Name pve
LV UUID DkDV6A-7iqo-70kO-i9Gx-d9qo-XaCu-VUCAYb
LV Write Access read/write
LV Creation host, time proxmox, 2021-03-13 22:40:36 +0000
LV Status available
# open 2
LV Size 8.00 GiB
Current LE 2048
Segments 1
Allocation inherit
Read ahead sectors auto
- currently set to 256
Block device 253:0
--- Logical volume ---
LV Path /dev/pve/root
LV Name root
VG Name pve
LV UUID pqcv3c-Csis-fBqQ-ARkb-3xzo-7xau-DaRzxT
LV Write Access read/write
LV Creation host, time proxmox, 2021-03-13 22:40:37 +0000
LV Status available
# open 1
LV Size 224.38 GiB
Current LE 57442
Segments 1
Allocation inherit
Read ahead sectors auto
- currently set to 256
Block device 253:1
Then, log into the Proxmox GUI and go to Datacenter > Storage and remove the local-lvm entry:
No Comments