If I make a disk image and compress it with gzip/xz/etc is there a way to mount it directly without first uncompressing it?
Say I've used
sudo dd if=/dev/sdc1 | gzip -9 > image1.dd.gz
how can I mount the original image, without creating an uncompressed copy first?
Or I've used
sudo dd if=/dev/sdc | gzip -9 > wholedisk.dd.gz
and the disk has multiple partitions, would that make it any harder?
With an uncompressed image of a whole disk then using kpartx
or newer versions of losetup
with it's -P
flag should create a loop for each partition.
But is there a way to mount/losetup/read the compressed image?
If it won't work for gzip/xz, is there any compression method this would work for?
Note on duplicate Q
The currently suggested duplicate
- Mount single partition from image of entire disk (device) , while being an excellent useful Q
DOES NOT USE COMPRESSION, and IS NOT A DUPLICATE.
mount
will not mount a compressed image by itself.