Grub-live improvement - overlay-mount.sh - add, increase size= mount command parameter

Hi!
To increase the disk size in live mode on Kicksecure and Whonix, perform the following steps:

  1. Open a terminal in sysmaint mode and enter:
    sudo nano /usr/lib/dracut/modules.d/90overlay-root/overlay-mount.sh
  2. Find the line mount -n -t tmpfs -o mode=0755 tmpfs /cow and add the parameter size=100% to it, so it looks like this: mount -n -t tmpfs -o mode=0755,size=100% tmpfs /cow. Then press Ctrl+O and Ctrl+X.
  3. Update dracut by entering the command:
    sudo dracut --force.

@Patrick, Hello! Maybe this should be done by default in Kicksecure and Whonix? I’ve been using live mode with 100% memory for a long time and I haven’t had any issues with performance or freezing. This would allow for comfortable use of live mode even for virtual disks with 4GB of memory

I have moved this post from Whonix in live mode in Qubes OS! Amnesia and anti-forensics mode - which is about Qubes - to here, its own dedicated forum thread, as the grub-live implementation is totally different.

Upstream of file /usr/lib/dracut/modules.d/90overlay-root/overlay-mount.sh is: GitHub - dracut-ng/dracut-ng: dracut - the event driven initramfs infrastructure

Could you please suggest and/or contribute this change there?

See also:
grub-live, Developer Information

Oh, I understand. grub-live works on the default module. A Debian update will revert to the previous state and remove the size. Perhaps it’s worth adding a wiki for users who need to increase the live disk size to the maximum.

Patrick, could you add it suggestion to the github - I’m not registered on github, but you are a very respected developer on github, your authority can expedite the review and approval of this change soon.

It’s quite strange that this module only uses half of the memory by default. I didn’t find any information about this. I thought it could lead to freezing or performance degradation. So I set the size to 70-80%. But then I set size=100% and everything worked perfectly. My friend has an old computer with 6 GB of ram and he uses the live mode in Kicksecure comfortably with size=100%

If it will not be considered on github or will be rejected, you can create a script that checks overlay-mount.sh and adds size after Debian updates. And try size=100% on your own computers - I may be unaware of something, but I haven’t encountered any issues with Kicksecure, Whonix, and Debian after increasing tmpfs size. @arraybolt3 try it too please

No, that’s a wrong assumption. I don’t have any special standing in the dracut-ng repository whatsoever.

I meant your authority and respect on github. You are a recognizable and well-known developer

From prior experience I can tell, my word on dracut-ng does not receive special treatment whatsoever. I haven’t witnessed any higher/lower engagement, agreement, disagreement, action taking based on my comments/contributions versus others.

(Note: This is just a statement of fact. Everything is alright.)

Oh. Then it can be done in a new helper script in a new version of Kicksecure. Perhaps, dracut does not add tmpfs size due to certain specific situations… But these situations do not concern Kicksecure and Whonix. The old name of the live mode is live mode (for daily activity). However, default live disk in Kicksecure-VM and Whonix has less than 2 GB of free space. It may run out after testing several Flatpak applications, and system may hang. Some complaints about Whonix hanging might be related to lack of space in live sessions. The virtual live disk will have 3.7 GB of free space if you add size=100% - this is already very comfortable. It allows storing large secret file storage, testing Flatpak, AppImage, and Podman. This will allow running Whonix on a Kicksecure host even with 8 GB of memory.

This should not be the first instinct. Reasons:

Best to ask upstream.

1 Like

According to dracut.cmdline(7) - Linux manual page, the current recommended way of setting the size of the live writable overlay is:

      The command: mount -o remount,size=<nbytes> /run will resize
      this virtual filesystem after booting.

That being said, I filed a feature request here: Allow setting the overlayfs size when using rd.live.overlay.overlayfs · Issue #1510 · dracut-ng/dracut-ng · GitHub

2 Likes

thanks!

1 Like

So, I conducted tests and ran overlayfs with size=100% on Debian, Ubuntu, Fedora and Arch. Then, I ran various programs, trying to increase the memory load, but there were no performance issues. It works great in all distros

1 Like

I’ve conducted tests with overlayfs and published the results here Whonix in live mode in Qubes OS! Amnesia and anti-forensics mode - #20 by bigboy.

In this comment, I’ll just add the test results with size=100%: you’ll feel a very strong memory load when working with virtual machines in live mode. However, size=100% had no effect on it. I tested memory load in Qubes with size=100%, 90%, 80%, and 70% - it made no difference. The memory consumption remained the same, and I launched the same number of virtual machines each time. The only thing that changed was the free disk space

So, size=100% is the most efficient for working in live mode