[SOLVED] how to use "data" logical volume to store backups?

atman

Member
Apr 24, 2012
18
0
21
Italy
I have Proxmox 7.1-10

This is my disk configuration:
Code:
root@pve-mw:~# pvs
  PV         VG       Fmt  Attr PSize   PFree
  /dev/sdb   data-lvm lvm2 a--   <1.82t  1.51t
  /dev/sdc3  pve      lvm2 a--  446.12g 16.00g


root@pve-mw:~# vgs
  VG       #PV #LV #SN Attr   VSize   VFree
  data-lvm   1   5   0 wz--n-  <1.82t  1.51t
  pve        1   3   0 wz--n- 446.12g 16.00g


root@pve-mw:~# lvs
  LV            VG       Attr       LSize    Pool Origin Data%  Meta%  Move Log Cpy%Sync Convert
  vm-100-disk-0 data-lvm -wi-ao----   80.00g                                                   
  vm-110-disk-1 data-lvm -wi-ao----   32.00g                                                   
  (...)
  data          pve      twi-aotz-- <319.60g             0.00   0.52                           
  root          pve      -wi-ao----   96.00g                                                   
  swap          pve      -wi-ao----    8.00g

All the virtual machines are stored in data-lvm virtual group.
Backups are stored on a mounted disk not shown above.

The logical volume "data" is configured as "local-lvm" storage, but since I don't use it as vm container, I'd like to use it to store daily backups of one critical machine.

How can I do it?
 

atman

Member
Apr 24, 2012
18
0
21
Italy
I solved the problem this way:

Code:
root@pve-mw:~# lsblk
NAME                         MAJ:MIN RM   SIZE RO TYPE MOUNTPOINT
sda                            8:0    0   1.8T  0 disk
└─sda1                         8:1    0   1.8T  0 part /mnt/pve/backup
sdb                            8:16   0   1.8T  0 disk
├─data--lvm-vm--100--disk--0 253:4    0    80G  0 lvm
└─data--lvm-vm--130--disk--0 253:11   0   130G  0 lvm
sdc                            8:32   0 446.6G  0 disk
├─sdc1                         8:33   0  1007K  0 part
├─sdc2                         8:34   0   512M  0 part /boot/efi
└─sdc3                         8:35   0 446.1G  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   3.3G  0 lvm
  │ └─pve-data-tpool         253:6    0 319.6G  0 lvm
  │   └─pve-data             253:7    0 319.6G  1 lvm
  └─pve-data_tdata           253:3    0 319.6G  0 lvm
    └─pve-data-tpool         253:6    0 319.6G  0 lvm
      └─pve-data             253:7    0 319.6G  1 lvm
sr0                           11:0    1  1024M  0 rom

root@pve-mw:~# lvs
  LV            VG       Attr       LSize    Pool Origin Data%  Meta%  Move Log Cpy%Sync Convert
  vm-100-disk-0 data-lvm -wi-ao----   80.00g                                                  
  vm-130-disk-0 data-lvm -wi-ao----  130.00g                                                  
  data          pve      twi-aotz-- <319.60g             0.00   0.52                          
  root          pve      -wi-ao----   96.00g                                                  
  swap          pve      -wi-ao----    8.00g

Code:
root@pve-mw:~# lvremove /dev/pve/data
Do you really want to remove active logical volume pve/data? [y/n]: y
  Logical volume "data" successfully removed

Code:
root@pve-mw:~# lvs
  LV            VG       Attr       LSize   Pool Origin Data%  Meta%  Move Log Cpy%Sync Convert
  vm-100-disk-0 data-lvm -wi-ao----  80.00g                                                  
  vm-130-disk-0 data-lvm -wi-ao---- 130.00g                                                  
  root          pve      -wi-ao----  96.00g                                                  
  swap          pve      -wi-ao----   8.00g                                                  

root@pve-mw:~# lsblk
NAME                         MAJ:MIN RM   SIZE RO TYPE MOUNTPOINT
sda                            8:0    0   1.8T  0 disk
└─sda1                         8:1    0   1.8T  0 part /mnt/pve/backup
sdb                            8:16   0   1.8T  0 disk
├─data--lvm-vm--100--disk--0 253:4    0    80G  0 lvm
└─data--lvm-vm--130--disk--0 253:11   0   130G  0 lvm
sdc                            8:32   0 446.6G  0 disk
├─sdc1                         8:33   0  1007K  0 part
├─sdc2                         8:34   0   512M  0 part /boot/efi
└─sdc3                         8:35   0 446.1G  0 part
  ├─pve-swap                 253:0    0     8G  0 lvm  [SWAP]
  └─pve-root                 253:1    0    96G  0 lvm  /
sr0                           11:0    1  1024M  0 rom


Code:
root@pve-mw:~# lvcreate -L 300GB -n data pve
WARNING: dos signature detected on /dev/pve/data at offset 510. Wipe it? [y/n]: y
  Wiping dos signature on /dev/pve/data.
  Logical volume "data" created.

root@pve-mw:~# lsblk
NAME                         MAJ:MIN RM   SIZE RO TYPE MOUNTPOINT
sda                            8:0    0   1.8T  0 disk
└─sda1                         8:1    0   1.8T  0 part /mnt/pve/backup
sdb                            8:16   0   1.8T  0 disk
├─data--lvm-vm--100--disk--0 253:4    0    80G  0 lvm
└─data--lvm-vm--130--disk--0 253:11   0   130G  0 lvm
sdc                            8:32   0 446.6G  0 disk
├─sdc1                         8:33   0  1007K  0 part
├─sdc2                         8:34   0   512M  0 part /boot/efi
└─sdc3                         8:35   0 446.1G  0 part
  ├─pve-swap                 253:0    0     8G  0 lvm  [SWAP]
  ├─pve-root                 253:1    0    96G  0 lvm  /
  └─pve-data                 253:2    0   300G  0 lvm
sr0                           11:0    1  1024M  0 rom

root@pve-mw:~# lvs
  LV            VG       Attr       LSize   Pool Origin Data%  Meta%  Move Log Cpy%Sync Convert
  vm-100-disk-0 data-lvm -wi-ao----  80.00g                                                  
  vm-130-disk-0 data-lvm -wi-ao---- 130.00g                                                  
  data          pve      -wi-a----- 300.00g                                                  
  root          pve      -wi-ao----  96.00g                                                  
  swap          pve      -wi-ao----   8.00g


Code:
root@pve-mw:~# mkfs.ext4 /dev/pve/data
mke2fs 1.46.2 (28-Feb-2021)
Found a dos partition table in /dev/pve/data
Proceed anyway? (y,N) y
Creating filesystem with 78643200 4k blocks and 19660800 inodes
Filesystem UUID: 9604b5a0-1b61-4780-80bb-638660837470
Superblock backups stored on blocks:
        32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632, 2654208,
        4096000, 7962624, 11239424, 20480000, 23887872, 71663616

Allocating group tables: done                          
Writing inode tables: done                          
Creating journal (262144 blocks): done
Writing superblocks and filesystem accounting information: done

Code:
root@pve-mw:~# mkdir /mnt/pve/data

Code:
root@pve-mw:~# nano /etc/systemd/system/mnt-pve-backup2.mount

[Install]
WantedBy=multi-user.target

[Mount]
Options=defaults
Type=ext4
What=/dev/disk/by-uuid/9604b5a0-1b61-4780-80bb-638660837470
Where=/mnt/pve/backup2

[Unit]
Description=Mount storage 'backup2' under /mnt/pve

Code:
root@pve-mw:~# systemctl enable mnt-pve-backup2.mount
 
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 your own in 60 seconds.

Buy now!