[lug] Convertion of ext4 Sparse Files

stimits at comcast.net stimits at comcast.net
Fri Jan 5 18:40:07 MST 2018


If I run fsck -v -n directly on the file it just spits out the help menu of fsck. If I run this on a loopback device covering the file:
# fsck -v -n /dev/loop0fsck from util-linux 2.30.2e2fsck 1.43.5 (04-Aug-2017)ext2fs_open2: Bad magic number in super-blockfsck.ext2: Superblock invalid, trying backup blocks...fsck.ext2: Bad magic number in super-block while trying to open /dev/loop0The superblock could not be read or does not describe a valid ext2/ext3/ext4filesystem.  If the device is valid and it really contains an ext2/ext3/ext4filesystem (and not swap or ufs or something else), then the superblockis corrupt, and you might try running e2fsck with an alternate superblock:    e2fsck -b 8193 <device> or    e2fsck -b 32768 <device> 
So it seems to be as feared...this must be a custom sparse image and not standard.
 
----- Original Message -----From: Aaron D. Johnson <adj at fnord.greeley.co.us>To: Boulder (Colorado) Linux Users Group -- General Mailing List <lug at lug.boulder.co.us>Sent: Sat, 06 Jan 2018 00:52:28 -0000 (UTC)Subject: Re: [lug] Convertion of ext4 Sparse Files

stimits at comcast.net writes:

> The base systems tested on all run ext4. Fedora 23 through 27, plus> Ubuntu 16.04. The partition this data belongs to is a root partition> on an embedded system and is also ext4 (Ubuntu 16.04), without> 64-bit extensions...it's plain vanilla ext4.> > A copy of the sparse image was archived, but someone who needs to> loopback mount this and edit without destroying a working system> wants to know how to convert this back from sparse to> non-sparse. The sparse image cannot be loopback mounted...perhaps it> should be possible, but it isn't. That famous phrase the I.T. guy> fears hearing when asked what's wrong: "It don't work!".> > This sparse image was, at one point, flashed onto the embedded> system. A clone can be created via dd, and the clone is an exact> match of the non-sparse original image. There is a guarantee that> when the original system was turned into sparse, and expanded during> flash to occupy the full partition, that everything was correctly> preserved...else it would not be possible for the clone to match the> original. This is my original and my clone.>> The other guy looking for help has only an inherited sparse image> and a system he can't destroy. I've seen this enough times it just> seems like it should be possible to convert sparse back to full size> and loopback mount, but I'm starting to fear the sparse format> involved has something odd or non-standard about it since none of> the usual tools work with it.

I'm going to agree with Zan's recently reply. There's probablysomething odd about your image files.

What does "file /path/to/sparse-image-file" say? If it says"ext[234]" what does "fsck -v -n /path/to/sparse-image-file" say? Arethere any intersting stdout or stderr messages when the attempts tomount it fail? What about kernel messages? (Run "dmesg" to getthose.)

- Aaron_______________________________________________Web Page: http://lug.boulder.co.usMailing List: http://lists.lug.boulder.co.us/mailman/listinfo/lugJoin us on IRC: irc.hackingsociety.org port=6667 channel=#hackingsociety
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lug.boulder.co.us/pipermail/lug/attachments/20180106/39ff5115/attachment-0001.html>


More information about the LUG mailing list