Can't use local-lvm / lvm-thin for Backups?

s3bbo

Member
Oct 19, 2021
9
1
8
55
I recently bought a second small form factor and installed ProxmoxVE on it. I am using PVE on another SFF computer, too and hadn't much challenges to have it doing what i want it to do.

But it seems something has changed and I maybe overlooked some option during the installation. I am using Linux for a few years now but never really spent time gathering much experience with LVM, so maybe my problem stems from lack of knowledge about this.

So, I want to just have a copy of my three VMs main-disk images - so should i f*ck up some configuration, i can just restore the backup and be fine with it. I don't mind this being on the same disk. It seems to me this is working fine on my old PVE server, but i can't add "Backup" as a storage type for the system Disk (nvme) of my new server.

I have two disks in the SFF computer
- 4TB nVME - should contain the PVE system and all that is necessary
- 4TB SSD (sda) - this one is passed through as a block device to one of the VMs


Code:
root@luna:/# lsblk
NAME                         MAJ:MIN RM  SIZE RO TYPE MOUNTPOINTS
sda                            8:0    0  3.6T  0 disk
nvme0n1                      259:0    0  3.6T  0 disk
|-nvme0n1p1                  259:1    0 1007K  0 part
|-nvme0n1p2                  259:2    0    1G  0 part /boot/efi
`-nvme0n1p3                  259:3    0  3.6T  0 part
  |-pve-swap                 252:0    0    8G  0 lvm  [SWAP]
  |-pve-root                 252:1    0   96G  0 lvm  /
  |-pve-data_tmeta           252:2    0 15.9G  0 lvm 
  | `-pve-data-tpool         252:4    0  3.5T  0 lvm 
  |   |-pve-data             252:5    0  3.5T  1 lvm 
  |   |-pve-vm--200--disk--0 252:6    0   32G  0 lvm 
  |   |-pve-vm--100--disk--0 252:7    0   16G  0 lvm 
  |   |-pve-vm--100--disk--1 252:8    0  300G  0 lvm 
  |   `-pve-vm--300--disk--0 252:9    0  100G  0 lvm 
  `-pve-data_tdata           252:3    0  3.5T  0 lvm 
    `-pve-data-tpool         252:4    0  3.5T  0 lvm 
      |-pve-data             252:5    0  3.5T  1 lvm 
      |-pve-vm--200--disk--0 252:6    0   32G  0 lvm 
      |-pve-vm--100--disk--0 252:7    0   16G  0 lvm 
      |-pve-vm--100--disk--1 252:8    0  300G  0 lvm 
      `-pve-vm--300--disk--0 252:9    0  100G  0 lvm

So, the only place i can place backups in, is in the 96GB pve-root "partition" (or LVM thing)


Can i just mount the `pve-data-tpool` somehow? I am afraid to just try it and risking some data loss.

My Problem is basically, I cant - via the WEBGUI - assign "Backup" to the volume that has 95% space (`local-lvm`) - But i can in my old Proxmox VE.

Is there some trick?

TIA for any hints!
 
Backup requires "FILE" storage. That means there should be a file system where to place the files.
Local-lvm is BLOCK storage.

You can create a manual LVM slice (LV) from your "local-lvm", format it with your favorite file system, mount it, and point PVE to the mount as a "directory storage pool" (use is_mountpoint=yes).

Good luck


Blockbridge : Ultra low latency all-NVME shared storage for Proxmox - https://www.blockbridge.com/proxmox
 
Thanks for your Reply.

So my understanding is that i have a Volume Group (VG) `pve` and a logical volume (LV) `data` making it pve-data.

In the `datacenter -> node -> disks -> lvm ` view, i can only see this one LV and it seems to allocate everything thats left of the disk? (filling it to 100%)

I can't find an option to add a "slice".

When you write "manual", do you mean to do it via commandline?

Would this mean i need to resize the existing data LV to have some space?

Code:
root@luna:/# lvm lvs
  LV            VG  Attr       LSize   Pool Origin Data%  Meta%  Move Log Cpy%Sync Convert
  data          pve twi-aotz--  <3.49t             11.08  0.87                          
  root          pve -wi-ao----  96.00g                                                  
  swap          pve -wi-ao----   8.00g                                                  
  vm-100-disk-0 pve Vwi-aotz--  16.00g data        53.40                                
  vm-100-disk-1 pve Vwi-aotz-- 300.00g data        100.00                                
  vm-200-disk-0 pve Vwi-aotz--  32.00g data        28.86                                
  vm-300-disk-0 pve Vwi-aotz-- 100.00g data        78.01          
                     
root@luna:/# lvm vgs
  VG  #PV #LV #SN Attr   VSize  VFree
  pve   1   7   0 wz--n- <3.64t <16.25g


I wondered whether i could just mount `|-pve-data 252:5 0 3.5T 1 lvm` (see lsblk output in previous post).

It seems not to be mounted, to me?

Code:
root@luna:/dev/mapper# ls -al
total 0
drwxr-xr-x  2 root root     260 Jan 11 16:59 .
drwxr-xr-x 19 root root    4480 Jan 11 16:59 ..
crw-------  1 root root 10, 236 Jan 11 16:59 control
lrwxrwxrwx  1 root root       7 Jan 11 16:59 pve-data -> ../dm-5
lrwxrwxrwx  1 root root       7 Jan 11 16:59 pve-data-tpool -> ../dm-4
lrwxrwxrwx  1 root root       7 Jan 11 16:59 pve-data_tdata -> ../dm-3
lrwxrwxrwx  1 root root       7 Jan 11 16:59 pve-data_tmeta -> ../dm-2
lrwxrwxrwx  1 root root       7 Jan 11 16:59 pve-root -> ../dm-1
lrwxrwxrwx  1 root root       7 Jan 11 16:59 pve-swap -> ../dm-0
lrwxrwxrwx  1 root root       7 Jan 11 16:59 pve-vm--100--disk--0 -> ../dm-7
lrwxrwxrwx  1 root root       7 Jan 11 16:59 pve-vm--100--disk--1 -> ../dm-8
lrwxrwxrwx  1 root root       7 Jan 11 16:59 pve-vm--200--disk--0 -> ../dm-6
lrwxrwxrwx  1 root root       7 Jan 11 16:59 pve-vm--300--disk--0 -> ../dm-9

I just tried and just mounting did not work, probably for obvious reasons, but as i said, i am not too familiar with lvm :-/

Code:
root@luna:~# mkdir pve-data
root@luna:~# mount /dev/mapper/pve-data /pve-data/
mount: /pve-data: wrong fs type, bad option, bad superblock on /dev/mapper/pve-data, missing codepage or helper program, or other error.
       dmesg(1) may have more information after failed mount system call.

I asked AI what to do and it told me to run something like this

Code:
To add an LVM slice and mount it in Proxmox, follow these steps:

    Create a new logical volume (LV) in your existing volume group:


lvcreate -L <size> -n <lv_name> <vg_name>

So i wanted to have 1TB for backup...

Code:
root@luna:~# lvcreate -L 1T -n backupstore pve
  Volume group "pve" has insufficient free space (4159 extents): 262144 required.



So if you would point me to how i add this "slice" to the lvm, I'd appreciate this very much.

I'm a little afraid if i just start resizing volumes or logical volumes i'll overwrite something by accident.

TIA
 
Last edited:
Try "lvreduce -L 2000G pve/data" which sets an *absolut* new size !!
After that you can do "lvcreate -L 1T -n backupstore pve".
Take a look at "pvs, lvs, lvdisplay" as you have some further blocks free which can be later used where it's needed.
After that create a filesystem on your new backupstore and mount it by fstab entry.
At last you can add it as directory in datacenter with your usage contents as wanted.
 
Last edited:
I would just setup Proxmox Backup Server in a VM and dedicate XGB of storage to it, leaving some space free (I would say at least 10-20GB) on the host. That is, if this is going to be the dedicated Backup server. You need enough space for PBS to do several versions of backup + dedup.

You can make the vm's root/boot disk ~8GB for PBS itself and give it a 2nd in-vm ext4 or XFS vdisk for datastore. Or if you're using LVM-thin for backing storage, create a single-disk ZFS pool in-vm. XFS is likely going to be the fastest option, but ZFS has features such as fast inline compression and snapshots.