[lug] Convertion of ext4 Sparse Files

stimits at comcast.net stimits at comcast.net
Fri Jan 5 17:01:31 MST 2018


Filesystem type is ext4 without any of the 64bit or csum_metadata extensions. Plain and simple. When I copy this partition via dd I can "sudo mount -o loop,ro file.img /mnt" without issue...this includes the file as it was originally created, plus the file which is taken from the written partition which in turn was written via a sparse image of the original.
 
I didn't make it sparse, an embedded system flash tool did this. The tool copies large partitions over USB2, e.g., 15 to 30GB. The tool added conversion to a sparse image prior to flashing in order to save time (literally, hours). Some people have inherited sparse images they want to use on loopback mount without re-flashing, but the sparse images cannot be loopback mounted. So conversion back to the original non-sparse format is desired.
 
I am beginning to think the tool converting to sparse does something odd, but everything I can see other than this tends to say the tool is entirely generic.
 
----- Original Message -----From: Zan Lynx <zlynx at acm.org>To: lug at lug.boulder.co.usSent: Fri, 05 Jan 2018 23:31:43 -0000 (UTC)Subject: Re: [lug] Convertion of ext4 Sparse Files

On 1/5/2018 2:55 PM, stimits at comcast.net wrote:> cp with "--sparse=never" does not work (I'm trying on Fedora 23 through > 27, plus Ubuntu 16.04).

You haven't said what your filesystem is or what options it is mounted with. If it is using compression this could happen. Or some filesystems might be doing block deduplication. In both cases a string of zeros in a file will disappear. ZFS, XFS and btrfs are very smart. Anything might happen.

You also haven't said why you need it as non-sparse. There may be some other way to get to what you want._______________________________________________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/3f5a3e7a/attachment.html>


More information about the LUG mailing list