Scheduling backups on local-lvm

Stefan-CPlanet

New Member
Apr 11, 2022
3
0
1
Hello,
yesterday I had a situation where local proxmox disk had services failing due to VM Backups filling up the local storage 100%. Since then I deleted all the backups to allow tor operations to continue, But I need to figure out how to schedule backups now on different storage.

Screenshot 2022-06-28 at 09.41.34.png
This is essentially what happened, the 100GB local got full. I need a way to schedule backups on local-lvm since it's quite empty.
Since the backups go into /var/lib/vz/dump my idea was to create a new partition and map it onto /var/lib/vz/dump, but since this is a critical server I wanted to ask for a procedure so that I do not mess something up.

System information:

df -h: ( / has since been cleaned)
Screenshot 2022-06-28 at 09.44.44.png

lsblk:
Screenshot 2022-06-28 at 09.44.57.png

Hopefully, someone can assist with the procedure?
Thanks
 
I think you should get a dedicated backup disk. Backups shouldn't be on the same disk as your guests as you will loose both your guests and backups in case that single disk fails. Storing backups on an LV on local-lvm will only help with the space problem but you will be without backups when you really need them.
 
I think you should get a dedicated backup disk. Backups shouldn't be on the same disk as your guests as you will loose both your guests and backups in case that single disk fails. Storing backups on an LV on local-lvm will only help with the space problem but you will be without backups when you really need them.
thank you, I do have a backup on the external NAS, but I need more often local backups so that images can be restored in case of issues in development.
 
Hi guys, I'm in exact same situation. Can somebody assist me with the exact commands to use local-lvm as backup destination?
I'm running my VMs on a ZFS on a separate disk (named 'datastore') and backing up on 'local' but it is getting full, while local-lvm is bigger, empty and unused.
I found this: https://forum.proxmox.com/threads/storing-backups-to-a-disk-in-local-lvm.40945/ but it's a quite old post and I don't want to mess up something.
Thank you very very much in advance.

root@trigolo:~# df -h
Filesystem Size Used Avail Use% Mounted on
udev 7.8G 0 7.8G 0% /dev
tmpfs 1.6G 908K 1.6G 1% /run
/dev/mapper/pve-root 94G 65G 26G 72% /
tmpfs 7.8G 46M 7.7G 1% /dev/shm
tmpfs 5.0M 0 5.0M 0% /run/lock
/dev/sda2 511M 328K 511M 1% /boot/efi
datastore 872G 128K 872G 1% /datastore
/dev/fuse 128M 16K 128M 1% /etc/pve
tmpfs 1.6G 0 1.6G 0% /run/user/0
root@trigolo:~# lsblk
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
sda 8:0 0 931.5G 0 disk
├─sda1 8:1 0 1007K 0 part
├─sda2 8:2 0 512M 0 part /boot/efi
└─sda3 8:3 0 931G 0 part
├─pve-swap 253:0 0 8G 0 lvm [SWAP]
├─pve-root 253:1 0 96G 0 lvm /
├─pve-data_tmeta 253:2 0 8.1G 0 lvm
│ └─pve-data 253:4 0 794.8G 0 lvm
└─pve-data_tdata 253:3 0 794.8G 0 lvm
└─pve-data 253:4 0 794.8G 0 lvm
sdb 8:16 0 931.5G 0 disk
├─sdb1 8:17 0 931.5G 0 part
└─sdb9 8:25 0 8M 0 part
zd0 230:0 0 64G 0 disk
├─zd0p1 230:1 0 50M 0 part
├─zd0p2 230:2 0 63.4G 0 part
└─zd0p3 230:3 0 521M 0 part

root@trigolo:~# vgs
VG #PV #LV #SN Attr VSize VFree
pve 1 3 0 wz--n- <931.01g 15.99g

root@trigolo:~# lvs
LV VG Attr LSize Pool Origin Data% Meta% Move Log Cpy%Sync Convert
data pve twi-a-tz-- <794.79g 0.00 0.24
root pve -wi-ao---- 96.00g
swap pve -wi-ao---- 8.00g
 
Last edited:
When you are not using "local-lvm" at all, I would delete that thin pool and use that space to extend your "local" with it.
But you should really consider getting a dedicated backup disk. Keep in mind that backups not only contain the virtual disks, they also contain the guests config file that is stored on your boot/system disk. So if you store your backups on the boot/system disk and then the system disk fails, you will lose your backups as well as the config files, so even when getting a new system disk and installing a fresh PVE you won't be able to use those VMs on the ZFS disk. And in case your system "local" storage runs out of space, the whole server will stop working.
 
Last edited:
I understand what you mean. I found how to delete the "local-lvm" from the GUI but I have no idea how to extend the "local" to use the whole space. From the GUI it seems not possible. Can you point me on the right direction?
Thank you for warning me about the security matter. I already simulated that scenario. It's enough to save a copy of the VMs config files or mark somewhere the VMs settings. Then if the system disk fails, replace the disk, reinstall ProxMox, import config files or re-create the VMs with the same settings, import the ZFS disk, and then replace the virtual disk files. I tested the procedure and it seems to work ;-)
 
I understand what you mean. I found how to delete the "local-lvm" from the GUI but I have no idea how to extend the "local" to use the whole space. From the GUI it seems not possible. Can you point me on the right direction?
Jup, you will have to do that with CLI. Something like this:
Code:
lvremove /dev/pve/data
lvresize -l +100%FREE /dev/pve/root
resize2fs /dev/mapper/pve-root
 
Last edited:
Ok, I'll try that on a test lab machine to check asap and let you know.
Thank you very much.
 

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!