RonR
Posts: 3467
Joined: Tue Apr 12, 2016 10:29 pm
Location: US

Re: Image File Utilities

Mon Nov 20, 2023 9:28 am

kapabel wrote:
Mon Nov 20, 2023 6:01 am
I use sshfs to connect to a FTP server. This was working before but I can't get it to work now. I have tried adding follow_symlinks but this didn't do the trick.

Any hint is much appreciated!

I don't have any experience with sshfs and I've got too many irons in the fire at the moment to research it. Maybe someone more familiar with sshfs will chime in with a suggestion or two.

Dan1jel
Posts: 57
Joined: Wed Aug 08, 2018 6:21 pm
Location: Sweden

Re: Image File Utilities

Sat Nov 25, 2023 7:18 am

Good morning, just checked my backup and I had this error, never seen that earlier, anyone know what could be the issue? This is on a Raspberry pi 4b.

Code: Select all

resize2fs 1.47.0 (5-Feb-2023)
resize2fs: Corrupt extent header while trying to resize /dev/loop0p2
Please run 'e2fsck -fy /dev/loop0p2' to fix the filesystem
after the aborted resize operation.
Resizing the filesystem on /dev/loop0p2 to 3330493 (4k) blocks.
resize2fs 1.47.0 (5-Feb-2023)
resize2fs: Block bitmap checksum does not match bitmap while trying to resize /dev/loop0p2
Please run 'e2fsck -fy /dev/loop0p2' to fix the filesystem
after the aborted resize operation.
Resizing the filesystem on /dev/loop0p2 to 3330503 (4k) blocks.
resize2fs 1.47.0 (5-Feb-2023)
resize2fs: Block bitmap checksum does not match bitmap while trying to resize /dev/loop0p2
Please run 'e2fsck -fy /dev/loop0p2' to fix the filesystem
after the aborted resize operation.
Resizing the filesystem on /dev/loop0p2 to 3330503 (4k) blocks.
e2fsck 1.47.0 (5-Feb-2023)
Pass 1: Checking inodes, blocks, and sizes
Inode 392147 has an invalid extent node (blk 1466975, lblk 0)
Clear? no

Inode 392147 extent tree (at level 1) could be shorter.  Optimize? no

Inode 392147, i_blocks is 76792, should be 0.  Fix? no

Inode 392213 has an invalid extent node (blk 1466976, lblk 0)
Clear? no

Inode 392213 extent tree (at level 1) could be shorter.  Optimize? no

Inode 392213, i_blocks is 67288, should be 0.  Fix? no

Inode 392965 has an invalid extent node (blk 1466977, lblk 0)
Clear? no

Inode 392965 extent tree (at level 1) could be shorter.  Optimize? no

Inode 392965, i_blocks is 103096, should be 0.  Fix? no

Inode 396669 has an invalid extent node (blk 1466978, lblk 0)
Clear? no

Inode 396669 extent tree (at level 1) could be shorter.  Optimize? no

Inode 396669, i_blocks is 61072, should be 0.  Fix? no

Inode 401486 has an invalid extent node (blk 1466979, lblk 0)
Clear? no

Inode 401486 extent tree (at level 1) could be shorter.  Optimize? no

Inode 401486, i_blocks is 54840, should be 0.  Fix? no

Inode 401489 has an invalid extent node (blk 1466980, lblk 0)
Clear? no

Inode 401489 extent tree (at level 1) could be shorter.  Optimize? no

Inode 401489, i_blocks is 59072, should be 0.  Fix? no

Inode 401523 has an invalid extent node (blk 1466981, lblk 0)
Clear? no

Inode 401523 extent tree (at level 1) could be shorter.  Optimize? no

Inode 401523, i_blocks is 52784, should be 0.  Fix? no

HTREE directory inode 422120 has an invalid root node.
Clear HTree index? no

Inode 422133 has an invalid extent node (blk 1465581, lblk 0)
Clear? no

Inode 422133 extent tree (at level 1) could be shorter.  Optimize? no

HTREE directory inode 422133 has an invalid root node.
Clear HTree index? no

Inode 422133 is a zero-length directory.  Clear? no

Inode 422133, i_size is 32768, should be 0.  Fix? no

Inode 422133, i_blocks is 72, should be 0.  Fix? no

Inode 422804 has an invalid extent node (blk 1466982, lblk 0)
Clear? no

Inode 422804 extent tree (at level 1) could be shorter.  Optimize? no

Inode 422804, i_blocks is 113952, should be 0.  Fix? no

HTREE directory inode 423587 has an invalid root node.
Clear HTree index? no

HTREE directory inode 424678 has an invalid root node.
Clear HTree index? no

HTREE directory inode 424680 has an invalid root node.
Clear HTree index? no

HTREE directory inode 424689 has an invalid root node.
Clear HTree index? no

HTREE directory inode 426481 has an invalid root node.
Clear HTree index? no
I tried

Code: Select all

sudo e2fsck -fy /dev/loop0p2
but just get back

Code: Select all

e2fsck 1.47.0 (5-Feb-2023)
e2fsck: No such file or directory while trying to open /dev/loop0p2
Possibly non-existent device?
My other server (raspberry pi 4b) was no issue with.

RonR
Posts: 3467
Joined: Tue Apr 12, 2016 10:29 pm
Location: US

Re: Image File Utilities

Sat Nov 25, 2023 7:56 am

Dan1jel wrote:
Sat Nov 25, 2023 7:18 am
I tried

Code: Select all

sudo e2fsck -fy /dev/loop0p2
but just get back

Code: Select all

e2fsck 1.47.0 (5-Feb-2023)
e2fsck: No such file or directory while trying to open /dev/loop0p2
Possibly non-existent device?

When image-backup terminates, /dev/loop0p2 no longer exists.

You would need to do something similar to the following:

Code: Select all

losetup -f --show -P <image-file-name>
e2fsck -fy </dev/loopXp2>
losetup -d </dev/loopX>

Dan1jel
Posts: 57
Joined: Wed Aug 08, 2018 6:21 pm
Location: Sweden

Re: Image File Utilities

Sat Nov 25, 2023 8:41 am

RonR wrote:
Sat Nov 25, 2023 7:56 am
Dan1jel wrote:
Sat Nov 25, 2023 7:18 am
I tried

Code: Select all

sudo e2fsck -fy /dev/loop0p2
but just get back

Code: Select all

e2fsck 1.47.0 (5-Feb-2023)
e2fsck: No such file or directory while trying to open /dev/loop0p2
Possibly non-existent device?

When image-backup terminates, /dev/loop0p2 no longer exists.

You would need to do something similar to the following:

Code: Select all

losetup -f --show -P <image-file-name>
e2fsck -fy </dev/loopXp2>
losetup -d </dev/loopX>
Aah that explains it, but didnt see anything regarding that image-backup was terminated, I have the script and usually works good as all other times. I tried to make another backup and now it was no issue at all...

I just can't see why it was terminated or why the error came in the first place.

RonR
Posts: 3467
Joined: Tue Apr 12, 2016 10:29 pm
Location: US

Re: Image File Utilities

Sat Nov 25, 2023 8:53 am

Dan1jel wrote:
Sat Nov 25, 2023 8:41 am
Aah that explains it, but didnt see anything regarding that image-backup was terminated, I have the script and usually works good as all other times. I tried to make another backup and now it was no issue at all...

I just can't see why it was terminated or why the error came in the first place.

When a script finishes (one way or another), it's 'terminated'.

Somehow, the image file became corrupted. Flakey storage media? Power hiccup? Something else?

redvli
Posts: 1735
Joined: Thu Sep 03, 2020 8:09 am

Re: Image File Utilities

Sat Nov 25, 2023 9:21 am

Dan1jel wrote:
Sat Nov 25, 2023 8:41 am
Aah that explains it, but didnt see anything regarding that image-backup was terminated, I have the script and usually works good as all other times. I tried to make another backup and now it was no issue at all...

I just can't see why it was terminated or why the error came in the first place.
You have quite some layers of software below the loop device, it must work, but fuse is not like kernel-level filesystem although it can work better. And then sshfs, if there is a huge delay or hiccup in the network, I don't know what will happen. A kernel block-device might have shorter timeout then ssh/tcp. All assuming no error in network packages, although I had that once via an older mobile 4G operator link. A large file download failed on sha256sum and a handful of other people also 'saw strange things happening on their PC' occasionally.

Dan1jel
Posts: 57
Joined: Wed Aug 08, 2018 6:21 pm
Location: Sweden

Re: Image File Utilities

Sat Nov 25, 2023 11:04 am

RonR wrote:
Sat Nov 25, 2023 8:53 am
Dan1jel wrote:
Sat Nov 25, 2023 8:41 am
Aah that explains it, but didnt see anything regarding that image-backup was terminated, I have the script and usually works good as all other times. I tried to make another backup and now it was no issue at all...

I just can't see why it was terminated or why the error came in the first place.

When a script finishes (one way or another), it's 'terminated'.

Somehow, the image file became corrupted. Flakey storage media? Power hiccup? Something else?
In my log, the script continued with the script. And after the script is down it prints the log. So the script was not 'terminated' but yea something had happen apparently. Due to this waking now I will keep a watch next time my script runs, (25th of every month). Thanks for the quick reply, as always. Much appreciated!

Dan1jel
Posts: 57
Joined: Wed Aug 08, 2018 6:21 pm
Location: Sweden

Re: Image File Utilities

Sat Nov 25, 2023 11:06 am

redvli wrote:
Sat Nov 25, 2023 9:21 am
Dan1jel wrote:
Sat Nov 25, 2023 8:41 am
Aah that explains it, but didnt see anything regarding that image-backup was terminated, I have the script and usually works good as all other times. I tried to make another backup and now it was no issue at all...

I just can't see why it was terminated or why the error came in the first place.
You have quite some layers of software below the loop device, it must work, but fuse is not like kernel-level filesystem although it can work better. And then sshfs, if there is a huge delay or hiccup in the network, I don't know what will happen. A kernel block-device might have shorter timeout then ssh/tcp. All assuming no error in network packages, although I had that once via an older mobile 4G operator link. A large file download failed on sha256sum and a handful of other people also 'saw strange things happening on their PC' occasionally.
It is the first time seeing this so much be something strange in general, but yea I will have a lookout for the next time and see if I can spot anything wrong/causing this error.

MeghansUncle2
Posts: 4
Joined: Fri Dec 08, 2017 11:16 pm

I need help restoring an image using Image File Utilities

Thu Nov 30, 2023 3:12 am

pidd wrote:
Sun Nov 12, 2023 3:04 am
Use Raspberry Pi Imager to burn the image to the card.
I am not restoring to a card, I am restoring to an SSD. Well, trying to anyway. Can someone tell me if they have a 2-partition SSD setup like mine that has had success restoring a backup to the SSD? I can't get Etcher to do it...

My original post:

I installed the utilities to my PI 4 and successfully performed a backup that was stored on my NAS. Thanks to the author of this article: https://blog.networkprofile.org/backup- ... smb-share/

The problem I am having is the restoration of that img file. The article suggests using belnaEtcher, which I installed, but the restoration doesn't seem to work. I am trying to restore to the same SSD that I took the backup from, it has a 256MB boot partition, and a 255GB FS partition.

1) I unplug the USB-attched SSD from my PI and I plug it into my WINDOWS laptop
2) I then try to perform a restore (yes the current file system and boot bartition are intact, but I am checking the restore.) using belnaEtcher.
a) Open belnaEtcher
b) Select "flash from file" and select the source image file
c) When it comes time to select the target, I only see the boot partition, not the FS partition which is in EXT4 format and windows doesn't
do EXT4 natively.
d) I Select the only thing I see in the list (the usb drive)
e) I click flash and the program tries to do something for about 5 seconds and then pops up
the following message:

Attention

Looks like Etcher lost access to the drive. Did
it get unplugged accidentally?

Sometimes this error is caused by faulty
readers that don't provide stable access to
the drive.


Can anyone provide any help with this or tell me what I am doing wrong?

Also, I don't understand the format the img file is in, or what it contains. Does it hold the file system data only and not the boot partition files?

Note: I do have "linux file system for windows and can mount the EXT4 partition and it's assigned a drive letter and windows can access it, but Etcher doesn't see it when I go to select the destination..

Any help with this is greatly appreciated.

RonR
Posts: 3467
Joined: Tue Apr 12, 2016 10:29 pm
Location: US

Re: I need help restoring an image using Image File Utilities

Thu Nov 30, 2023 4:18 am

MeghansUncle2 wrote:
Thu Nov 30, 2023 3:12 am
Any help with this is greatly appreciated.

If you created the image file with image-backup that is attached to the first post of this topic, you should be able to write it to an SSD using Etcher. You should then be able to boot from that SSD.

Etcher will write anything to a USB storage device (it does produce warnings if the image file doesn't appear to have a valid partition table, or if the destination is a large device, but it will do it successfully if you give it the go-ahead).

"Looks like Etcher lost access to the drive. Did it get unplugged accidentally?" is an error message that's unrelated to the image file you're trying to write with Etcher. Your problem is with the SSD and Windows. If you can partition the drive and use it with Windows, it will likely accept the image file from Etcher.

pidd
Posts: 5579
Joined: Fri May 29, 2020 8:29 pm
Location: Wirral, UK

Re: I need help restoring an image using Image File Utilities

Thu Nov 30, 2023 4:19 pm

MeghansUncle2 wrote:
Thu Nov 30, 2023 3:12 am
pidd wrote:
Sun Nov 12, 2023 3:04 am
Use Raspberry Pi Imager to burn the image to the card.
I am not restoring to a card, I am restoring to an SSD. Well, trying to anyway. Can someone tell me if they have a 2-partition SSD setup like mine that has had success restoring a backup to the SSD? I can't get Etcher to do it...
Imager will write to any removable storage device.

I've restored images to SSD loads of times using imager both with Windows and RPi's

fr-nz
Posts: 4
Joined: Fri Nov 10, 2023 12:03 pm

Re: Image File Utilities

Sat Dec 02, 2023 12:19 pm

Whatever I try, this doesn't seem to work with Bookworm. Made another image today, but the device doesn't even boot anymore after flashing (at least it never connects to LAN; I haven't had the chance to checkout UART). Plain (dd-only) image, will work as expected.

Code: Select all

sudo dd if=reTerminal_v0.4.2_ronr.img of=/dev/sda status=progress
11038986752 bytes (11 GB, 10 GiB) copied, 4653 s, 2.4 MB/s 
21560944+0 records in
21560944+0 records out
11039203328 bytes (11 GB, 10 GiB) copied, 4674.19 s, 2.4 MB/s
Image check doesn't turn-up anything:

Code: Select all

e2fsck 1.47.0 (5-Feb-2023)
Pass 1: Checking inodes, blocks, and sizes

Pass 2: Checking directory structure
Pass 3: Checking directory connectivity
Pass 4: Checking reference counts
Pass 5: Checking group summary information
rootfs: 346961/645904 files (0.1% non-contiguous), 2339541/2563790 blocks

tune2fs 1.47.0 (5-Feb-2023)
Filesystem volume name:   rootfs
Last mounted on:          /tmp/img-backup-mnt
Filesystem UUID:          f88b11e5-1d12-42de-a192-a56d6cdad744
Filesystem magic number:  0xEF53
Filesystem revision #:    1 (dynamic)
Filesystem features:      has_journal ext_attr resize_inode dir_index filetype extent 64bit flex_bg sparse_super large_file huge_file dir_nlink extra_isize metadata_csum
Filesystem flags:         unsigned_directory_hash 
Default mount options:    user_xattr acl
Filesystem state:         clean
Errors behavior:          Continue
Filesystem OS type:       Linux
Inode count:              645904
Block count:              2563790
Reserved block count:     128187
Overhead clusters:        66154
Free blocks:              224249
Free inodes:              298943
First block:              0
Block size:               4096
Fragment size:            4096
Group descriptor size:    64
Reserved GDT blocks:      1024
Blocks per group:         32768
Fragments per group:      32768
Inodes per group:         8176
Inode blocks per group:   511
Flex block group size:    16
Filesystem created:       Fri Dec  1 15:15:15 2023
Last mount time:          Fri Dec  1 15:36:21 2023
Last write time:          Sat Dec  2 06:11:18 2023
Mount count:              0
Maximum mount count:      -1
Last checked:             Sat Dec  2 06:11:18 2023
Check interval:           0 (<none>)
Lifetime writes:          11 GB
Reserved blocks uid:      0 (user root)
Reserved blocks gid:      0 (group root)
First inode:              11
Inode size:               256
Required extra isize:     32
Desired extra isize:      32
Journal inode:            8
Default directory hash:   half_md4
Directory Hash Seed:      ad46f0d4-2a06-43f7-b882-e2765511d336
Journal backup:           inode blocks
Checksum type:            crc32c
Checksum:                 0xb1bf6fa4
I can't figure out what I'm doing wrong; Using this as I used it for years - only difference is the OS-release.

pidd
Posts: 5579
Joined: Fri May 29, 2020 8:29 pm
Location: Wirral, UK

Re: Image File Utilities

Sun Dec 03, 2023 3:56 am

fr-nz wrote:
Sat Dec 02, 2023 12:19 pm
I can't figure out what I'm doing wrong; Using this as I used it for years - only difference is the OS-release.

Have you updated image-utilities from the first post on this thread, it needs the latest version for bookworm.

RandyR
Posts: 12
Joined: Thu Dec 07, 2023 2:41 pm

Re: Image File Utilities

Thu Dec 07, 2023 3:29 pm

First of all, thanks for sharing the Image File Utilities.

I have been using the Image-Backup program to share custom images but have had issues since the release of Bookworm. I am using the latest version of the files in post #1.

First a bit of background into my process. Basically, I create an initial image on an SD card using either the official 64-bit Bookworm RPiOS Desktop or Lite image, add some project software, install prerequisite packages using apt and then use image-backup to create the shareable image. This is done on a Pi4b-8Gb for the Desktop image and a Pi3b for the Lite image. Once the image is created, I move the image file to my laptop running Linux, mount the image (rw) and remove unnecessary files (e.g., log, temp files) and edit others (e.g., config, ini files) . If there are project file updates in the future, instead of going through the whole build process from scratch, I just mount the image and make the changes.

Now the problem - when mounting the backed up Desktop image the File Manager is showing 0 bytes free. The backup was created adding 100 MB using the command:

Code: Select all

sudo ./image-backup -i /mnt/usb1/Desktop.img,,100
from the Image-Utils folder in the pi user's home folder to a USB drive. I also ran the same image-backup command interactively, hitting <ENTER> for initial size and 100 for Added Space, but the image still shows no free space. I can edit files on the mounted image and delete files, but can no longer add files (even after deleting files the File Manager still shows 0 bytes free). I have tried different SD cards and also mounted the image on a Linux Mint laptop and a Linux Manjaro one. No difference.

However, when using the same backup procedure on a system created using the official 64-bit RPiOS Lite image, the mounted image shows over 580 MB of free space! I have checked free inodes on the mounted images and that isn't the issue. I never ran into this before (using 32-bit Bullseye systems).

Any ideas what could be the issue?

Randy

pidd
Posts: 5579
Joined: Fri May 29, 2020 8:29 pm
Location: Wirral, UK

Re: Image File Utilities

Thu Dec 07, 2023 7:00 pm

RandyR wrote:
Thu Dec 07, 2023 3:29 pm
Any ideas what could be the issue?

Randy
Have you updated to the latest version of image-utilities on the first post of this thread.

RonR
Posts: 3467
Joined: Tue Apr 12, 2016 10:29 pm
Location: US

Re: Image File Utilities

Thu Dec 07, 2023 7:01 pm

RandyR wrote:
Thu Dec 07, 2023 3:29 pm
I create an initial image on an SD card using either the official 64-bit Bookworm RPiOS Desktop or Lite image, add some project software, install prerequisite packages using apt and then use image-backup to create the shareable image. This is done on a Pi4b-8Gb for the Desktop image and a Pi3b for the Lite image.

What does running image-info on the created images show at this point (before moving them to your laptop running Linux)?

RonR
Posts: 3467
Joined: Tue Apr 12, 2016 10:29 pm
Location: US

Re: Image File Utilities

Thu Dec 07, 2023 7:03 pm

pidd wrote:
Thu Dec 07, 2023 7:00 pm
RandyR wrote:
Thu Dec 07, 2023 3:29 pm
Any ideas what could be the issue?

Randy
Have you updated to the latest version of image-utilities on the first post of this thread.
RandyR wrote:
Thu Dec 07, 2023 3:29 pm
I am using the latest version of the files in post #1.

RandyR
Posts: 12
Joined: Thu Dec 07, 2023 2:41 pm

Re: Image File Utilities

Thu Dec 07, 2023 7:14 pm

pidd wrote:
Thu Dec 07, 2023 7:00 pm
RandyR wrote:
Thu Dec 07, 2023 3:29 pm
Any ideas what could be the issue?

Randy
Have you updated to the latest version of image-utilities on the first post of this thread.
Yes. As mentioned in my post at the top (3rd sentence).

Randy

RandyR
Posts: 12
Joined: Thu Dec 07, 2023 2:41 pm

Re: Image File Utilities

Thu Dec 07, 2023 7:18 pm

RonR wrote:
Thu Dec 07, 2023 7:01 pm
RandyR wrote:
Thu Dec 07, 2023 3:29 pm
I create an initial image on an SD card using either the official 64-bit Bookworm RPiOS Desktop or Lite image, add some project software, install prerequisite packages using apt and then use image-backup to create the shareable image. This is done on a Pi4b-8Gb for the Desktop image and a Pi3b for the Lite image.

What does running image-info on the created images show at this point (before moving them to your laptop running Linux)?

Code: Select all

pi@RPi4_Desktop:~/image-utils $ sudo ./image-info /mnt/usb1/Desktop_Bookworm.img 
mount: (hint) your fstab has been modified, but systemd still uses
       the old version; use 'systemctl daemon-reload' to reload.
mount: (hint) your fstab has been modified, but systemd still uses
       the old version; use 'systemctl daemon-reload' to reload.

-rw-r--r-- 1 root root 13141041152 Dec  7 13:10 /mnt/usb1/Desktop_Bookworm.img

Filesystem     Type     1K-blocks     Used Available Use%
boot           vfat        522230    74100    448130  15%
root           ext4      12008608 11648160         0 100%

disk: PTUUID="2cb34d2e" PTTYPE="dos"
boot: LABEL_FATBOOT="bootfs" LABEL="bootfs" UUID="21DB-BD9D" BLOCK_SIZE="512" TYPE="vfat" PARTUUID="2cb34d2e-01"
root: LABEL="rootfs" UUID="10641c84-aa7a-4831-9ca4-08e07268f4b3" BLOCK_SIZE="4096" TYPE="ext4" PARTUUID="2cb34d2e-02"
Randy

RonR
Posts: 3467
Joined: Tue Apr 12, 2016 10:29 pm
Location: US

Re: Image File Utilities

Thu Dec 07, 2023 7:25 pm

@RandyR,

Try using a much larger value than the default for "Initial image file ROOT filesystem size" and see if image-info then reports your added free space.

RandyR
Posts: 12
Joined: Thu Dec 07, 2023 2:41 pm

Re: Image File Utilities

Thu Dec 07, 2023 7:35 pm

RonR wrote:
Thu Dec 07, 2023 7:25 pm
@RandyR,

Try using a much larger value than the default for "Initial image file ROOT filesystem size" and see if image-info then reports your added free space.
Ok. Thanks, @RonR. I'll try that and get back to you.

Randy

RandyR
Posts: 12
Joined: Thu Dec 07, 2023 2:41 pm

Re: Image File Utilities

Thu Dec 07, 2023 8:21 pm

RonR wrote:
Thu Dec 07, 2023 7:25 pm
@RandyR,

Try using a much larger value than the default for "Initial image file ROOT filesystem size" and see if image-info then reports your added free space.
I gave it an extra 1.2 Gb but it still shows 0 free:

Code: Select all

pi@RPi4_Desktop:~/image-utils $ sudo ./image-backup 

Image file to create? /mnt/usb1/Test_Image.img

Initial image file ROOT filesystem size (MB) [13798]? 15000

Added space for incremental updates after shrinking (MB) [0]? 100

Create /mnt/usb1/Test_Image.img (y/n)? y

Starting full backup (for incremental backups, run: ./image-backup /mnt/usb1/Test_Image.img)
mount: (hint) your fstab has been modified, but systemd still uses
       the old version; use 'systemctl daemon-reload' to reload.
mount: (hint) your fstab has been modified, but systemd still uses
       the old version; use 'systemctl daemon-reload' to reload.

e2fsck 1.47.0 (5-Feb-2023)
Pass 1: Checking inodes, blocks, and sizes
Pass 2: Checking directory structure
Pass 3: Checking directory connectivity
Pass 4: Checking reference counts
Pass 5: Checking group summary information
rootfs: 239150/960992 files (0.2% non-contiguous), 3007065/3839744 blocks

resize2fs 1.47.0 (5-Feb-2023)
Resizing the filesystem on /dev/loop0p2 to 3061895 (4k) blocks.
The filesystem on /dev/loop0p2 is now 3061895 (4k) blocks long.

resize2fs 1.47.0 (5-Feb-2023)
Resizing the filesystem on /dev/loop0p2 to 3059324 (4k) blocks.
The filesystem on /dev/loop0p2 is now 3059324 (4k) blocks long.

resize2fs 1.47.0 (5-Feb-2023)
Resizing the filesystem on /dev/loop0p2 to 3059321 (4k) blocks.
The filesystem on /dev/loop0p2 is now 3059321 (4k) blocks long.

e2fsck 1.47.0 (5-Feb-2023)
Pass 1: Checking inodes, blocks, and sizes
Pass 2: Checking directory structure
Pass 3: Checking directory connectivity
Pass 4: Checking reference counts
Pass 5: Checking group summary information
rootfs: 239150/765536 files (0.2% non-contiguous), 2994808/3059321 blocks

e2fsck 1.47.0 (5-Feb-2023)
Pass 1: Checking inodes, blocks, and sizes
Pass 2: Checking directory structure
Pass 3: Checking directory connectivity
Pass 4: Checking reference counts
Pass 5: Checking group summary information
rootfs: 239150/765536 files (0.2% non-contiguous), 2994808/3059321 blocks

resize2fs 1.47.0 (5-Feb-2023)
Resizing the filesystem on /dev/loop0p2 to 3084921 (4k) blocks.
The filesystem on /dev/loop0p2 is now 3084921 (4k) blocks long.

e2fsck 1.47.0 (5-Feb-2023)
Pass 1: Checking inodes, blocks, and sizes
Pass 2: Checking directory structure
Pass 3: Checking directory connectivity
Pass 4: Checking reference counts
Pass 5: Checking group summary information
rootfs: 239150/773680 files (0.2% non-contiguous), 2995319/3084921 blocks
mount: (hint) your fstab has been modified, but systemd still uses
       the old version; use 'systemctl daemon-reload' to reload.
mount: (hint) your fstab has been modified, but systemd still uses
       the old version; use 'systemctl daemon-reload' to reload.

_____________________________________________________________________

pi@RPi4_Desktop:~/image-utils $ sudo ./image-info /mnt/usb1/Test_Image.img 
mount: (hint) your fstab has been modified, but systemd still uses
       the old version; use 'systemctl daemon-reload' to reload.
mount: (hint) your fstab has been modified, but systemd still uses
       the old version; use 'systemctl daemon-reload' to reload.

-rw-r--r-- 1 root root 13173755904 Dec  7 14:16 /mnt/usb1/Test_Image.img

Filesystem     Type     1K-blocks     Used Available Use%
boot           vfat        522230    74100    448130  15%
root           ext4      12038888 11680480         0 100%

disk: PTUUID="2cb34d2e" PTTYPE="dos"
boot: LABEL_FATBOOT="bootfs" LABEL="bootfs" UUID="1216-A591" BLOCK_SIZE="512" TYPE="vfat" PARTUUID="2cb34d2e-01"
root: LABEL="rootfs" UUID="e49b5049-df5a-4186-a807-ee54b0e95327" BLOCK_SIZE="4096" TYPE="ext4" PARTUUID="2cb34d2e-02"
I'll try again with an extra 5 Gb

Randy

RandyR
Posts: 12
Joined: Thu Dec 07, 2023 2:41 pm

Re: Image File Utilities

Thu Dec 07, 2023 9:03 pm

RandyR wrote:
Thu Dec 07, 2023 8:21 pm

I'll try again with an extra 5 Gb

Randy
Still not showing any free space:

Code: Select all

pi@RPi4_Desktop:~/image-utils $ sudo ./image-backup 

Image file to create? /mnt/usb1/Test_Image.img

Initial image file ROOT filesystem size (MB) [13798]? 18798

Added space for incremental updates after shrinking (MB) [0]? 100

Create /mnt/usb1/Test_Image.img (y/n)? y

Starting full backup (for incremental backups, run: ./image-backup /mnt/usb1/Test_Image.img)
mount: (hint) your fstab has been modified, but systemd still uses
       the old version; use 'systemctl daemon-reload' to reload.
mount: (hint) your fstab has been modified, but systemd still uses
       the old version; use 'systemctl daemon-reload' to reload.

e2fsck 1.47.0 (5-Feb-2023)
Pass 1: Checking inodes, blocks, and sizes
Pass 2: Checking directory structure
Pass 3: Checking directory connectivity
Pass 4: Checking reference counts
Pass 5: Checking group summary information
rootfs: 239150/1204224 files (0.2% non-contiguous), 3039722/4812032 blocks

resize2fs 1.47.0 (5-Feb-2023)
Resizing the filesystem on /dev/loop1p2 to 3080192 (4k) blocks.
The filesystem on /dev/loop1p2 is now 3080192 (4k) blocks long.

resize2fs 1.47.0 (5-Feb-2023)
Resizing the filesystem on /dev/loop1p2 to 3075977 (4k) blocks.
The filesystem on /dev/loop1p2 is now 3075977 (4k) blocks long.

resize2fs 1.47.0 (5-Feb-2023)
Resizing the filesystem on /dev/loop1p2 to 3075970 (4k) blocks.
The filesystem on /dev/loop1p2 is now 3075970 (4k) blocks long.

e2fsck 1.47.0 (5-Feb-2023)
Pass 1: Checking inodes, blocks, and sizes
Pass 2: Checking directory structure
Pass 3: Checking directory connectivity
Pass 4: Checking reference counts
Pass 5: Checking group summary information
rootfs: 239150/770048 files (0.2% non-contiguous), 3011462/3075970 blocks

e2fsck 1.47.0 (5-Feb-2023)
Pass 1: Checking inodes, blocks, and sizes
Pass 2: Checking directory structure
Pass 3: Checking directory connectivity
Pass 4: Checking reference counts
Pass 5: Checking group summary information
rootfs: 239150/770048 files (0.2% non-contiguous), 3011462/3075970 blocks

resize2fs 1.47.0 (5-Feb-2023)
Resizing the filesystem on /dev/loop0p2 to 3101570 (4k) blocks.
The filesystem on /dev/loop0p2 is now 3101570 (4k) blocks long.

e2fsck 1.47.0 (5-Feb-2023)
Pass 1: Checking inodes, blocks, and sizes
Pass 2: Checking directory structure
Pass 3: Checking directory connectivity
Pass 4: Checking reference counts
Pass 5: Checking group summary information
rootfs: 239150/778240 files (0.2% non-contiguous), 3011976/3101570 blocks
mount: (hint) your fstab has been modified, but systemd still uses
       the old version; use 'systemctl daemon-reload' to reload.
mount: (hint) your fstab has been modified, but systemd still uses
       the old version; use 'systemctl daemon-reload' to reload.
_____________________________________________________________________

pi@RPi4_Desktop:~/image-utils $ sudo ./image-info /mnt/usb1/Test_Image.img 
mount: (hint) your fstab has been modified, but systemd still uses
       the old version; use 'systemctl daemon-reload' to reload.
mount: (hint) your fstab has been modified, but systemd still uses
       the old version; use 'systemctl daemon-reload' to reload.

-rw-r--r-- 1 root root 13241950208 Dec  7 14:49 /mnt/usb1/Test_Image.img

Filesystem     Type     1K-blocks     Used Available Use%
boot           vfat        522230    74100    448130  15%
root           ext4      12038808 11680432         0 100%

disk: PTUUID="2cb34d2e" PTTYPE="dos"
boot: LABEL_FATBOOT="bootfs" LABEL="bootfs" UUID="9A31-6494" BLOCK_SIZE="512" TYPE="vfat" PARTUUID="2cb34d2e-01"
root: LABEL="rootfs" UUID="1bb9f20e-6e92-4062-95ec-497c29dc5b8c" BLOCK_SIZE="4096" TYPE="ext4" PARTUUID="2cb34d2e-02"

RonR
Posts: 3467
Joined: Tue Apr 12, 2016 10:29 pm
Location: US

Re: Image File Utilities

Thu Dec 07, 2023 9:30 pm

Sorry for the delay. I wanted to create a fresh system using the latest Raspberry Pi OS images that just came out.

I can't seem to reproduce your problem:

Code: Select all

root@raspberrypi:~# uname -a
Linux raspberrypi 6.1.0-rpi7-rpi-2712 #1 SMP PREEMPT Debian 1:6.1.63-1+rpt1 (2023-11-24) aarch64 GNU/Linux
root@raspberrypi:~# ./image-backup

Image file to create? /mnt/test.img

Initial image file ROOT filesystem size (MB) [2006]?

Added space for incremental updates after shrinking (MB) [0]? 100

Create /mnt/test.img (y/n)? y

Starting full backup (for incremental backups, run: ./image-backup /mnt/test.img)

e2fsck 1.47.0 (5-Feb-2023)
Pass 1: Checking inodes, blocks, and sizes
Pass 2: Checking directory structure
Pass 3: Checking directory connectivity
Pass 4: Checking reference counts
Pass 5: Checking group summary information
rootfs: 60292/128512 files (0.1% non-contiguous), 420249/513280 blocks

resize2fs 1.47.0 (5-Feb-2023)
The filesystem is already 513280 (4k) blocks long.  Nothing to do!

resize2fs 1.47.0 (5-Feb-2023)
The filesystem is already 513280 (4k) blocks long.  Nothing to do!

resize2fs 1.47.0 (5-Feb-2023)
The filesystem is already 513280 (4k) blocks long.  Nothing to do!

e2fsck 1.47.0 (5-Feb-2023)
Pass 1: Checking inodes, blocks, and sizes
Pass 2: Checking directory structure
Pass 3: Checking directory connectivity
Pass 4: Checking reference counts
Pass 5: Checking group summary information
rootfs: 60292/128512 files (0.1% non-contiguous), 420249/513280 blocks

e2fsck 1.47.0 (5-Feb-2023)
Pass 1: Checking inodes, blocks, and sizes
Pass 2: Checking directory structure
Pass 3: Checking directory connectivity
Pass 4: Checking reference counts
Pass 5: Checking group summary information
rootfs: 60292/128512 files (0.1% non-contiguous), 420249/513280 blocks

resize2fs 1.47.0 (5-Feb-2023)
Resizing the filesystem on /dev/loop0p2 to 538880 (4k) blocks.
The filesystem on /dev/loop0p2 is now 538880 (4k) blocks long.

e2fsck 1.47.0 (5-Feb-2023)
Pass 1: Checking inodes, blocks, and sizes
Pass 2: Checking directory structure
Pass 3: Checking directory connectivity
Pass 4: Checking reference counts
Pass 5: Checking group summary information
rootfs: 60292/136544 files (0.1% non-contiguous), 420753/538880 blocks

root@raspberrypi:~# ./image-info /mnt/test.img

-rw-r--r-- 1 root root 2745171968 Dec  7 15:25 /mnt/test.img

Filesystem     Type     1K-blocks    Used Available Use%
boot           vfat        522230   62350    459880  12%
root           ext4       2082432 1609924    348348  83%

disk: PTUUID="d437763f" PTTYPE="dos"
boot: LABEL_FATBOOT="bootfs" LABEL="bootfs" UUID="83BC-4B02" BLOCK_SIZE="512" TYPE="vfat" PARTUUID="d437763f-01"
root: LABEL="rootfs" UUID="af945b54-5b3b-44f0-9590-578ca8dddadb" BLOCK_SIZE="4096" TYPE="ext4" PARTUUID="d437763f-02"

RonR
Posts: 3467
Joined: Tue Apr 12, 2016 10:29 pm
Location: US

Re: Image File Utilities

Thu Dec 07, 2023 9:41 pm

I just reran the same test using the same SSD on a Raspberry Pi 4B (instead of a Raspberry Pi 5) and I still can't reproduce the problem:

Code: Select all

root@raspberrypi:~# uname -a
Linux raspberrypi 6.1.0-rpi7-rpi-v8 #1 SMP PREEMPT Debian 1:6.1.63-1+rpt1 (2023-11-24) aarch64 GNU/Linux
root@raspberrypi:~# ./image-backup

Image file to create? /mnt/test-rpi4.img

Initial image file ROOT filesystem size (MB) [4026]?

Added space for incremental updates after shrinking (MB) [0]? 100

Create /mnt/test-rpi4.img (y/n)? y

Starting full backup (for incremental backups, run: ./image-backup /mnt/test-rpi4.img)
mount: (hint) your fstab has been modified, but systemd still uses
       the old version; use 'systemctl daemon-reload' to reload.
mount: (hint) your fstab has been modified, but systemd still uses
       the old version; use 'systemctl daemon-reload' to reload.

e2fsck 1.47.0 (5-Feb-2023)
Pass 1: Checking inodes, blocks, and sizes
Pass 2: Checking directory structure
Pass 3: Checking directory connectivity
Pass 4: Checking reference counts
Pass 5: Checking group summary information
rootfs: 60297/258048 files (0.1% non-contiguous), 439101/1030400 blocks

resize2fs 1.47.0 (5-Feb-2023)
Resizing the filesystem on /dev/loop0p2 to 601267 (4k) blocks.
The filesystem on /dev/loop0p2 is now 601267 (4k) blocks long.

resize2fs 1.47.0 (5-Feb-2023)
Resizing the filesystem on /dev/loop0p2 to 600410 (4k) blocks.
The filesystem on /dev/loop0p2 is now 600410 (4k) blocks long.

resize2fs 1.47.0 (5-Feb-2023)
Resizing the filesystem on /dev/loop0p2 to 600409 (4k) blocks.
The filesystem on /dev/loop0p2 is now 600409 (4k) blocks long.

e2fsck 1.47.0 (5-Feb-2023)
Pass 1: Checking inodes, blocks, and sizes
Pass 2: Checking directory structure
Pass 3: Checking directory connectivity
Pass 4: Checking reference counts
Pass 5: Checking group summary information
rootfs: 60297/153216 files (0.1% non-contiguous), 431514/600409 blocks

e2fsck 1.47.0 (5-Feb-2023)
Pass 1: Checking inodes, blocks, and sizes
Pass 2: Checking directory structure
Pass 3: Checking directory connectivity
Pass 4: Checking reference counts
Pass 5: Checking group summary information
rootfs: 60297/153216 files (0.1% non-contiguous), 431514/600409 blocks

resize2fs 1.47.0 (5-Feb-2023)
Resizing the filesystem on /dev/loop0p2 to 626009 (4k) blocks.
The filesystem on /dev/loop0p2 is now 626009 (4k) blocks long.

e2fsck 1.47.0 (5-Feb-2023)
Pass 1: Checking inodes, blocks, and sizes
Pass 2: Checking directory structure
Pass 3: Checking directory connectivity
Pass 4: Checking reference counts
Pass 5: Checking group summary information
rootfs: 60297/161280 files (0.1% non-contiguous), 432020/626009 blocks
mount: (hint) your fstab has been modified, but systemd still uses
       the old version; use 'systemctl daemon-reload' to reload.
mount: (hint) your fstab has been modified, but systemd still uses
       the old version; use 'systemctl daemon-reload' to reload.

root@raspberrypi:~# ./image-info /mnt/test-rpi4.img
mount: (hint) your fstab has been modified, but systemd still uses
       the old version; use 'systemctl daemon-reload' to reload.
mount: (hint) your fstab has been modified, but systemd still uses
       the old version; use 'systemctl daemon-reload' to reload.

-rw-r--r-- 1 root root 3102052352 Dec  7 15:37 /mnt/test-rpi4.img

Filesystem     Type     1K-blocks    Used Available Use%
boot           vfat        522230   62350    459880  12%
root           ext4       2385900 1609944    634380  72%

disk: PTUUID="d437763f" PTTYPE="dos"
boot: LABEL_FATBOOT="bootfs" LABEL="bootfs" UUID="ACB8-E7B3" BLOCK_SIZE="512" TYPE="vfat" PARTUUID="d437763f-01"
root: LABEL="rootfs" UUID="b47619c7-8e47-4c7e-8405-f79e479bf2b0" BLOCK_SIZE="4096" TYPE="ext4" PARTUUID="d437763f-02"

Return to “Advanced users”