You are not logged in.

#1 2013-05-24 06:12:42

kokoko3k
Member
Registered: 2008-11-14
Posts: 2,423

[BUG?] rootdelay with nfs root

I've a pxe system that mounts "/" over nfs, and i noticed that the 10 seconds  the system waits for /dev/nfs always timeout, on every boot.
but after that, the system boots fine and the nfs mounts are available.
changing rootdelay kernel parameter to a lower value (even just 1 second) , makes the system boots faster and fine;
so it seems that for nfs roots, the system is not aware of when the filesystem is available, and it just wait for the entire rootdelay time.
is this expected?

thanks

Last edited by kokoko3k (2013-05-24 11:10:08)


Help me to improve ssh-rdp !
Retroarch User? Try my koko-aio shader !

Offline

#2 2013-05-24 07:38:26

WonderWoofy
Member
From: Los Gatos, CA
Registered: 2012-05-19
Posts: 8,414

Re: [BUG?] rootdelay with nfs root

Instead of using the kernel's rootdelay parameter, have you thought about using rootwait?  Or better yet, since you are using the initamfs to boot this NFS share, you should probably be using the "sleep" hook for mkinitcpio.  This will allow you to either use a simple "sleep=<time>" or probably more appropriately, "sleepdevice=<device node>".

I think the rootdelay and rootwait parameters are for when the kernel is booting w/o an initramfs.  I could be totally wrong, but this is the impression that i have gotten in the past.

Offline

#3 2013-05-24 08:31:36

kokoko3k
Member
Registered: 2008-11-14
Posts: 2,423

Re: [BUG?] rootdelay with nfs root

I wasn't clear enough.
For my nfs root, rootdelay (which defaults to 10 secs if not speicifed otherwise), acts exactly like the sleep hook.
I mean, i don't need the system to wait 10 seconds.

this is the boot line for pxelinux:

default menu.c32
prompt 0
timeout 2
ONTIMEOUT arch

MENU TITLE Main Menu

LABEL arch
        MENU LABEL ArchLinux
        kernel /archlinux/boot/vmlinuz-linux
        append initrd=archlinux/boot/initramfs-linux-fallback.img rootfstype=nfs root=/dev/nfs nfsroot=192.168.117.244:/home/tftproot/archlinux/,rsize=16384,wsize=16384 ip=::::::dhcp  init=/usr/lib/systemd/systemd rootdelay=1

If i omit the rootdelay parameter, the system waits 10 seconds and boots fine.
If i specify rootdelay=1, it just wait 1 second, and boots fine too.

The question is... how can tell him to boot as soon as nfs is available without useless delays?

Last edited by kokoko3k (2013-05-24 08:55:22)


Help me to improve ssh-rdp !
Retroarch User? Try my koko-aio shader !

Offline

#4 2013-05-24 11:09:53

kokoko3k
Member
Registered: 2008-11-14
Posts: 2,423

Re: [BUG?] rootdelay with nfs root

Update:
I went deeper into this,
The problem is (seems to be) that the init function: poll_device() in /usr/lib/initcpio/init_functions,
waits for the device /dev/nfs (specified in the kernel command line) to be available.
But /dev/nfs will never show up because:

https://www.kernel.org/doc/Documentation/filesystems/nfs/nfsroot.txt wrote:

root=/dev/nfs

  This is necessary to enable the pseudo-NFS-device. Note that it's not a
  real device
but just a synonym to tell the kernel to use NFS instead of
  a real device.

To make the long story short:
- the kernel needs root=/dev/nfs in order to boot from nfs
- arch init waits for /dev/nfs
- /dev/nfs does not appear because is not meant to be a real device

1) Is this a bug in the arch init system or am i missing something?
2) Is it safe to put rootdelay=0 so that nfsmount waits for the mount to appear or i could risk that the system will not boot?

by now rootdelay=0 works, but i'm pushing that nfs exports to about 60 clients, so i need to be sure.

Thanks.

Last edited by kokoko3k (2013-05-24 11:12:41)


Help me to improve ssh-rdp !
Retroarch User? Try my koko-aio shader !

Offline

#5 2024-10-12 08:03:54

manio
Member
Registered: 2021-05-05
Posts: 10

Re: [BUG?] rootdelay with nfs root

@kokoko3k
Any issues with this rootdelay=0 ?
I was waiting 10 seconds for nothing every boot for years (hopefully I am not rebooting very often), but yesterday I upgraded from NFSv3 to NFSv4 and I also decided to put this in kernel commandline.
So far it seems that it is working OK. It's waiting about 1-2sec instead of 10 !

Offline

#6 2024-10-12 16:09:38

WorMzy
Administrator
From: Scotland
Registered: 2010-06-16
Posts: 12,437
Website

Re: [BUG?] rootdelay with nfs root

Mod note: closing this old thread.

https://wiki.archlinux.org/title/Genera … bumping%22


Sakura:-
Mobo: MSI MAG X570S TORPEDO MAX // Processor: AMD Ryzen 9 5950X @4.9GHz // GFX: AMD Radeon RX 5700 XT // RAM: 32GB (4x 8GB) Corsair DDR4 (@ 3000MHz) // Storage: 1x 3TB HDD, 6x 1TB SSD, 2x 120GB SSD, 1x 275GB M2 SSD

Making lemonade from lemons since 2015.

Offline

Board footer

Powered by FluxBB