Hello!Hello!
/tmp/img-backup-mnt is simply a temporary mount point for the image file being created as a LOOP device. It's deleted when image-backup terminates.
Try running image-backup interactively and specifying an "Initial image file ROOT filesystem size (MB)" much larger than the default.
I've tried running it interactively with 11000 MB as "Initial image file ROOT filesystem size (MB)" (default was 9511 MB). It looks like it worked without any errors. Here's the result:Does this mean default value was wrong and it prevented backup from completing? Is there a way to correct it, without actually putting fixed value when starting backup? I could use this value, but image could get larger over time. Also, putting much larger value than backup really needs just wastes space on NAS without actually using it.Code:
openhabian@openhabian:~/bin $ sudo ./image-backupImage file to create? /mnt/Backup/test.imgInitial image file ROOT filesystem size (MB) [9511]? 11000Added space for incremental updates after shrinking (MB) [0]?Create /mnt/Backup/test.img (y/n)? yStarting full backup (for incremental backups, run: /home/openhabian/bin/image-backup /mnt/Backup/test.img)e2fsck 1.47.0 (5-Feb-2023)Pass 1: Checking inodes, blocks, and sizesPass 2: Checking directory structurePass 3: Checking directory connectivityPass 4: Checking reference countsPass 5: Checking group summary informationrootfs: 131126/704512 files (0.2% non-contiguous), 2487085/2815744 blocksresize2fs 1.47.0 (5-Feb-2023)The filesystem is already 2815744 (4k) blocks long. Nothing to do!resize2fs 1.47.0 (5-Feb-2023)The filesystem is already 2815744 (4k) blocks long. Nothing to do!resize2fs 1.47.0 (5-Feb-2023)The filesystem is already 2815744 (4k) blocks long. Nothing to do!e2fsck 1.47.0 (5-Feb-2023)Pass 1: Checking inodes, blocks, and sizesPass 2: Checking directory structurePass 3: Checking directory connectivityPass 4: Checking reference countsPass 5: Checking group summary informationrootfs: 131126/704512 files (0.2% non-contiguous), 2487085/2815744 blocks
Best regards,
Davor
Image files cannot be expanded on the fly. Therefore, an image file must be initially created with a size sufficient to hold the current system contents. Once the backup is completed, the image file is shrunk to the smallest size possible before "Added space for incremental updates after shrinking (MB)" is added to the image file for future expansion. As such, it doesn't matter how large you make the initial image file as long as there is sufficient free space for its creation. image-backup estimates the initial image file size (i.e. the default value) by adding 20% to the used space reported by 'df'. Under rare circumstances, this is not sufficient and you must use a larger value.
Since I'm using bash script for backups, I've made a calculation of used space using df myself (excluding only mounted network drives), and then added 25% (looks like image-backup doesn't account some entries in df). It looks like backup finished without any errors. Here's the result:
Code:
Starting full backup (for incremental backups, run: /home/openhabian/bin/image-backup /mnt/Backup/OpenHAB_2024-12-09_13-42-35.img)e2fsck 1.47.0 (5-Feb-2023)Pass 1: Checking inodes, blocks, and sizesPass 2: Checking directory structurePass 3: Checking directory connectivityPass 4: Checking reference countsPass 5: Checking group summary informationrootfs: 131136/684096 files (0.2% non-contiguous), 2488379/2731776 blocksresize2fs 1.47.0 (5-Feb-2023)The filesystem is already 2731776 (4k) blocks long. Nothing to do!resize2fs 1.47.0 (5-Feb-2023)The filesystem is already 2731776 (4k) blocks long. Nothing to do!resize2fs 1.47.0 (5-Feb-2023)The filesystem is already 2731776 (4k) blocks long. Nothing to do!e2fsck 1.47.0 (5-Feb-2023)Pass 1: Checking inodes, blocks, and sizesPass 2: Checking directory structurePass 3: Checking directory connectivityPass 4: Checking reference countsPass 5: Checking group summary informationrootfs: 131136/684096 files (0.2% non-contiguous), 2488379/2731776 blocks
Thank you for all the help.
Best regards,
Davor
Statistics: Posted by davorf — Mon Dec 09, 2024 1:35 pm