2003-07-22 14:16:57

by Herbert Poetzl

[permalink] [raw]
Subject: noaltroot bootparam [was Floppy Fallback]


Hi Everyone!

Trond suggested to draft a patch to address the
Floppy Fallback issues (mentioned several times
on lkml) by adding a kernel boot parameter, to
disable the fallback, or to put it more general,
to disable alternate root device attempts ...

Currently the NFS-Root Floppy Fallback is the
only _user_ of such a boot parameter, but in
future, this could be used to limit multiple
root situations to a make-or-brake ...

please comment!

best,
Herbert

------------
diff -NurbBP --minimal linux-2.4.22-pre7-fix/Documentation/kernel-parameters.txt linux-2.4.22-pre7-ffb/Documentation/kernel-parameters.txt
--- linux-2.4.22-pre7-fix/Documentation/kernel-parameters.txt 2003-07-19 14:14:20.000000000 +0200
+++ linux-2.4.22-pre7-ffb/Documentation/kernel-parameters.txt 2003-07-21 23:13:56.000000000 +0200
@@ -389,6 +389,8 @@

noalign [KNL,ARM]

+ noaltroot [NFS] disable alternate root devices (e.g. floppy)
+
noapic [SMP,APIC] Tells the kernel not to make use of any
APIC that may be present on the system.

diff -NurbBP --minimal linux-2.4.22-pre7-fix/init/do_mounts.c linux-2.4.22-pre7-ffb/init/do_mounts.c
--- linux-2.4.22-pre7-fix/init/do_mounts.c 2003-07-21 22:13:12.000000000 +0200
+++ linux-2.4.22-pre7-ffb/init/do_mounts.c 2003-07-21 23:26:18.000000000 +0200
@@ -48,6 +48,18 @@
static int __initdata mount_initrd = 0;
#endif

+static int __initdata no_alt_root; /* 1 = disable alternate root */
+
+/* Disable alternate root attempts (e.g. floppy on NFS) */
+static int __init noaltroot_setup(char *str)
+{
+ no_alt_root = 1;
+ return 1;
+}
+
+__setup("noaltroot", noaltroot_setup);
+
+
int __initdata rd_doload; /* 1 = load RAM disk, 0 = don't load */

int root_mountflags = MS_RDONLY | MS_VERBOSE;
@@ -767,6 +779,9 @@
printk("VFS: Mounted root (nfs filesystem).\n");
return;
}
+ if (no_alt_root)
+ panic("VFS: Unable to mount root fs via NFS\n");
+
printk(KERN_ERR "VFS: Unable to mount root fs via NFS, trying floppy.\n");
ROOT_DEV = MKDEV(FLOPPY_MAJOR, 0);
}



2003-07-22 18:39:30

by John Bradford

[permalink] [raw]
Subject: Re: noaltroot bootparam [was Floppy Fallback]

> Trond suggested to draft a patch to address the
> Floppy Fallback issues (mentioned several times
> on lkml) by adding a kernel boot parameter, to
> disable the fallback, or to put it more general,
> to disable alternate root device attempts ...
>
> Currently the NFS-Root Floppy Fallback is the
> only _user_ of such a boot parameter, but in
> future, this could be used to limit multiple
> root situations to a make-or-brake ...
>
> please comment!

I think the best thing to do if it's not possible to mount an
NFS-based root filesystem, is to wait 60 seconds, then try to contact
the NFS server again.

Before the in-kernel bootloader was removed, the current behavior was
quite useful - it was quite possible that a hard disk-less machine
would boot from a floppy without using a bootloader, and mount it's
root filesystem from an NFS server. In this scenario, it would be
impossible to boot the machine with the root on another device,
without modifying the boot disk, so a fallback to root on a floppy was
useful.

However, the in-kernel bootloader was removed in 2.6, so there is now
no reason why an alternate root couldn't simply be specified at the
boot prompt.

If the NFS server is not accessible because of a temporary problem,
(too much network traffic, or it's rebooting for example), it makes
sense to try again after 60 seconds.

Not trying the floppy should become the _default_ action.

John.

2003-07-23 15:18:12

by Herbert Poetzl

[permalink] [raw]
Subject: Re: noaltroot bootparam [was Floppy Fallback]

On Tue, Jul 22, 2003 at 08:04:16PM +0100, John Bradford wrote:
> > Trond suggested to draft a patch to address the
> > Floppy Fallback issues (mentioned several times
> > on lkml) by adding a kernel boot parameter, to
> > disable the fallback, or to put it more general,
> > to disable alternate root device attempts ...
> >
> > Currently the NFS-Root Floppy Fallback is the
> > only _user_ of such a boot parameter, but in
> > future, this could be used to limit multiple
> > root situations to a make-or-brake ...
> >
> > please comment!

Hi John!

your comments are welcome,

> I think the best thing to do if it's not possible to mount an
> NFS-based root filesystem, is to wait 60 seconds, then try to contact
> the NFS server again.

I totally agree on that ...

> Before the in-kernel bootloader was removed, the current behavior was
> quite useful - it was quite possible that a hard disk-less machine
> would boot from a floppy without using a bootloader, and mount it's
> root filesystem from an NFS server. In this scenario, it would be
> impossible to boot the machine with the root on another device,
> without modifying the boot disk, so a fallback to root on a floppy was
> useful.
>
> However, the in-kernel bootloader was removed in 2.6, so there is now
> no reason why an alternate root couldn't simply be specified at the
> boot prompt.

hmm, sorry, obviously forgot to mention that the
patch is for 2.4.x ...

> If the NFS server is not accessible because of a temporary problem,
> (too much network traffic, or it's rebooting for example), it makes
> sense to try again after 60 seconds.
>
> Not trying the floppy should become the _default_ action.

this is something _I_ would prefer _too_, but on the
other hand there is tradition, and stable, and ... ;)

thanks,
Herbert

> John.

2003-07-23 15:43:06

by John Bradford

[permalink] [raw]
Subject: Re: noaltroot bootparam [was Floppy Fallback]

> > > Trond suggested to draft a patch to address the
> > > Floppy Fallback issues (mentioned several times
> > > on lkml) by adding a kernel boot parameter, to
> > > disable the fallback, or to put it more general,
> > > to disable alternate root device attempts ...
> > >
> > > Currently the NFS-Root Floppy Fallback is the
> > > only _user_ of such a boot parameter, but in
> > > future, this could be used to limit multiple
> > > root situations to a make-or-brake ...
> > >
> > > please comment!
>
> Hi John!
>
> your comments are welcome,
>
> > I think the best thing to do if it's not possible to mount an
> > NFS-based root filesystem, is to wait 60 seconds, then try to contact
> > the NFS server again.
>
> I totally agree on that ...
>
> > Before the in-kernel bootloader was removed, the current behavior was
> > quite useful - it was quite possible that a hard disk-less machine
> > would boot from a floppy without using a bootloader, and mount it's
> > root filesystem from an NFS server. In this scenario, it would be
> > impossible to boot the machine with the root on another device,
> > without modifying the boot disk, so a fallback to root on a floppy was
> > useful.
> >
> > However, the in-kernel bootloader was removed in 2.6, so there is now
> > no reason why an alternate root couldn't simply be specified at the
> > boot prompt.
>
> hmm, sorry, obviously forgot to mention that the
> patch is for 2.4.x ...

Ah, OK, sorry, I only quickly glanced at the patch, I didn't have chance to test it.

> > If the NFS server is not accessible because of a temporary problem,
> > (too much network traffic, or it's rebooting for example), it makes
> > sense to try again after 60 seconds.
> >
> > Not trying the floppy should become the _default_ action.
>
> this is something _I_ would prefer _too_, but on the
> other hand there is tradition, and stable, and ... ;)

I totally agree, we shouldn't change this in 2.4, because 2.4-based
distributions may rely on the existing behavior.

John.