BACKUP error code 5 on a NAS device

raid

Member
Jul 25, 2010
102
0
16
Italy
Hi everyone,
I have the following error on VM Backup:


Detailed backup logs:

vzdump --quiet --snapshot --compress --storage ProxMox-BK --mailto webmaster@xxxx.net --all
101: Dec 25 02:00:02 INFO: Starting Backup of VM 101 (openvz)
101: Dec 25 02:00:02 INFO: CTID 101 exist mounted running
101: Dec 25 02:00:02 INFO: status = CTID 101 exist mounted running
101: Dec 25 02:00:02 INFO: backup mode: snapshot
101: Dec 25 02:00:02 INFO: ionice priority: 7101: Dec 25 02:00:02 INFO: creating lvm snapshot of /dev/mapper/pve-data ('/dev/pve/vzsnap-ns.raidnet.info-0')
101: Dec 25 02:00:02 INFO: Insufficient free extents (0) in volume group pve: 256 required
101: Dec 25 02:00:02 ERROR: Backup of VM 101 failed - command 'lvcreate --size 1024M --snapshot --name vzsnap-ns.xxxx.ext-0 /dev/pve/data' failed with exit code 5

102: Dec 25 02:00:02 INFO: Starting Backup of VM 102 (openvz)
102: Dec 25 02:00:02 INFO: CTID 102 exist mounted running
102: Dec 25 02:00:02 INFO: status = CTID 102 exist mounted running
102: Dec 25 02:00:02 INFO: backup mode: snapshot
102: Dec 25 02:00:02 INFO: ionice priority: 7102: Dec 25 02:00:02 INFO: creating lvm snapshot of /dev/mapper/pve-data ('/dev/pve/vzsnap-ns.raidnet.info-0')
102: Dec 25 02:00:02 INFO: Insufficient free extents (0) in volume group pve: 256 required
102: Dec 25 02:00:02 ERROR: Backup of VM 102 failed - command 'lvcreate --size 1024M --snapshot --name vzsnap-ns.xxxxxx.ext-0 /dev/pve/data' failed with exit code 5[/HTML]


Scenario:
2 OpenVz VM
2 HD RAID > 1TB
1 NAS RAID 1 > 100 GB (Backup)
# pvdisplay
--- Physical volume ---
PV Name /dev/sda2
VG Name pve
PV Size 921.01 GB / not usable 4.00 MB
Allocatable yes (but full)
PE Size (KByte) 4096
Total PE 235777
Free PE 0
Allocated PE 235777
PV UUID
-------------------------
I installed the NAS (OVH MINI NAS 100) from ProxMox panel.
this is the mount used:
mount -t nfs 10.16.101.6:/nas-000127/mininas-000145 /BACKUP/
--------------------------------------
this is the etc/fstab file :
/dev/sda1 / ext3 errors=remount-ro 0 1
/dev/pve/data /var/lib/vz ext3 defaults 0 2
/dev/sda3 none swap defaults 0 0
proc /proc proc defaults 0 0
sysfs /sys sysfs defaults 0 0
10.16.101.6:/nas-000127/mininas-000145 /BACKUP nfs default 0 0
=======================================================
Note: The NAS not mounted after reboot
------------------------
any tips?
thanks
luc
 
Last edited:
Re: BACKUP error code 5 on a NAS device (OVH partitioning)

I found the following note on the OVH forum.
Is this the correct and only guidelines to solve the problem?
Is there any way to solve the problem without stopping the VMs other than using a second cluster?
thanks in advance for help

--------------
From http://forum.ovh.co.uk/showthread.php?t=3965

Note that taking a live snapshot backup will fail due to the default LVM partitioning by OVH (do'h!). You need to have a minimum of 1 GB free on a VG, which means shrinking the existing LV to make room. If live snapshots is not an issue, then obviously this can be ignored.

Re: Backups on Proxmox.
PS: Re the minimum 1G live backup space, this needs to be unallocated space (free PE). So with the command vgdisplay, you should see something like:

Code:
--- Volume group ---
VG Name pve
System ID
Format lvm2...
Free PE / Size 4096 / 16.00 GB
(obviously in this case its 16G of unallocated space)

Here's a rough guideline, in case you've used OVH's default partitioning for Proxmox (and so, this assumes /var/lib/vz lives on LV /dev/pve/lv1;
backup everything and double-check values/parameters before you try):

- Stop all VMs
- Unmount /var/lib/vz
- Check filesystem:
# e2fsck -f /dev/pve/lv1
Code:
e2fsck 1.41.3 (12-Oct-2008)
Pass 1: Checking inodes, blocks, and sizesPass
2: Checking directory structurePass
3: Checking directory connectivityPass
4: Checking reference countsPass
5: Checking group summary information/var/lib/vz: 435304/44310528 files (0.3% non-contiguous), 13406402/177234944 blocks

- Resize filesystem on LV /dev/pve/lv1 to 660 GBytes (change accordingly, this will determine the size of the unallocated PE):
# resize2fs -p /dev/pve/lv1 660G
Code:
resize2fs 1.41.3 (12-Oct-2008)Resizing the filesystem on /dev/pve/lv1 to 173015040 (4k) blocks.
Begin pass 3 (max = 5409)
Scanning inode table XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
The filesystem on /dev/pve/lv1 is now 173015040 blocks long.
- Check "PE Size":
# vgdisplay
Code:
--- Volume group ---
VG Name pve
System ID
Format lvm2...
PE Size 4.00 MB

- Reduce size of LV to at MINIMUM size of filesystem + 1x PE Size (so 1G filesystem + 1x 4.00 MB as above = 1.04G).
In this example, I chose 660.10G:

# lvreduce -L660.10G /dev/pve/lv1
Code:
Rounding up size to full physical extent 660.10 GB
WARNING: Reducing active logical volume to 660.10 GB THIS MAY DESTROY YOUR DATA (filesystem etc.)
Do you really want to reduce lv1? [y/n]: y
Reducing logical volume lv1 to 660.10 GB
Logical volume lv1 successfully resized

- Verify filesystem to make sure you didn't botch it:
# e2fsck -f /dev/pve/lv1

- Remount:
# mount -a

And you're back in business by starting the VMs.
 
Re: BACKUP error code 5 on a NAS device (OVH partitioning)

Simply increase the snapshot size. By default, vzdump uses 1024MB. You can set that in the global vzdump configuration file /etc/vzdump.conf (you need to create that file if it does not exists). Simply add a line like:

Code:
size: 2048

- Dietmar
 
Re: BACKUP error code 5 on a NAS device (OVH partitioning)

Simply increase the snapshot size. By default, vzdump uses 1024MB. You can set that in the global vzdump configuration file /etc/vzdump.conf (you need to create that file if it does not exists). Simply add a line like:......
Done, but the error is still there...
101 m1.xxxxx.ext FAILED 00:00:00 command 'lvcreate --size 2048M --snapshot --name vzsnap-ns.xxxxxx.info-0 /dev/pve/data' failed with exit code 5
 
Last edited:
Re: BACKUP error code 5 on a NAS device (OVH partitioning)

Ah, I see. You do not have any free space in the volume group (this is no standard installation).

So you need to resize your existing volumes or add some space otherwise.
 
Re: BACKUP error code 5 on a NAS device (OVH partitioning)

This is my OVH standard ProxMox configuration, I'm not sure but something looks strange here, what do you think about?


root@ns:~# fdisk -l
Disk /dev/sda: 1000.2 GB, 1000203837440 bytes
255 heads, 63 sectors/track, 121601 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0x00094a71
Device Boot Start End Blocks Id System
/dev/sda1 * 1 1306 10485760+ 83 Linux
/dev/sda2 1306 121536 965746688 8e Linux LVM
/dev/sda3 121536 121601 525312 82 Linux swap / Solaris
Disk /dev/dm-0: 988.9 GB, 988920414208 bytes
255 heads, 63 sectors/track, 120229 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0x00000000
Disk /dev/dm-0 doesn't contain a valid partition table
---------------------------------------------------------
root@ns:~# mount
/dev/sda1 on / type ext3 (rw,errors=remount-ro)
tmpfs on /lib/init/rw type tmpfs (rw,nosuid,mode=0755)
proc on /proc type proc (rw,noexec,nosuid,nodev)
sysfs on /sys type sysfs (rw,noexec,nosuid,nodev)
procbususb on /proc/bus/usb type usbfs (rw)
udev on /dev type tmpfs (rw,mode=0755)
tmpfs on /dev/shm type tmpfs (rw,nosuid,nodev)
devpts on /dev/pts type devpts (rw,noexec,nosuid,gid=5,mode=620)
/dev/mapper/pve-data on /var/lib/vz type ext3 (rw)
10.16.101.6:/nas-000127/mininas-000145/ on /mnt/pve/ProxMox-BK type nfs (rw,addr=10.16.101.6)
10.16.101.6:/nas-000127/mininas-000145 on /BACKUP type nfs (rw,addr=10.16.101.6)
-------------------------------------------------------------------------
root@ns:~# lvdisplay
--- Logical volume ---
LV Name /dev/pve/data
VG Name pve
LV UUID PlVEzN-J7qM-uIIo-rug0-5MFp-IY0c-bHdP05
LV Write Access read/write
LV Status available
# open 1
LV Size 921.00 GB
Current LE 235777
Segments 1
Allocation inherit
Read ahead sectors auto
- currently set to 256
Block device 254:0
-----------------------------------------------------------
root@ns:~# vgdisplay
--- Volume group ---
VG Name pve
System ID
Format lvm2
Metadata Areas 1
Metadata Sequence No 2
VG Access read/write
VG Status resizable
MAX LV 0
Cur LV 1
Open LV 1
Max PV 0
Cur PV 1
Act PV 1
VG Size 921.00 GB
PE Size 4.00 MB
Total PE 235777
Alloc PE / Size 235777 / 921.00 GB
Free PE / Size 0 / 0
VG UUID dbByVK-e5ZD-t1TS-j4hk-4UxV-qlHK-9ArUMB
-------------------------------------------------------
root@ns:~# df -kh
Filesystem Size Used Avail Use% Mounted on
/dev/sda1 10G 2.1G 7.4G 23% /
tmpfs 4.0G 0 4.0G 0% /lib/init/rw
udev 10M 552K 9.5M 6% /dev
tmpfs 4.0G 0 4.0G 0% /dev/shm
/dev/mapper/pve-data 914G 11G 857G 2% /var/lib/vz
10.16.101.6:/nas-000127/mininas-000145/
100G 11G 90G 11% /mnt/pve/ProxMox-BK
10.16.101.6:/nas-000127/mininas-000145
100G 11G 90G 11% /BACKUP
root@ns:~#
================================================
etc/fstab:
/dev/sda1 / ext3 errors=remount-ro 0 1
/dev/pve/data /var/lib/vz ext3 defaults 0 2
/dev/sda3 none swap defaults 0 0
proc /proc proc defaults 0 0
sysfs /sys sysfs defaults 0 0
10.16.101.6:/nas-000127/mininas-000145 /BACKUP nfs default 0 0
======================================================
 
Re: BACKUP error code 5 on a NAS device (OVH partitioning)

Hi Dietmar,
Please, could you tell me if the above procedure is correct?
It is still not clear to me where I set the amount of "free space".
Thanks
Luc
 
Re: BACKUP error code 5 on a NAS device (OVH partitioning)

Thanks for the tip, so the following would be the right procedure in my case:






Target : having enough FREE PE space (says 100GB) to execute vzdump snapshot on my 1TB HD in RAID1 HW (actual VG size=921.0 GB)
  1. - BACKUP, BACKUP, BACKUP ;) and Stop all VMs
  2. # Unmount /var/lib/vz
  3. # e2fsck -f /dev/mapper/pve-data
  4. # resize2fs -p /dev/mapper/pve-data 821G -> (this will determine the size of the unallocated PE)
  5. # lvreduce –L821.10G /dev/mapper/pve-data -> (Reduce size of LV to at MINIMUM size of filesystem + 1x PE Size (so 1G filesystem + 1x 4.00 MB as above = 1.04G).
  6. # e2fsck -f /dev/mapper/pve-data
  7. # mount -a
  8. - start all VM

    ----------------------
That's all.... :cool:
 
Last edited:
Re: BACKUP error code 5 on a NAS device (OVH partitioning)

Target : having enough FREE PE space (says 100GB) to execute vzdump snapshot

LVM snapshots only save differences, so I doubt you really need 100GB (Proxmox VE installer reserves just 4GB, and vzdump just use 1GB by default).
 

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!