Briefly: Is it possible to reserve some free space using mksquashfs?

I'm creating an image of simple livecd based on squashfs filesystem. Everything works fine except that I've got very little "free" space on a root partition.

Can I assign more free space with mksquashfs?

For now as I workaround I'm mounting ramfs after livecd boot. Another idea will be to create a large file on squashfs, pack it using mksquashfs and delete it after bootup.

Is there any "clean" solution?

  • 5
    Squashfs is a read-only filesystem. It is not possible to have free space, because it's not possible to write to it after it is created.
    – phemmer
    Jul 16, 2014 at 15:00
  • Patrick is correct. Even if you had free space on squashfs, it would be wasted, because it is read-only. What you want is more writable space. To get that, you need to mount temporary partitions using RAM memory.
    – Sepero
    Jul 16, 2014 at 17:07
  • Ok, I was sure that it exists within a RAM and is writeable (as live CD allows me to edit files within /).
    – Dejwi
    Jul 17, 2014 at 6:52
  • 2
    @Dejwi Live CDs do this by using an overlay filesystem with writes backed by a tmpfs volume (i.e. aufs + tmpfs)
    – phemmer
    Jul 21, 2014 at 14:26

1 Answer 1



you can, first, mount the filesystem on /mnt or anywhere else

sudo mount /dev/sda2 /mnt

create a dummy file that makes mksquashfs think it has more space

truncate -s 5G /mnt/dummyfile

You can change the size and the name and location of the dummy file

now just create the image

mksquashfs /mnt root.squashfs

and all done

  • 2
    Have you tried this yourself? How much free space you had in a squashfs? How are you going to use that space afterwards? Did you read the comments to the question, which explain why is this question incorrect and therefore can not possibly have any meaningful answer? Jul 26, 2023 at 18:19

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .