[elbe-devel] corrupt msdoshd image: two zeroed blocks at the end of partition

Strohmer Timo TStrohmer at de.pepperl-fuchs.com
Mon Sep 25 14:29:21 CEST 2023


Hi everyone, I'm not sure if this is the correct place to file this issue.

We are running ELBE 14.9 within a container to create a single-partition ext4 msdoshd-image.

Since we have reduced the partition-size from 1GiB to 512MiB (approx. 350MiB are in use), we encounter zeroing of the last two blocks (131070 and 1310712, 4k block-size) of the partition. The file data located in these blocks is corrupted as a result (obviously, the smaller partition is more likely to have any data located there).

As a workaround, we added a second 1MiB dummy partition, leading to an intact first partition.

We also inspected the tar package of the rfs, but found no corruption in the file that was affected in the image. Hence we assume that something goes wrong when elbe is allocating the space for the image-file within the initvm to create the partition using a loop device.

Is there a known error in this direction? Maybe this is worth investigating, since this error can have unforeseen effects at runtime.

Regards
Timo


Used elbe.xml:
	<target>
		<package><tar><name>image.tgz</name></tar></package>
		<images>
			<msdoshd>
				<name>image.img</name>
				<size>513MiB</size> <!-- actual size + 1 MiB MBR sector -->
				<partition>
					<size>512MiB</size>
					<label>rfs</label>
				</partition>
			</msdoshd>
		</images>
		<fstab>
			<bylabel>
				<label>rfs</label>
				<mountpoint>/</mountpoint>
				<fs>
					<type>ext4</type>
					<fs-finetuning><device-command>tune2fs -i 0 {device}</device-command></fs-finetuning>
				</fs>
				<options>ro</options>
			</bylabel>
		</fstab>



More information about the elbe-devel mailing list