Recently I found out that it's possible to use overlayroot with tmpfs to create stateless readonly root. However I couldn't find any info about limiting the size of tmpfs. Is it possible?
Yes, you can specify the size of a
tmpfs using the
size mount option, or the
nr_blocks option. With
size, you can specify the size in bytes (or kibibytes, or mebibytes, or gibybytes), or as a percentage of installed memory.
The size of a
tmpfs can be changed on remount, after the initial setup, so with
overlayroot you could reduce the size of the file system by remounting