-
Notifications
You must be signed in to change notification settings - Fork 411
Description
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
- Obtain
Fedora-Security-Live-x86_64-38-1.6.iso - Configure a VM in GNOME Boxes or libvirt with 4000 MB of RAM
- At the GRUB2 menu, choose a normal boot option like "Start Fedora-Security Live 38." Press
eto edit the boot options. Addrd.live.ram=1 rd.break rd.shellto the end of thelinuxoptions line. Pressctrl-xto boot. - Observe that dracut fails to mount the rootfs because
mountcan't recognize the filesystem. - Run
and verify that a
echo "something something something" >/run/initramfs/testfile
no space left on deviceerror occurs. Also verify that/run/initramfs/squashed.imgis smaller than it should be. - 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.imgthat is large enough to contain it; OR - Resize the existing tmpfs for
/runso that it is large enough to containsquashed.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