Gentoo Archives: gentoo-user

From: David Relson <relson@×××××××××××××.com>
To: gentoo-user@l.g.o
Subject: Re: [gentoo-user] Howto erase the "Insert root floppy and press enter" item before the kernel panic?
Date: Sun, 12 Oct 2008 00:21:19
Message-Id: 20081011202115.58ca28ce@osage.osagesoftware.com
In Reply to: Re: [gentoo-user] Howto erase the "Insert root floppy and press enter" item before the kernel panic? by Andrey Vul
1 On Sat, 11 Oct 2008 13:23:10 -0400
2 Andrey Vul wrote:
3
4 > On Sat, Oct 11, 2008 at 8:01 AM, David Relson
5 > <relson@×××××××××××××.com> wrote:
6 > > On Fri, 10 Oct 2008 23:06:09 -0400
7 > > Andrey Vul wrote:
8 > >
9 > >> On Fri, Oct 10, 2008 at 10:33 PM, David Wei
10 > >> <davidwei@×××××××××××.cn> wrote:
11 > >> > Sorry, I forgot that file .
12 > >> > the .config is in the attachment this time.
13 > >> > Thank you .
14 > >> >
15 > >> > On Fri, 10 Oct 2008 10:05:36 -0400
16 > >> > "Andrey Vul" <andrey.vul@×××××.com> wrote:
17 > >> >
18 > >> >> 2008/10/10 David Wei <davidwei@×××××××××××.cn>:
19 > >> >> > Hi,
20 > >> >> > I am trying kexec with "kernel panic reboot" cause i have to
21 > >> >> > manage my server remotely. the "kernel panic
22 > >> >> > reboot" (http://gentoo-wiki.com/TIP_Kernel_Panic_Reboot) has
23 > >> >> > beening working so good so far for the regular kernel
24 > >> >> > panic.However,sometimes when i were missed some file system
25 > >> >> > items,the booking process would ask me: "VFS: Unable to mount
26 > >> >> > root fs via NFS,trying floppy Insert root floppy and Press
27 > >> >> > Enter." And the system hungup there waiting for my Enter. How
28 > >> >> > can I remove this item from the booting process and panic
29 > >> >> > directly so that it can reboot? Besides,I want to keep the NFS
30 > >> >> > service. Thank you in advance.
31 > >> >> I'm guessing that this is due to the floppy being compiled into
32 > >> >> the emergency kernel.
33 > >> >> In any case, can you post your .config for the emergency kernel?
34 > >> >>
35 > >>
36 > >> Nothing in the .config looks suspicious.
37 > >> It looks like it's inevitable that kernel patching will be needed,
38 > >> at least, using the preprocessor to "hide" the floppy code.
39 > >> Try this (it comments out floppy support which happens after NFS
40 > >> support): comment_floppy.patch
41 > >> --- init/do_mounts.c 2008-04-16 22:49:44.000000000 -0400
42 > >> +++ init/do_mounts2.c 2008-10-10 23:03:06.867876561 -0400
43 > >> @@ -308,7 +308,8 @@
44 > >> ROOT_DEV = Root_FD0;
45 > >> }
46 > >> #endif
47 > >> -#ifdef CONFIG_BLK_DEV_FD
48 > >> +/* #ifdef CONFIG_BLK_DEV_FD */
49 > >> +#if 0
50 > >> if (MAJOR(ROOT_DEV) == FLOPPY_MAJOR) {
51 > >> /* rd_doload is 2 for a dual initrd/ramload setup
52 > >> */ if (rd_doload==2) {
53 > >>
54 > >> cd to your /usr/src/linux-... and run patch -p0 <
55 > >> comment_floppy.patch It should fix the _specific_ issue. It might
56 > >> not fix the root cause, however.
57 > >>
58 > >> --
59 > >> Andrey Vul
60 > >
61 > > Looking in do_mounts.c, the code that generates the message is:
62 > >
63 > > #ifdef CONFIG_ROOT_NFS
64 > > if (MAJOR(ROOT_DEV) == UNNAMED_MAJOR) {
65 > > if (mount_nfs_root())
66 > > return;
67 > >
68 > > printk(KERN_ERR "VFS: Unable to mount root fs via NFS, trying
69 > > floppy.\n"); ROOT_DEV = Root_FD0;
70 > > }
71 > > #endif
72 > >
73 > > Looking at the .config file, I see "CONFIG_ROOT_NFS=y". Since the
74 > > message is being printed, we know that
75 > >
76 > > if (MAJOR(ROOT_DEV) == UNNAMED_MAJOR)
77 > >
78 > > is true which wmeans that the
79 > >
80 > > if (MAJOR(ROOT_DEV) == FLOPPY_MAJOR)
81 > >
82 > > is false, i.e. the change to "#if 0" looks to be incorrect.
83 > >
84 > > Perhaps "CONFIG_ROOT_NFS=y" in .config is the root cause. I'd
85 > > suggest changing the .config.
86 > He has explicity mentioned that his root device is NFS. You have
87 > misinterpreted the code. The floppy event only occurs *if*
88 > mount_nfs_root() failed.
89 > It's false from the start, but becomes true when NFS mount-root
90 > failed.
91
92 You are correct. I hadn't re-read the orginal post and didn't know the
93 use of NFS and I didn't look deeply enough into the code to learn that
94 Root_FD0 relates to FLOPPY_MAJOR.