# Read only compressed rootfs in raw flash?

**URL:** <https://hub.mender.io/t/read-only-compressed-rootfs-in-raw-flash/950>\
**Category:** General Discussions\
**Created:** [August 20, 2019, 6:42am UTC](https://hub.mender.io/t/read-only-compressed-rootfs-in-raw-flash/950 "2019-08-20T06:42:31Z")\
**Posts on this page:** 1\
**Showing post:** 9

<div class="post-metadata">

**Author:** ![samlewis](https://yyz2.discourse-cdn.com/flex036/user_avatar/hub.mender.io/samlewis/32/393_2.png) [@samlewis](https://hub.mender.io/u/samlewis)\
**Post date:** [August 22, 2019, 9:06am UTC](https://hub.mender.io/t/read-only-compressed-rootfs-in-raw-flash/950/9 "2019-08-22T09:06:26Z")

</div>

Great, I will proceed with this approach then! There does seem to be a slight lack of references for using Mender with raw flash (the documentation is a good starting point but there’s seemingly a large amount of manual integration still needed after what’s prescribed there) and I would think that using squashfs/flash would be a fairly common use case for embedded devices so, if there’s interest and I get something working, I might contribute my findings back to the community with a blog post. Will update here if I do so. 🙂

I did get a fitImage with kernel, dtb and squashfs (xz compressed) booting on my hardware today, although I manually hacked it all together. Will have to look into getting it built with yocto, so thanks for your comments on that! The only other downside I didn’t mention before is that the squashfs filesystem is copied to a RAM disk on boot (as you mention above), rather than being read from flash as it would in your initial approach. I’m lucky in that I have an abundance of RAM (512MB) and a fairly small compressed rootfs (~30MB) so I think it is ok for me, but worth noting.

Because of the copy to RAM disk, I also needed to increase the `ramdisk_size` that the kernel used. I’m still trying to find if there’s any downside (apart from using up a chunk of memory) but, so far, it seems ok.

On the brightside, it is a bit of a simplification that Mender doesn’t need to modify `bootargs` in uboot in order to boot, because the bootargs of `root=/dev/ram0` work regardless of which ubi volume it boots from.

---

_[View the full topic](https://hub.mender.io/t/read-only-compressed-rootfs-in-raw-flash/950)._
