1

I'm trying to mount the rootfs / of a Debian Buster system as overlayfs because I'm interested in using tmpfs for the /upper directory. My idea is to use this to preserve the root filesystem integrity by making it fake-writable. I know there are a few packages intended to do this, like fsprotect and bilibop-lockfs, however I thin the former one is maybe a little outdated and the latter one seems to be more promising, but both use aufs and I'd like to learn about initrd and this early user space and the Linux booting process, maybe in a future I'll consider to try bilibop-lockfs.

Anyway ... my script is based on the current raspi-config script; as you can see I'm basically adding the very same script as an initramfs module and rebuilding, then this module is being triggered when boot=overlay is passed as a kernel command line parameter. This script apparently does the work of mounting the rootfs as an overlayfs, however ... I'm having problems with the following; as you can see in the df -h output, it shows the size is just 3.9G

Filesystem      Size  Used Avail Use% Mounted on
udev            3.8G     0  3.8G   0% /dev
tmpfs           781M   17M  764M   3% /run
overlay         3.9G  1.2G  2.7G  30% /
tmpfs           3.9G     0  3.9G   0% /dev/shm
tmpfs           5.0M     0  5.0M   0% /run/lock
tmpfs           3.9G     0  3.9G   0% /sys/fs/cgroup
/dev/mmcblk1p2  236M   96M  123M  44% /boot
/dev/mmcblk1p1  511M  5.2M  506M   2% /boot/efi
/dev/mmcblk0p1   58G  811M   54G   2% /data
tmpfs           781M     0  781M   0% /run/user/1001

And some programs are having problems with this size because when they are running a while, they start to print "no left space on the device" in the journal logs. My question is ... what's specifying this size? I cannot see anything about the size in the overlay script. Could I set a bigger size to give a wider margin for those programs?

Thank you all.

1 Answer 1

1

Well, I didn't realized that you can choose a specific size in the mountoptions when you are mounting a tmpfs; from the tmpfs manpage:

Mount options
       The tmpfs filesystem supports the following mount options:

       size=bytes
              Specify an upper limit on the size of the filesystem.  The
              size is given in bytes, and rounded up to entire pages.

              The size may have a k, m, or g suffix for Ki, Mi, Gi
              (binary kilo (kibi), binary mega (mebi), and binary giga
              (gibi)).

              The size may also have a % suffix to limit this instance
              to a percentage of physical RAM.

              The default, when neither size nor nr_blocks is specified,
              is size=50%.

So replacing the line 86 into my script with this:

mount -t tmpfs -o size=100% tmpfs /upper

The system doesn't report problems with the free space anymore.

You must log in to answer this question.

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