Skip to content

rd.live.ram=1 may fill up /run if tmpfs is too small #2550

@cbs228

Description

@cbs228

Describe the bug
Many distros now cap the total size of the /run filesystem at a relatively small percentage of RAM. For example, Fedora Security Live F38 on a VM with 4 GB of RAM caps /run at only 779.89 MB. This is not enough to contain the complete ISO when rd.live.ram=1 is requested. When dracut writes the rootfs image to /run/initramfs/squashed.img, it fills up /run and fails the boot.

Distribution used
Fedora Security Live F38

Dracut version
059-2.fc38

Init system
systemd-253.2-1.fc38

To Reproduce

  1. Obtain Fedora-Security-Live-x86_64-38-1.6.iso
  2. Configure a VM in GNOME Boxes or libvirt with 4000 MB of RAM
  3. At the GRUB2 menu, choose a normal boot option like "Start Fedora-Security Live 38." Press e to edit the boot options. Add rd.live.ram=1 rd.break rd.shell to the end of the linux options line. Press ctrl-x to boot.
  4. Observe that dracut fails to mount the rootfs because mount can't recognize the filesystem.
  5. Run
    echo "something something something" >/run/initramfs/testfile
    and verify that a no space left on device error occurs. Also verify that /run/initramfs/squashed.img is smaller than it should be.
  6. tmpfs size may be queried with
    cat /proc/self/mountinfo

Expected behavior
I believe that dracut dmsquash-live and livenet should either:

  • Create a tmpfs just for squashed.img that is large enough to contain it; OR
  • Resize the existing tmpfs for /run so that it is large enough to contain squashed.img.

Without changes to dracut, distros that want to support rd.live.ram will need to ensure that /run/initramfs is large enough.

Additional context
Requesting rd.live.ram=1 on a system with not enough memory may put the system under severe memory pressure. #2344 adds the capability to check for this, and we probably don't need to second-guess this check.

The tmpfs(5) default size is 50% of memory. The default size should be large enough on most modern hardware to contain a live image of "reasonable" size. It is clear that some distos opt for a lower size limit for /run.

See also downstream bug RH-2035641

Metadata

Metadata

Assignees

No one assigned

    Labels

    stalecommunication is stuck

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions