restore lxc issue: Cannot write: Disk quota exceeded

RobFantini

Famous Member
May 24, 2012
2,083
116
133
Boston,Mass
Hello,

I'm have an issue trying to restore an lxc.
Code:
extracting archive '/mnt/pve/nfs-pve/dump/vzdump-lxc-3117-2015_10_31-14_11_22.tar.lzo'
tar: ./rsnapshot/weekly.0/localhost/fbc/linux-server/system-reports/00-sys-reports-sys5/sys5-zdb-C-report: Cannot write: Disk quota exceeded
tar: ./rsnapshot/weekly.0/localhost/fbc/linux-server/system-reports/00-sys-reports-sys5/sys5-zdb-C-report: Cannot change mode to rw-r--r--: Disk quota exceeded
tar: ./rsnapshot/weekly.0/localhost/fbc/linux-server/system-reports/00-sys-reports-sys5: Cannot change mode to rwxr-xr-x: Disk quota exceeded
..
ar: ./lib64: Cannot mkdir: Disk quota exceeded
tar: ./lib64/ld-linux-x86-64.so.2: Cannot open: No such file or directory
tar: ./root/obnam-mount: Cannot create symlink to '/fbc/bin/obnam-mount': Disk quota exceeded
tar: ./root/backup-servers-obnam: Cannot create symlink to '/fbc/bin/backup-servers-obnam': Disk quota exceeded
tar: ./root/obnam-unlock: Cannot create symlink to '/fbc/bin/obnam-unlock': Disk quota exceeded
tar: ./root/obnam-generations: Cannot create symlink to '/fbc/bin/obnam-generations': Disk quota exceeded
tar: ./root/obnam-backup-servers: Cannot create symlink to '/fbc/bin/obnam-backup-servers': Disk quota exceeded
tar: ./root/obnam-ls: Cannot create symlink to '/fbc/bin/obnam-ls': Disk quota exceeded
tar: ./root/obnam-restore: Cannot create symlink to '/fbc/bin/obnam-restore': Disk quota exceeded
tar: ./root/obnam-unmount: Cannot create symlink to '/fbc/bin/obnam-unmount': Disk quota exceeded
Total bytes read: 10222202880 (9.6GiB, 26MiB/s)
tar: Exiting with failure status due to previous errors
command 'tar xpf /mnt/pve/nfs-pve/dump/vzdump-lxc-3117-2015_10_31-14_11_22.tar.lzo --numeric-owner --totals --sparse -C /var/lib/lxc/102/rootfs --skip-old-files --anchored --exclude './dev/*'' failed: exit code 2
TASK OK

the target has plenty of space:
Code:
NAME                          USED  AVAIL  REFER  MOUNTPOINT
tank/lxc                     14.9G  6.68T   208K  /tank/lxc

any suggestions to get the restore to work?
 
how much space did you assign to the container?

it is strange - under resources in pve I do not see any disk size setting . at a all the lxc's i checked.

I manually migrated the lxc, and sure enough in the conf file:
rootfs: pve:3117/vm-3117-disk-1.raw,size=36M

that is strange..
 
Is that a backup from beta phase? (there was a bug). To workaround, you can restore on the command line,
and specify storage and size using the rootfs parameter.

# pct restore <VMID> <archive.tar.gz> --rootfs <storage>:<sizeInGB>

does that work
 
Last edited:
The backup was made today.

Originally I think the system was restored from another backup 3-4 weeks ago. I'm not sure if the restore was from an openvz or lxc backup.

I was able to use rsync to move the image from old system to new , and moved the .conf file to new node.

So I'll try the pct restore command later .

Thank you for the help.
 
Re: restore lxc issue: Cannot write: Disk quota exceeded *solved*

So to prevent this check for M where there should be a G at rootfs , then edit files to fix.
Code:
grep rootfs /etc/pve/nodes/*/lxc/*.conf

In case there is a M in a backup conf file for rootfs , then use the pct command as Dietmar suggested
Code:
pct restore <VMID> <archive.tar.gz> --rootfs <storage>:<sizeInGB>
 
Is that a backup from beta phase? (there was a bug). To workaround, you can restore on the command line,
and specify storage and size using the rootfs parameter.

# pct restore <VMID> <archive.tar.gz> --rootfs <storage>:<sizeInGB>

does that work

I ran in to another backup with what seems like same issue, so tried:
Code:
pct restore  3113 /mnt/pve/nfs-pve/dump/vzdump-lxc-3112-2015_10_31-21_40_53.tar.lzo  --rootfs  lxc-zfs,size=4G  
400 Parameter verification failed.
storage: storage 'local' does not support container root directories
pct restore <vmid> <ostemplate> [OPTIONS]
so I wanted to restore that to storage lxc-zfs . I think the command was set correct to do that?

I had local storage set to NO containers. after adding containers to local storage the above command seemed to work.

Code:
pct restore  3113 /mnt/pve/nfs-pve/dump/vzdump-lxc-3112-2015_10_31-21_40_53.tar.lzo  --rootfs  lxc-zfs,size=4G  
extracting archive '/mnt/pve/nfs-pve/dump/vzdump-lxc-3112-2015_10_31-21_40_53.tar.lzo'
Total bytes read: 8045496320 (7.5GiB, 74MiB/s)
Detected container architecture: amd64

However I could not find the rootfs. nothing at /var/lib/vz/images or /tank/lxc .

and the config file dies not have a rootfs:
Code:
# cat /etc/pve/lxc/3113.conf
#ubuntu vivid lxc template used to make this.
#
#zm from ppa
#
#had to manually add cams since mysql teble  was different.
arch: amd64
cpulimit: 2
cpuunits: 1024
hostname: zm-security
memory: 2048
net0: bridge=vmbr3,hwaddr=76:4E:89:1B:31:8D,ip=dhcp,name=eth0,type=veth
onboot: 1
ostype: ubuntu
swap: 512

maybe I did something wrong?
 
so the zpool was restored to:
Code:
Filesystem                                  Type      Size  Used Avail Use% Mounted on
tank/lxc/subvol-3112-disk-1                 zfs       8.0G  8.0G     0 100% /var/lib/lxc/3112/rootfs

I'll delete that as root disk is small.
for now I'll manually restore and setup.

Let me know if more testing is needed or If I entered the command incorrectly.
 
I tried again to restore from pve web page, Made sure I chose the correct target - lxc-zfs , instead the restore went to local.

Another issue is that the system was set to use 8G . It actually had over 8G used. Hence the over quota issue.

the root disk on original system was a directory /pve used in pve storage as 'pve':
Code:
rootfs: pve:3112/vm-3112-disk-1.raw,size=8G

the zpool got created as tank/lxc/subvol-3113-disk-1 , mountpoint is /var/lib/lxc/3113/rootfs

more info:
Code:
Filesystem                                  Type      Size  Used Avail Use% Mounted on
tank/lxc/subvol-3508-disk-1                 zfs        12G  3.8G  8.3G  32% /tank/lxc/subvol-3508-disk-1
tank/bkup                                   zfs        10T   92G  9.9T   1% /bkup
tank/lxc/subvol-3108-disk-1                 zfs       8.0G  2.2G  5.9G  27% /tank/lxc/subvol-3108-disk-1
tank/lxc/subvol-3110-disk-1                 zfs       8.0G  2.2G  5.9G  28% /tank/lxc/subvol-3110-disk-1
tank/lxc/subvol-3113-disk-1                 zfs       8.0G  8.0G     0 100% /var/lib/lxc/3113/rootfs
 
The correct format for the rootfs parameter is

--rootfs lxc-zfs:4

just tested,
Code:
pct restore  3113 /mnt/pve/nfs-pve/dump/vzdump-lxc-3112-2015_10_31-21_40_53.tar.lzo  --rootfs lxc-zfs:4
400 Parameter verification failed.
storage: storage 'local' does not support container root directories
pct restore <vmid> <ostemplate> [OPTIONS]
that was with 'local' storage not allowing containers.
 
with local allowing containers.
note sys4 does not use zfs .
the backup was made on sys4 .
Code:
sys4  /var/lib/vz # pct restore  3113 /mnt/pve/nfs-pve/dump/vzdump-lxc-3112-2015_10_31-21_40_53.tar.lzo  --rootfs pve:40
Formatting '/pve/images/3113/vm-3113-disk-1.raw', fmt=raw size=42949672960
mke2fs 1.42.12 (29-Aug-2014)
Discarding device blocks: done                            
Creating filesystem with 10485760 4k blocks and 2621440 inodes
Filesystem UUID: 6010d72a-c171-452a-b923-093af63e255c
Superblock backups stored on blocks: 
        32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632, 2654208, 
        4096000, 7962624

Allocating group tables: done                            
Writing inode tables: done                            
Creating journal (32768 blocks): done
Multiple mount protection is enabled with update interval 5 seconds.
Writing superblocks and filesystem accounting information: done   

extracting archive '/mnt/pve/nfs-pve/dump/vzdump-lxc-3112-2015_10_31-21_40_53.tar.lzo'
Total bytes read: 8045496320 (7.5GiB, 107MiB/s)
Detected container architecture: amd64
so I was able to restore and increase rootfs size.

again test containers disabled on local storage. I did so because this system is different in that it does not ues zfs.
Code:
sys4  /var/lib/vz # pct restore  3114 /mnt/pve/nfs-pve/dump/vzdump-lxc-3112-2015_10_31-21_40_53.tar.lzo  --rootfs pve:40
400 Parameter verification failed.
storage: storage 'local' does not support container root directories
pct restore <vmid> <ostemplate> [OPTIONS]
so using a --rootfs , currently containers need to be enabled at local storage.

and
after making a pct with 40G , I did a backup, and was able to restore to the lxc-zfs storage at sys3 , without local storage enabled.
 
OK, I finally found the correct syntax - try:

# pct restore 3114 /mnt/pve/nfs-pve/dump/vzdump-lxc-3112-2015_10_31-21_40_53.tar.lzo --storage lxc-zfs --rootfs 40

use --storage to specify the storage
pass the size in GB to --rootfs
 
  • Like
Reactions: BrandonN
OK, I finally found the correct syntax - try:

# pct restore 3114 /mnt/pve/nfs-pve/dump/vzdump-lxc-3112-2015_10_31-21_40_53.tar.lzo --storage lxc-zfs --rootfs 40

use --storage to specify the storage
pass the size in GB to --rootfs
Hello, we find this same error for Virtual Environment 7.1-8 with the next log.

tar: ./folder: ********************: Disk quota exceeded

With post now run ok for me. Thanks a lot.