Created attachment 1848326 [details] dracut config dropin file Description of problem: When initramfs is built to use systemd-networkd, it fails to mount an NFS root file system. Version-Release number of selected component (if applicable): dracut-055-6.fc35.x86_64 How reproducible: Always Steps to Reproduce: 1.Configure dracut with systemd-network-management and build initramfs 2. Boot with parameters root=nfs4:server:path 3. Actual results: Boot times out in initqueue due to not finding $NEWROOT/proc and eventually fails Expected results: Successful mount and boot Additional info: Dracut expects a boot command line parameter like "root=nfs4:server:path:flags". But systemd-fstab-generator creates a unit file with: What=nfs4:server:path:flags instead of What=server:path Type=nfs4 When you try and perform this mount, eg: systemctl start mnt-test.mount it generates the error: mount.nfs: Failed to resolve server nfs4: Name or service not known This can be verified by adding the rd.break=initqueue parameter and typing: systemctl cat sysroot.mount Unfortunately you can't use root=server:path rootfstype=nfs4 rootflags=flags (as expected by systemd-fstab-generator) because dracut doesn't handle this properly. Either systemd-fstab-generato needs to learn how to parse "root=nfs4:server:path:flags" arguments ore dracut needs to learn how to parse root=server:path rootfstype=nfs4 rootflags=flags (or both). There seems to be multiple bugs preventing this configuration working see also bug #1989119
Created attachment 1848327 [details] Bogus systemd.mount unit file
Hmm, dracut.cmdline(7) says: root=<path to blockdevice> specify the block device to use as the root filesystem. Example. root=/dev/sda1 root=/dev/disk/by-path/pci-0000:00:1f.1-scsi-0:0:1:0-part1 root=/dev/disk/by-label/Root root=LABEL=Root root=/dev/disk/by-uuid/3f5ad593-4546-4a94-a374-bcfb68aa11f7 root=UUID=3f5ad593-4546-4a94-a374-bcfb68aa11f7 root=PARTUUID=3f5ad593-4546-4a94-a374-bcfb68aa11f7 root=[<server-ip>:]<root-dir>[:<nfs-options>] mount nfs share from <server-ip>:/<root-dir>, if no server-ip is given, use dhcp next_server. If server-ip is an IPv6 address it has to be put in brackets, e.g. [2001:DB8::1]. NFS options can be appended with the prefix ":" or "," and are separated by ",". root=nfs:[<server-ip>:]<root-dir>[:<nfs-options>], root=nfs4:[<server-ip>:]<root-dir>[:<nfs-options>], root={dhcp|dhcp6} netroot=dhcp alone directs initrd to look at the DHCP root-path where NFS options can be specified. Example. root-path=<server-ip>:<root-dir>[,<nfs-options>] root-path=nfs:<server-ip>:<root-dir>[,<nfs-options>] root-path=nfs4:<server-ip>:<root-dir>[,<nfs-options>] root=/dev/nfs nfsroot=[<server-ip>:]<root-dir>[:<nfs-options>] Deprecated! kernel Documentation_/filesystems/nfsroot.txt_ defines this method. This is supported by dracut, but not recommended. Looking around on the net, I see e.g. https://rags.wordpress.com/2012/03/20/using-nfsroot-to-boot-diskless-clients-on-rhel/ which implies that root=nfs:… and root=nfs4:… worked at various points. I think we don't have much choice but to add support for this in systemd-network-generator. @yuwata, wdyt?
Created attachment 1849020 [details] Dodgy workaround.
(In reply to Zbigniew Jędrzejewski-Szmek from comment #2) > Hmm, dracut.cmdline(7) says: > > root=<path to blockdevice> > specify the block device to use as the root filesystem. > > Example. > > root=/dev/sda1 > root=/dev/disk/by-path/pci-0000:00:1f.1-scsi-0:0:1:0-part1 > root=/dev/disk/by-label/Root > root=LABEL=Root > root=/dev/disk/by-uuid/3f5ad593-4546-4a94-a374-bcfb68aa11f7 > root=UUID=3f5ad593-4546-4a94-a374-bcfb68aa11f7 > root=PARTUUID=3f5ad593-4546-4a94-a374-bcfb68aa11f7 > > root=[<server-ip>:]<root-dir>[:<nfs-options>] > mount nfs share from <server-ip>:/<root-dir>, if no server-ip is > given, use > dhcp next_server. If server-ip is an IPv6 address it has to be > put in > brackets, e.g. [2001:DB8::1]. NFS options can be appended with > the prefix > ":" or "," and are separated by ",". > > root=nfs:[<server-ip>:]<root-dir>[:<nfs-options>], > root=nfs4:[<server-ip>:]<root-dir>[:<nfs-options>], root={dhcp|dhcp6} > netroot=dhcp alone directs initrd to look at the DHCP root-path > where NFS > options can be specified. > > Example. > > root-path=<server-ip>:<root-dir>[,<nfs-options>] > root-path=nfs:<server-ip>:<root-dir>[,<nfs-options>] > root-path=nfs4:<server-ip>:<root-dir>[,<nfs-options>] > > root=/dev/nfs nfsroot=[<server-ip>:]<root-dir>[:<nfs-options>] > Deprecated! kernel Documentation_/filesystems/nfsroot.txt_ > defines this > method. This is supported by dracut, but not recommended. > > > Looking around on the net, I see e.g. > https://rags.wordpress.com/2012/03/20/using-nfsroot-to-boot-diskless-clients- > on-rhel/ > which implies that root=nfs:… and root=nfs4:… worked at various points. > > I think we don't have much choice but to add support for this in > systemd-network-generator. > > > @yuwata, wdyt?
(In reply to Ian Dall from comment #0) Fixing this bug is sufficient for the case where <server> is an ip address. Where <server> is a domain name, bug #2037311 comes into play.
https://github.com/systemd/systemd/pull/22013
Created attachment 1926021 [details] Patch to generate sysroot.mount for nfs mounts. This module relies on a generator to create a sysroot.mount unit. However in rootfs-generator.sh, line 106, generator_mount_rootfs is only run if there is no 'root=' argument and generator_mount_rootfs immediately returns 0 if $root is an empty string, so this line apparently did nothing. However systemd-fstab-generator is also installed. The this module did not work for NFS roots (bailing if rootok is not 1). Also, current systemd-fstab-generator bails for nfs types. Add code to create a sysroot.mount unit for the nfs case. This does not work if root is dhcp, but we bail in that case and are no worse off. The systemd-networkd does not provide a documented way to get parameters out of the dhcp response. Maybe using a legacy dhcp module works (untested).
This bug is still present in Fedora 36, however, since this bug was originally submitted there has been a relevant change to systemd-fstab-generator so that is now bails on nfs root filesystems. This means the earlier (admittedly dodgy) patch no longer works, but opens the way to a better (less dodgy) solution of modifying dracut-rootfs-generator.
This message is a reminder that Fedora Linux 35 is nearing its end of life. Fedora will stop maintaining and issuing updates for Fedora Linux 35 on 2022-12-13. It is Fedora's policy to close all bug reports from releases that are no longer maintained. At that time this bug will be closed as EOL if it remains open with a 'version' of '35'. Package Maintainer: If you wish for this bug to remain open because you plan to fix it in a currently maintained version, change the 'version' to a later Fedora Linux version. Thank you for reporting this issue and we are sorry that we were not able to fix it before Fedora Linux 35 is end of life. If you would still like to see this bug fixed and are able to reproduce it against a later version of Fedora Linux, you are encouraged to change the 'version' to a later version prior to this bug being closed.
This message is a reminder that Fedora Linux 37 is nearing its end of life. Fedora will stop maintaining and issuing updates for Fedora Linux 37 on 2023-12-05. It is Fedora's policy to close all bug reports from releases that are no longer maintained. At that time this bug will be closed as EOL if it remains open with a 'version' of '37'. Package Maintainer: If you wish for this bug to remain open because you plan to fix it in a currently maintained version, change the 'version' to a later Fedora Linux version. Note that the version field may be hidden. Click the "Show advanced fields" button if you do not see it. Thank you for reporting this issue and we are sorry that we were not able to fix it before Fedora Linux 37 is end of life. If you would still like to see this bug fixed and are able to reproduce it against a later version of Fedora Linux, you are encouraged to change the 'version' to a later version prior to this bug being closed.
Fedora Linux 37 entered end-of-life (EOL) status on None. Fedora Linux 37 is no longer maintained, which means that it will not receive any further security or bug fix updates. As a result we are closing this bug. If you can reproduce this bug against a currently maintained version of Fedora Linux please feel free to reopen this bug against that version. Note that the version field may be hidden. Click the "Show advanced fields" button if you do not see the version field. If you are unable to reopen this bug, please file a new report against an active release. Thank you for reporting this bug and we are sorry it could not be fixed.