Filesystem of partition corrupt after swupdate

22 views
Skip to first unread message

Benjamin Schmid Ties

unread,
Jul 23, 2025, 10:16:29 AM7/23/25
to swupdate
I performed an update of an entire partition using swupdate raw mode and an image built using yocto with the following sw description:
software =
{
version = "0.1.0";
hardware-compatibility = ["1.0"];
images= (
{
filename = "core-image-full-cmdline-@@MACHINE@@.rootfs.ext4.gz";
type = "raw";
compressed="zlib"
device = "/dev/mmcblk0p3";
sha256 = "$swupdate_get_sha256(core-image-full-cmdline-@@MACHINE@@.rootfs.ext4.gz)";
}
);
}

These are the SWUpdate logs
[TRACE] : SWUPDATE running :  [parse_hw_compatibility] : Accepted Hw Revision : 1.0
[TRACE] : SWUPDATE running :  [_parse_images] : Found compressed Image: core-image-full-cmdline-raspberrypi0-2w-64.w
[TRACE] : SWUPDATE running :  [parse] : Number of found artifacts: 1
[TRACE] : SWUPDATE running :  [parse] : Number of scripts: 0
[TRACE] : SWUPDATE running :  [parse] : Number of steps to be run: 1
[TRACE] : SWUPDATE running :  [check_hw_compatibility] : Hardware rpi Revision: 1.0
[TRACE] : SWUPDATE running :  [check_hw_compatibility] : Hardware compatibility verified
[DEBUG] : SWUPDATE running :  [preupdatecmd] : Running Pre-update command
[TRACE] : SWUPDATE running :  [extract_files] : Found file
[TRACE] : SWUPDATE running :  [extract_files] :         filename core-image-full-cmdline-raspberrypi0-2w-64.rootfs.z
[TRACE] : SWUPDATE running :  [extract_files] :         size 121343720 required
[TRACE] : SWUPDATE running :  [extract_padding] : Expecting up to 512 padding bytes at end-of-file
[TRACE] : SWUPDATE running :  [network_initializer] : Valid image found: copying to FLASH
[INFO ] : SWUPDATE running :  Installation in progress
[TRACE] : SWUPDATE running :  [install_single_image] : Found installer for stream core-image-full-cmdline-raspberryw
[INFO ] : SWUPDATE successful ! SWUPDATE successful !


It looks like the update was successful. After mounting the partition and listing the files i get the following error:
root@raspberrypi0-2w-64:~# ls /mnt/root2/
ls: reading directory '/mnt/root2/': Bad message

filesystem could be repared with the following command and output
root@raspberrypi0-2w-64:~# fsck.ext4 /dev/mmcblk0p3
e2fsck 1.47.0 (5-Feb-2023)
/dev/mmcblk0p3 contains a file system with errors, check forced.
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
Free blocks count wrong (559062, counted=51273).
Fix<y>? yes
Free inodes count wrong (329783, counted=136261).
Fix<y>? yes

/dev/mmcblk0p3: ***** FILE SYSTEM WAS MODIFIED *****
/dev/mmcblk0p3: 11259/147520 files (0.2% non-contiguous), 96183/147456 blocks

What could be the reason?

Fabio Estevam

unread,
Jul 23, 2025, 8:48:52 PM7/23/25
to Benjamin Schmid Ties, swupdate
Hi Benjamin,

On Wed, Jul 23, 2025 at 11:16 AM Benjamin Schmid Ties
<benni.sc...@gmail.com> wrote:
>
> I performed an update of an entire partition using swupdate raw mode and an image built using yocto with the following sw description:
...
> What could be the reason?

File system corruption can occur if the update is performed on the
same partition from which the system is running.

Make sure that the partition you want to update is not the active one.

Regards,

Fabio Estevam
Reply all
Reply to author
Forward
0 new messages