Extend local directory size

user789

New Member
Mar 1, 2020
12
1
1
34
Hi,

On my Proxmox server I have a directory which is called "local". This directory has a size of 94GB. I also have a LVM-Thin which is called "local-lvm". This partition has a size of 349GB. The problem is that both of these "volumes" are on the same SSD. I have two VM's which run on the "local-lvm", this only takes up 32GB of disk space. Proxmox only allows me to store my back-ups on my "local" directory, but this directory is actually to small for this.

I was wonder how I could extend and/or shrink these volumes. (See images attached for more details)

Thanks in advance!
 

Attachments

  • Screenshot from 2020-03-16 11-20-09.png
    Screenshot from 2020-03-16 11-20-09.png
    49.2 KB · Views: 238
  • Screenshot from 2020-03-16 11-19-38.png
    Screenshot from 2020-03-16 11-19-38.png
    26.1 KB · Views: 227
I guess this is a default installation, so you'll probably have a lvm with a volume group called pve, a lvs named root and none named data. Depending on your setup increasing the size could be as easy as adding a second disk to the lvm or if you don't have one you could resize your data pool and add the gain to root.
 
Hi,

Thank you for your reply. Yes this is a default installation. I'm not sure what you mean by adding a second disk to the lvm. I've added two screenshots to make it more clear. I would like to shrink the LVM-thin and extend the directory.

Thanks!
 

Attachments

  • Screenshot from 2020-03-17 08-50-42.png
    Screenshot from 2020-03-17 08-50-42.png
    16.6 KB · Views: 197
  • Screenshot from 2020-03-17 08-50-29.png
    Screenshot from 2020-03-17 08-50-29.png
    17.7 KB · Views: 186
You should read our admin guide: https://pve.proxmox.com/pve-docs/pve-admin-guide.html#chapter_lvm
The directory is located on the LV root file system. Make a backup of your VMs and reduce your data LV, then increase your root LV.
One and a half years later and the same issue popped up here. You really gotta love helpful answers like "read the f*ing manual", and nothing else. Is this the level of help we can expect?

Would it hurt to describe HOW you would go about decreasing 'data' and increasing root? The manual page linked is endless.

And it's even worse - if you happen to fill it with too large an upload, say a virtual you wanted to import - you're locked out from shell. You can't delete the file, nor access the shell, unless you have physical access to console. Marvellous design.
 
Last edited:
One and a half years later and the same issue popped up here. You really gotta love helpful answers like "read the f*ing manual", and nothing else. Is this the level of help we can expect?

Would it hurt to describe HOW you would go about decreasing 'data' and increasing root? The manual page linked is endless.

And it's even worse - if you happen to fill it with too large an upload, say a virtual you wanted to import - you're locked out from shell. You can't delete the file, nor access the shell, unless you have physical access to console. Marvellous design.
I am in this boat. I install Proxmox on a 32gb sd card and now "Local" is maxed out. How do I either expand the drive or delete the data?

1654888601532.png
 
First shouldn't PVE be installed on an SD card if you don't want to loose your installation after a coupple of months because of a dying card. Always use real HDDs or SSDs and no SD cards or USB pen drives.
Second, you shouldn`t store your backups on the same drive that also stores the data you want to backup, so you don't loose both at the same time when the drive fails. So storing backups on "local" is a bad idea if there is no dedicated physical disk for storing guests.
 
I think you're missing the point. It's not about backups, though your comments are correct. I was simply pointing out that any backups that were stored there could be deleted.

Also, while I'm not sure about the OP, mine is on a HDD and not an SD.

The point of the thread is how to extend the local storage.
 
Jup, but you quoted...
I am in this boat. I install Proxmox on a 32gb sd card and now "Local" is maxed out. How do I either expand the drive or delete the data
...which is badly done in general. No need to resize local if you anyway have to install a fresh PVE because you installed it to a SD card, which is a no go.

The problem with extending a "local" on LVM is that your VG needs unallocated space. Usually there is not much space left because "local-lvm" will use most of it. But "local-lvm" is a LVM-Thin pool used to store your guests and a LVM-Thin can't be shrinked to get more unalloated space on that VG to then extend the LV "local" is stored on. You would then need to backup all guests to a NAS or another disk, remove the "local-lvm" storage, destroy that LVM-Thin pool, extend the LV ("lvextend" command) that stores "local", create a new but smaller LV for a new LVM-Thin pool, convert that LV to a LVM-Thin pool, add that LVM-Thin pool as a LVM-Thin storage in PVE, restore your backups to the new LVM-Thin storage. And that all is done using the CLI.

So in short: Its most of the time easier to just wipe your PVE installation, start from scratch and then install it with custom sizes for "local" and "local-lvm" (see the paragraph "Advanced LVM Configuration Options" in the wiki: https://pve.proxmox.com/wiki/Installation).
 
Last edited:
I've found a way that worked for me. My system is 3 drives. SDA is the boot drive and SDB/SDC are ZFS drives. This is what I did for SDA that allowed me to expand the storage:

lvremove /dev/pve/data ("data" didn't exist on my system)
lvresize -l +100%FREE /dev/pve/root
resize2fs /dev/mapper/pve-root
 
Last edited:
I've found a way that worked for me. My system is 3 drives. SDA is the boot drive and SDB/SDC are ZFS drives. This is what I did for SDA that allowed me to expand the storage:

lvremove /dev/pve/data ("data" didn't exist on my system)
lvresize -l +100%FREE /dev/pve/root
resize2fs /dev/mapper/pve-root

Thank you!
After a new install Proxmox split my SSD (Install Drive) ~50/50. But i had a NVME for VM Disks. Because there was nothing on the local-lvm I just wiped it in the web interface.
After that i used your last two commands and had my whole "normal" SSD as ISO and Backup Savespace.
THANKS!
 
I've found a way that worked for me. My system is 3 drives. SDA is the boot drive and SDB/SDC are ZFS drives. This is what I did for SDA that allowed me to expand the storage:

lvremove /dev/pve/data ("data" didn't exist on my system)
lvresize -l +100%FREE /dev/pve/root
resize2fs /dev/mapper/pve-root
necro'ing this thread to add on my thanks to WiFiNetGuy and the others who've added their input.

i'd installed PVE 8.2 on an Optiplex Micro, with a 240GB SATA SSD and a 480GB NVME SSD. the PVE installer split my SATA SSD into a ~68GB partition (called "local"), and a ~140GB partition (called "local-lvm"). it's very, very unobvious from the PVE web UI how to resolve this and, as iptrix mentioned, the documentation is miles long and not organized in a way that's easy to read.

running the commands posted by WiFiNetGuy helped me reallocate my 240GB SATA SSD to be used for ISO, CT template, snapshot, etc., storage, so that i can allocate my entire NVME drive for VM/CT disks.

as more and more people begin trialling or migrating to PVE from vSphere, i hope that support and user-friendliness become more of a priority for this project.
 

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!