Hello Peter:
Thank you for your reply.
I've found the page difficult to follow. There's 13 steps listed, but I found
the numbering and heading confusing. I've followed 10 of the 13 steps.
After following these 10 steps, I'm asking about purge of files. Have I
followed the steps incorrectly?
1. (FOLLOWED) Start the guest:
2. (FOLLOWED) Enumerate the disk(s) in use:
3. (FOLLOWED) Begin the backup:
4. (FOLLOWED) Check the job status ("None" means the job has likely completed):
5. (FOLLOWED) Check the completed job status:
6. (FOLLOWED) Now we see the copy of the backup:
Full backup with older libvirt versions
1. (considered optional) Start with a guest with a single disk image, base.raw,
which is where the live QEMU is pointing at, and recording the guest writes:
2. (considered optional) List the current block device(s) in use:
3. (considered optional) Create the live "external disk snapshot" (or more
correctly, "an overlay"):
1. (FOLLOWED) Now, take a backup the original image, base.raw, to a different
location using cp or rsync:
2. (FOLLOWED) Enumerate the current block device(s) in use, again. Notice that
the current disk image in use is the above-created overlay, overlay1.qcow2:
3. (FOLLOWED) Once the backup of the original image completes, now perform the
"active block-commit" to live-merge the contents of overlay1.qcow2 into
base.raw and pivot the live QEMU back to the original:
4. (FOLLOWED) After the above operation completes, again list the current block
device(s) in use. And notice that the live QEMU is now writing to the original
base image:
+ onlinebackup
+ repo=SHACKLETON1210
date +%Y-%m-%d_%H-%M-%S
++ date +%Y-%m-%d_%H-%M-%S
+ LOGDATE=2025-08-26_19-00-24
basename $0 .sh
++ basename /share/CACHEDEV3_DATA/SHACKLETON12-scripts/qnap-backup.sh .sh
+
LOGFILE=/share/CACHEDEV3_DATA/SHACKLETON12-scripts/log/qnap-backup.2025-08-26_19-00-24.SHACKLETON1210.log
+ virsh -v
8.6.0
+ virsh domblklist acf333b4-0a75-48fd-ba0d-be26ed48b088
Target Source
-------------------------------------------------------------------------------
vda /share/Virtual-Machines/SHACKLETON1210/SHACKLETON1210_00.1756247188
hda /share/Virtual-Machines/debian-12.10.0-amd64-netinst.iso
+ V_RETURN_CODE=0
+ printf 'V_RETURN_CODE: %d\n' 0
V_RETURN_CODE: 0
+ [[ 0 -ne 0 ]]
+ virsh backup-begin acf333b4-0a75-48fd-ba0d-be26ed48b088
Backup started
+ V_RETURN_CODE=0
+ printf 'V_RETURN_CODE: %d\n' 0
V_RETURN_CODE: 0
+ [[ 0 -ne 0 ]]
+ true
+ sleep 30
Error relocating /QVS/usr/lib/libudev.so.1: canonicalize_file_name: symbol not
found
+ virsh domjobinfo acf333b4-0a75-48fd-ba0d-be26ed48b088
Job type: Unbounded
Operation: Backup
Time elapsed: 30438 ms
File processed: 3.481 GiB
File remaining: 71.519 GiB
File total: 75.000 GiB
+ virsh domjobinfo acf333b4-0a75-48fd-ba0d-be26ed48b088 --completed
--keep-completed
Job type: None
virsh domjobinfo ${VM_DOMAIN_GUID:-} --completed|awk '$1~/Job/{print $3}'
++ virsh domjobinfo acf333b4-0a75-48fd-ba0d-be26ed48b088 --completed
++ awk '$1~/Job/{print $3}'
+ V_VIRSH_STATUS=None
+ [[ None == \C\o\m\p\l\e\t\e\d ]]
+ true
+ sleep 30
+ virsh domjobinfo acf333b4-0a75-48fd-ba0d-be26ed48b088
Job type: Unbounded
Operation: Backup
Time elapsed: 65427 ms
File processed: 7.446 GiB
File remaining: 67.554 GiB
File total: 75.000 GiB
+ virsh domjobinfo acf333b4-0a75-48fd-ba0d-be26ed48b088 --completed
--keep-completed
Job type: None
virsh domjobinfo ${VM_DOMAIN_GUID:-} --completed|awk '$1~/Job/{print $3}'
++ virsh domjobinfo acf333b4-0a75-48fd-ba0d-be26ed48b088 --completed
++ awk '$1~/Job/{print $3}'
+ V_VIRSH_STATUS=None
+ [[ None == \C\o\m\p\l\e\t\e\d ]]
+ true
+ sleep 30
+ virsh domjobinfo acf333b4-0a75-48fd-ba0d-be26ed48b088
Job type: Unbounded
Operation: Backup
Time elapsed: 95548 ms
File processed: 21.457 GiB
File remaining: 53.543 GiB
File total: 75.000 GiB
+ virsh domjobinfo acf333b4-0a75-48fd-ba0d-be26ed48b088 --completed
--keep-completed
Job type: None
virsh domjobinfo ${VM_DOMAIN_GUID:-} --completed|awk '$1~/Job/{print $3}'
++ virsh domjobinfo acf333b4-0a75-48fd-ba0d-be26ed48b088 --completed
++ awk '$1~/Job/{print $3}'
+ V_VIRSH_STATUS=None
+ [[ None == \C\o\m\p\l\e\t\e\d ]]
+ true
+ sleep 30
+ virsh domjobinfo acf333b4-0a75-48fd-ba0d-be26ed48b088
Job type: Unbounded
Operation: Backup
Time elapsed: 125589 ms
File processed: 25.455 GiB
File remaining: 49.545 GiB
File total: 75.000 GiB
+ virsh domjobinfo acf333b4-0a75-48fd-ba0d-be26ed48b088 --completed
--keep-completed
Job type: None
virsh domjobinfo ${VM_DOMAIN_GUID:-} --completed|awk '$1~/Job/{print $3}'
++ virsh domjobinfo acf333b4-0a75-48fd-ba0d-be26ed48b088 --completed
++ awk '$1~/Job/{print $3}'
+ V_VIRSH_STATUS=None
+ [[ None == \C\o\m\p\l\e\t\e\d ]]
+ true
+ sleep 30
+ virsh domjobinfo acf333b4-0a75-48fd-ba0d-be26ed48b088
Job type: Unbounded
Operation: Backup
Time elapsed: 155638 ms
File processed: 29.009 GiB
File remaining: 45.991 GiB
File total: 75.000 GiB
+ virsh domjobinfo acf333b4-0a75-48fd-ba0d-be26ed48b088 --completed
--keep-completed
Job type: None
virsh domjobinfo ${VM_DOMAIN_GUID:-} --completed|awk '$1~/Job/{print $3}'
++ virsh domjobinfo acf333b4-0a75-48fd-ba0d-be26ed48b088 --completed
++ awk '$1~/Job/{print $3}'
+ V_VIRSH_STATUS=None
+ [[ None == \C\o\m\p\l\e\t\e\d ]]
+ true
+ sleep 30
+ virsh domjobinfo acf333b4-0a75-48fd-ba0d-be26ed48b088
Job type: Unbounded
Operation: Backup
Time elapsed: 185690 ms
File processed: 32.445 GiB
File remaining: 42.555 GiB
File total: 75.000 GiB
+ virsh domjobinfo acf333b4-0a75-48fd-ba0d-be26ed48b088 --completed
--keep-completed
Job type: None
virsh domjobinfo ${VM_DOMAIN_GUID:-} --completed|awk '$1~/Job/{print $3}'
++ virsh domjobinfo acf333b4-0a75-48fd-ba0d-be26ed48b088 --completed
++ awk '$1~/Job/{print $3}'
+ V_VIRSH_STATUS=None
+ [[ None == \C\o\m\p\l\e\t\e\d ]]
+ true
+ sleep 30
+ virsh domjobinfo acf333b4-0a75-48fd-ba0d-be26ed48b088
Job type: Unbounded
Operation: Backup
Time elapsed: 215727 ms
File processed: 36.395 GiB
File remaining: 38.605 GiB
File total: 75.000 GiB
+ virsh domjobinfo acf333b4-0a75-48fd-ba0d-be26ed48b088 --completed
--keep-completed
Job type: None
virsh domjobinfo ${VM_DOMAIN_GUID:-} --completed|awk '$1~/Job/{print $3}'
++ virsh domjobinfo acf333b4-0a75-48fd-ba0d-be26ed48b088 --completed
++ awk '$1~/Job/{print $3}'
+ V_VIRSH_STATUS=None
+ [[ None == \C\o\m\p\l\e\t\e\d ]]
+ true
+ sleep 30
+ virsh domjobinfo acf333b4-0a75-48fd-ba0d-be26ed48b088
Job type: Unbounded
Operation: Backup
Time elapsed: 245766 ms
File processed: 46.733 GiB
File remaining: 28.267 GiB
File total: 75.000 GiB
+ virsh domjobinfo acf333b4-0a75-48fd-ba0d-be26ed48b088 --completed
--keep-completed
Job type: None
virsh domjobinfo ${VM_DOMAIN_GUID:-} --completed|awk '$1~/Job/{print $3}'
++ virsh domjobinfo acf333b4-0a75-48fd-ba0d-be26ed48b088 --completed
++ awk '$1~/Job/{print $3}'
+ V_VIRSH_STATUS=None
+ [[ None == \C\o\m\p\l\e\t\e\d ]]
+ true
+ sleep 30
+ virsh domjobinfo acf333b4-0a75-48fd-ba0d-be26ed48b088
Job type: Unbounded
Operation: Backup
Time elapsed: 275804 ms
File processed: 50.947 GiB
File remaining: 24.053 GiB
File total: 75.000 GiB
+ virsh domjobinfo acf333b4-0a75-48fd-ba0d-be26ed48b088 --completed
--keep-completed
Job type: None
virsh domjobinfo ${VM_DOMAIN_GUID:-} --completed|awk '$1~/Job/{print $3}'
++ virsh domjobinfo acf333b4-0a75-48fd-ba0d-be26ed48b088 --completed
++ awk '$1~/Job/{print $3}'
+ V_VIRSH_STATUS=None
+ [[ None == \C\o\m\p\l\e\t\e\d ]]
+ true
+ sleep 30
+ virsh domjobinfo acf333b4-0a75-48fd-ba0d-be26ed48b088
Job type: Unbounded
Operation: Backup
Time elapsed: 305847 ms
File processed: 64.445 GiB
File remaining: 10.555 GiB
File total: 75.000 GiB
+ virsh domjobinfo acf333b4-0a75-48fd-ba0d-be26ed48b088 --completed
--keep-completed
Job type: None
virsh domjobinfo ${VM_DOMAIN_GUID:-} --completed|awk '$1~/Job/{print $3}'
++ virsh domjobinfo acf333b4-0a75-48fd-ba0d-be26ed48b088 --completed
++ awk '$1~/Job/{print $3}'
+ V_VIRSH_STATUS=None
+ [[ None == \C\o\m\p\l\e\t\e\d ]]
+ true
+ sleep 30
+ virsh domjobinfo acf333b4-0a75-48fd-ba0d-be26ed48b088
Job type: Unbounded
Operation: Backup
Time elapsed: 335933 ms
File processed: 74.500 GiB
File remaining: 512.000 MiB
File total: 75.000 GiB
+ virsh domjobinfo acf333b4-0a75-48fd-ba0d-be26ed48b088 --completed
--keep-completed
Job type: None
virsh domjobinfo ${VM_DOMAIN_GUID:-} --completed|awk '$1~/Job/{print $3}'
++ virsh domjobinfo acf333b4-0a75-48fd-ba0d-be26ed48b088 --completed
++ awk '$1~/Job/{print $3}'
+ V_VIRSH_STATUS=None
+ [[ None == \C\o\m\p\l\e\t\e\d ]]
+ true
+ sleep 30
+ virsh domjobinfo acf333b4-0a75-48fd-ba0d-be26ed48b088
Job type: None
+ virsh domjobinfo acf333b4-0a75-48fd-ba0d-be26ed48b088 --completed
--keep-completed
Job type: Completed
Operation: Backup
Time elapsed: 340009 ms
File processed: 75.000 GiB
File remaining: 0.000 B
File total: 75.000 GiB
virsh domjobinfo ${VM_DOMAIN_GUID:-} --completed|awk '$1~/Job/{print $3}'
++ virsh domjobinfo acf333b4-0a75-48fd-ba0d-be26ed48b088 --completed
++ awk '$1~/Job/{print $3}'
+ V_VIRSH_STATUS=Completed
+ [[ Completed == \C\o\m\p\l\e\t\e\d ]]
+ break
+ V_PROCESS_ID=20435
+ echo 'PID: 20435'
PID: 20435
+ cp -p
/share/CACHEDEV2_DATA/Virtual-Machines/SHACKLETON1210/SHACKLETON1210_00.img
/share/CACHEDEV2_DATA/Virtual-Machines-local-backup/SHACKLETON1210/SHACKLETON1210_00.img-backup-1
+ rclone -v --log-file
/share/CACHEDEV3_DATA/SHACKLETON12-scripts/log/qnap-backup.2025-08-26_19-00-24.SHACKLETON1210.log
copy
/share/CACHEDEV2_DATA/Virtual-Machines/SHACKLETON1210/SHACKLETON1210_00.img
'anna_onedrive:Virtual-Machines-img-(DO-NOT-ERASE)/SHACKLETON1210/SHACKLETON1210_00.img-backup-1'
+ V_RETURN_CODE=0
+ printf 'V_RETURN_CODE: %d\n' 0
V_RETURN_CODE: 0
+ [[ 0 -ne 0 ]]
+ wait 20435
+ V_RETURN_CODE=0
+ printf 'V_RETURN_CODE: %d\n' 0
V_RETURN_CODE: 0
+ [[ 0 -ne 0 ]]
+ virsh domblklist acf333b4-0a75-48fd-ba0d-be26ed48b088
Target Source
-------------------------------------------------------------------------------
vda /share/Virtual-Machines/SHACKLETON1210/SHACKLETON1210_00.1756247188
hda /share/Virtual-Machines/debian-12.10.0-amd64-netinst.iso
+ V_RETURN_CODE=0
+ printf 'V_RETURN_CODE: %d\n' 0
V_RETURN_CODE: 0
+ [[ 0 -ne 0 ]]
virsh domblklist ${VM_DOMAIN_GUID:-} | awk '/vda/{print $2}'
++ virsh domblklist acf333b4-0a75-48fd-ba0d-be26ed48b088
++ awk '/vda/{print $2}'
+
V_PURGE_IMG=/share/Virtual-Machines/SHACKLETON1210/SHACKLETON1210_00.1756247188
+ virsh blockcommit acf333b4-0a75-48fd-ba0d-be26ed48b088 vda --active --verbose
--pivot
Block commit: [ 6 %]
Block commit: [ 99 %]
Block commit: [100 %]
Successfully pivoted
+ V_RETURN_CODE=0
+ printf 'V_RETURN_CODE: %d\n' 0
V_RETURN_CODE: 0
+ [[ 0 -ne 0 ]]
+ virsh domblklist acf333b4-0a75-48fd-ba0d-be26ed48b088
Target Source
------------------------------------------------------------------------
vda /share/Virtual-Machines/SHACKLETON1210/SHACKLETON1210_00.img
hda /share/Virtual-Machines/debian-12.10.0-amd64-netinst.iso
+ V_RETURN_CODE=0
+ printf 'V_RETURN_CODE: %d\n' 0
V_RETURN_CODE: 0
+ [[ 0 -ne 0 ]]
dirname ${V_PURGE_IMG:-}
++ dirname /share/Virtual-Machines/SHACKLETON1210/SHACKLETON1210_00.1756247188
+ ls -alF /share/Virtual-Machines/SHACKLETON1210
total 237749684
drwxrwxrwx 4 admin administrators 20480 2025-08-26 19:00 ./
drwxrwxrwx 8 admin administrators 4096 2025-05-02 06:44 ../
drwxrwxrwx 3 admin administrators 4096 2025-08-26 10:40
.acf333b4-0a75-48fd-ba0d-be26ed48b088.meta/
drwxrwxrwx 2 admin administrators 4096 2025-08-26 10:40 SHACKLETON1210/
-rw-r--r-- 1 admin administrators 203751424 2025-08-26 11:32
SHACKLETON1210_00.1756219420
-rw-r--r-- 1 admin administrators 166920192 2025-08-26 14:18
SHACKLETON1210_00.1756222321
-rw------- 1 admin administrators 40506884096 2025-08-26 12:07
SHACKLETON1210_00.1756222321.1756224117
-rw-r--r-- 1 admin administrators 6684672 2025-08-26 18:26
SHACKLETON1210_00.1756247131
-rw-r--r-- 1 admin administrators 111345664 2025-08-26 21:48
SHACKLETON1210_00.1756247188
-rw------- 1 admin administrators 40511209472 2025-08-26 19:06
SHACKLETON1210_00.1756247188.1756249224
-rw-rw-rw- 1 admin administrators 40508194816 2025-08-26 21:48
SHACKLETON1210_00.img
-rw------- 1 admin administrators 40511078400 2025-08-26 17:00
SHACKLETON1210_00.img.1756241663
-rw-rw-rw- 1 admin administrators 40464941056 2025-08-24 00:26
SHACKLETON1210_00.img.2
-rw-rw-rw- 1 admin administrators 40464941056 2025-08-24 00:26
SHACKLETON1210_00.img.3
+ ls -alF /share/Virtual-Machines/SHACKLETON1210/SHACKLETON1210_00.1756247188
/share/Virtual-Machines/SHACKLETON1210/SHACKLETON1210_00.1756247188.1756249224
-rw-r--r-- 1 admin administrators 111345664 2025-08-26 21:48
/share/Virtual-Machines/SHACKLETON1210/SHACKLETON1210_00.1756247188
-rw------- 1 admin administrators 40511209472 2025-08-26 19:06
/share/Virtual-Machines/SHACKLETON1210/SHACKLETON1210_00.1756247188.1756249224
+ [[ 0 -eq 0 ]]
+ [[ /share/Virtual-Machines/SHACKLETON1210/SHACKLETON1210_00.1756247188 !=
*img* ]]
+ rm /share/Virtual-Machines/SHACKLETON1210/SHACKLETON1210_00.1756247188
/share/Virtual-Machines/SHACKLETON1210/SHACKLETON1210_00.1756247188.1756249224