How to resize /dev/pve/data without breaking Proxmox?

kunus

New Member
Oct 31, 2012
11
2
1
Hello,

I tried to reduce size of /dev/pve/data in order to have much free space to create logical volumes for VMs.

I did as below:
Code:
e2fsck -f /dev/pve/data
resize2fs /dev/pve/data 5G
lvreduce -L 5G /dev/pve/data

and now Proxmox can't boot because of some error related to: /dev/mapper/pve-data

How can I fix this please?

Really Thanks.
 
Yes sure,

It was just something I did wrong.

If you want to reduce /dev/pve/data to 10GB, the following will work without any problem:

Code:
umount /var/lib/vz
e2fsck -f /dev/pve/data
resize2fs /dev/pve/data 10G
lvreduce -L 10G /dev/pve/data
resize2fs /dev/pve/data
mount /dev/pve/data


Note: If you can't unmount /var/lib/vz, try this:
Code:
lsof | grep "/var/lib/vz"
kill -9 #pid_numbers

Now you have free space remaining to create more Logical Volumes.

When we create a VM on a Volume Group it stores data on the Logical Volume
Are these logical volumes directly used on VM to avoid the overhead of going through the filesystem layer on the host system?
If so, we definitely have a performance boost here, But in my storage I see created Logical Volumes as RAW Images. Is there anything I'm missing?

Thank you.
 
  • Like
Reactions: le_top and prxlife
...
When we create a VM on a Volume Group it stores data on the Logical Volume
Are these logical volumes directly used on VM to avoid the overhead of going through the filesystem layer on the host system?
If so, we definitely have a performance boost here, But in my storage I see created Logical Volumes as RAW Images. Is there anything I'm missing?

Thank you.

Hi,
this happens because the lvm-storage pve isn't defined in pve. It's use as directory in storage (only /var/lib/vz).
If you defined the lvm-storage pve it's should work to use this as storage for logical volumes - but remember that the normal configuration is choose with good reasons.
Don't fill the vg pve too much (your backups of local VMs will fail).

Udo
 
Really Thanks, I defined pve as Volume Group in storage and for every VM I create a new Logical Volume will be created too.

but what I see in defined storage is a Logical volume with RAW format. Is this correct? I mean is this a RAW image or Logical Volume?

Edit: Actually I want to make sure my VMs are using Logical Volume as Hard Disk because of performance boosts.
 
Last edited:
Really Thanks, I defined pve as Volume Group in storage and for every VM I create a new Logical Volume will be created too.

but what I see in defined storage is a Logical volume with RAW format. Is this correct? I mean is this a RAW image or Logical Volume?

Edit: Actually I want to make sure my VMs are using Logical Volume as Hard Disk because of performance boosts.
Hi,
if you select for an hdd an lvm-storage (which is enabled for storing images) the format (raw-format) is greyed out.

But the content is the same - an raw-file and a lv is an image of an harddisk.

Udo
 
@kunus Thanks for sharing, still helpful today on Proxmox 8:

```bash
resize2fs /dev/mapper/vg-data 100G
e2fsck -f /dev/mapper/vg-data
resize2fs /dev/mapper/vg-data 100G
lvreduce -L100G /dev/mapper/vg-data
resize2fs /dev/mapper/vg-data
mount /var/lib/vz
history
```

However, my ultimate goal was to reduce the partition size to add BTRFS - the partition did not change (of course...).
 
Last edited:

About

The Proxmox community has been around for many years and offers help and support for Proxmox VE, Proxmox Backup Server, and Proxmox Mail Gateway.
We think our community is one of the best thanks to people like you!

Get your subscription!

The Proxmox team works very hard to make sure you are running the best software and getting stable updates and security enhancements, as well as quick enterprise support. Tens of thousands of happy customers have a Proxmox subscription. Get yours easily in our online shop.

Buy now!