[TriLUG] mount -o loop on a gzipped image?

Joel Ebel jbebel at ncsu.edu
Wed Oct 5 15:12:16 EDT 2005


You can't just put a gzipped filesystem on a loopback device.  The 
loopback device isn't capable of handling gzipping.  It seems like 
something that could be possible at least for a read only filesystem, 
but for something read/write, managing that within a gzipped file would 
be difficult.  In any case, there's no way to do that quite yet with the 
normal losetup tool.

As for mounting partitions within a loopback filesystem, I don't think 
that's particularly easy either.  What comes to mind is to extract the 
partition table, analyze it for the blocks for each partition, then 
extract that partition into a separate file with dd.  Alternatively, you 
might be able to use the --offset option to losetup, though I've never 
tried that.

A google search turns up a discussion of something like this here:
http://edseek.com/~jasonb/articles/linux_loopback.html

Joel

Brian Henning wrote:
> Hi Y'all,
>   I've created a compressed image of a drive using g4u.  The drive is
> 70GB; the image is about 10GB (lots of empty space).  My question is
> twofold:
> 
> 1) Is it possible to somehow filter mount through gzip so that I can do
> a loopback mount on a zipped image without needing to unzip the image?
> I do not have 70GB free in which to unzip.
> 
> 2) If the image contains multiple partitions, can I do #1 and also
> choose a particular partition to mount within the image?
> 
> I want to do this just as sanity-checking to make sure g4u did the Right
> Thing.  Because this is $boss's wife's laptop being sent for service,
> and losing all the data would probably take my job along with it.
> 
> I'm looking through manpages and googling also, but I thought I would
> pose the question to the list as well.
> 
> Thank all!
> 
> Cheers,
> ~Brian
> 



More information about the TriLUG mailing list