Storing backups to a disk in local-lvm

Morgan

Member
Jan 25, 2018
7
1
6
Hello,

I would like to backup my VMs onto local-lvm because my local disk is very small compared to the lvm disk (4TB versus 128GB). I know this not immediately possible because lvm is not a file system on its own, so I think I need to create a virtual disk and mount it to the host / dom0. I do not know how to do any of these steps.

Can you provide some pointers or commands that would allow me to put backups/snapshots on the local-lvm disk?

Thank you,
Morgan
 
Hi,

can you please send some information about your disk, to give you a exact command.

Code:
lsblk
vgs
lvs
 
Here is the information. Looks like there is some information here about another disk in the system (sdb) running CentOS. Due to our lab requirements, that disk isn't available for proxmox at this time.

Also, looking at this information leads me to believe I could also just change the size of pve-root on the fly. Is this correct? Can I enter any size I want for pve-root, even if I don't currently have enough storage to meet that promise?

Code:
root@pve:~# lsblk
NAME                         MAJ:MIN RM  SIZE RO TYPE MOUNTPOINT
sda                            8:0    0  3.7T  0 disk
├─sda1                         8:1    0    1M  0 part
├─sda2                         8:2    0  256M  0 part /boot/efi
└─sda3                         8:3    0  3.7T  0 part
  ├─pve-swap                 253:3    0    8G  0 lvm  [SWAP]
  ├─pve-root                 253:4    0   96G  0 lvm  /
  ├─pve-data_tmeta           253:5    0  116M  0 lvm
  │ └─pve-data-tpool         253:7    0  3.5T  0 lvm
  │   ├─pve-data             253:8    0  3.5T  0 lvm
  │   ├─pve-vm--100--disk--1 253:9    0   64G  0 lvm
  │   └─pve-vm--101--disk--1 253:10   0  256G  0 lvm
  └─pve-data_tdata           253:6    0  3.5T  0 lvm
    └─pve-data-tpool         253:7    0  3.5T  0 lvm
      ├─pve-data             253:8    0  3.5T  0 lvm
      ├─pve-vm--100--disk--1 253:9    0   64G  0 lvm
      └─pve-vm--101--disk--1 253:10   0  256G  0 lvm
sdb                            8:16   0  3.7T  0 disk
├─sdb1                         8:17   0  200M  0 part
├─sdb2                         8:18   0    1G  0 part
└─sdb3                         8:19   0  3.7T  0 part
  ├─centos-swap              253:0    0 31.3G  0 lvm
  ├─centos-home              253:1    0  3.6T  0 lvm
  └─centos-root              253:2    0   50G  0 lvm
sr0                           11:0    1 1024M  0 rom

root@pve:~# vgs
  VG     #PV #LV #SN Attr   VSize VFree
  centos   1   3   0 wz--n- 3.64t  4.00m
  pve      1   5   0 wz--n- 3.64t 15.77g

root@pve:~# lvs
  LV            VG     Attr       LSize   Pool Origin Data%  Meta%  Move Log Cpy%Sync Convert
  home          centos -wi-a-----   3.56t
  root          centos -wi-a-----  50.00g
  swap          centos -wi-a-----  31.31g
  data          pve    twi-aotz--   3.52t             0.68   0.71
  root          pve    -wi-ao----  96.00g
  swap          pve    -wi-ao----   8.00g
  vm-100-disk-1 pve    Vwi-aotz--  64.00g data        27.64
  vm-101-disk-1 pve    Vwi-aotz-- 256.00g data        2.68
 
Last edited:
AFIK it is not possible to shrink a thinlvm.
You have no free space on this disk to extent the root.

You can make a new lv in the data lv and use this.

Code:
lvcreate -L <Size in GB>G -T pve -n <Name of LV>
mkfs.ext4 /dev/mapper/pve-<Name of LV>
mount /dev/mapper/pve-<Name of LV> /<mount path>

than add a new storage on the GUI type Dir
 
I am confused.

Your instructions seem to imply creating a new volume in pve ("sda3"), outside of pve-data. When I run the first command I get an error saying there is only ~15.77g free (it is given in extents, but I'm figuring that number based on vgs).

I think I should be trying to create a volume inside of pve-data. When I specify that using lvcreate I get an error:

lvcreate -L 512G pve/data -T -n AutomaticBackupsDisk
Ambiguous thin-pool name specified, AutomaticBackupsDisk and data.
Run `lvcreate --help' for more information.

Can you explain what is going on here?

I have found a workaround to my original objective. Taking snapshots manually stores the snapshot on the lvm disk. Why isn't this possible with the automatic backup function?
 
You must use the correct order of the commands (parameters).

A snapshot is no backup.
 

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!