I posted this to developers of squash and get no response, so I will try here.
Is it at all possible to mount a created disk image inside a squash archive ?
I failed to do it.
As root user
I create a squash file system of the diskimage called
devsda1.img.sqsh
I create two empty directories
/mount1
/mount2
I mount devsda1.img.sqsh
# mount devsda1.img.sqsh /mount1
I tried also with “-t squashfs” option but it mounts the same both ways and makes no difference to result below.
then cd’ing to /mount1 I can see the original image before compression namely devsda1.img
However when I try to mount the original image inside the squash mount, I get the following error.
# cd /mount1
# mount -o ro,loop devsda1.img /mount2
mount: /mount2: cannot mount /dev/loop1 read-only.
I obviously tried with -o loop too, no change (rw).
Surely I must be misunderstanding something as the failure to mount the image is the sole benefit of squashfs over archives like gzip and others only, since you dont have to extract before being able to mount the image inside the squash archive.
So what do I do wrong ?