[TriLUG] fsck'ing an image vs a partition

Brian via TriLUG trilug at trilug.org
Tue Oct 25 10:30:52 EDT 2022


Hi Gang,

I've got a head-scratcher.  I have an image of an ext4 filesystem, and a 
microSD card.  I can run fsck -f on the image file and it reports no 
errors.  I dd the image onto the SD's first partition (which is more 
than large enough for it).  I dd the image BACK from the SD card into 
another file, diff the two files and they're identical.  HOWEVER, when I 
fsck the SD partition, there are errors galore.

What gives?  Why would the same collection of bytes fsck differently 
being a file versus an actual block device?

Command history:

dd if=p1.img of=/dev/sda1
dd if=/dev/sda1 of=what.img bs=512 count=...
diff what.img p1.img 		// no differences
fsck -f p1.img			// no errors
fsck -f what.img		// no errors
fsck -f /dev/sda1		// errors galore

Thanks,
-Brian


More information about the TriLUG mailing list