Quantcast
Channel: Raspberry Pi Forums
Viewing all articles
Browse latest Browse all 5372

Advanced users • Re: Image File Utilities

$
0
0
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:

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[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
The only thing that looks strange is image size itself. It doesn't look like it was shrunk after completion. Yesterday I've created backup interactively and entered 11000 as "Initial image file ROOT filesystem size (MB)". It created a file that was 11.788.288 KB (the moment it was created) and it remained the same size after finishing backup. Today, I've used calculated size from the bash script, and it created a file that was 11.452.416 KB (the moment it was created) and it also remained the same size after finishing backup. Also, file I've created yesterday is bigger than today's (and both finished without errors), so, I guess at least yesterday's file should be shrunk to the size of today's (even though, it doesn't have to be that size either, since it's an approximation).

image-backup is working exactly as expected and intended.

The "Initial image file ROOT filesystem size (MB)" value you chose (11000) was large enough to hold the backup, but resize2fs was unable to shrink the resulting image file any:

Code:

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!resize2fs 1.47.0 (5-Feb-2023)The filesystem is already 2815744 (4k) blocks long.  Nothing to do!
The resulting image file is healthy, but has less free space in it than resize2fs can shrink any further.

Use an "Initial image file ROOT filesystem size (MB)" value of 22000 and you'll see resize2fs able to shrink the resulting image file.

image-backup is working exactly as expected and intended.

Statistics: Posted by RonR — Mon Dec 09, 2024 5:22 pm



Viewing all articles
Browse latest Browse all 5372

Trending Articles