1 |
On Sat, Oct 11, 2008 at 12:00 AM, David Wei <davidwei@×××××××××××.cn> wrote: |
2 |
> Thanks Andrey, that patch works , my test kernel dose not ask for the floppy before the panic. Just by the way,dose that mean I cannot use floppy drive on this box? |
3 |
> |
4 |
You can use the floppy drive, but the kernel cannot run init / use |
5 |
initrd from a floppy (i.e. you are not allowed to use root=/dev/fd0 or |
6 |
initrd=/dev/fd0). This is because the floppy is fallback code if the |
7 |
NFS mount of / fails. |
8 |
|
9 |
But this is Gentoo, you make your own kernel (hopefully), and never |
10 |
have to worry about initrd. |
11 |
|
12 |
/ and /dev/root are used interchangeably, for readabilty, similar to / |
13 |
and /dev/hdaX. |
14 |
|
15 |
All I did was comment out the floppy fallback code. |
16 |
|
17 |
This is how mount_root was originally written: |
18 |
If CONFIG_ROOT_NFS is defined |
19 |
If root device is NFS |
20 |
If the NFS root mounted |
21 |
Return |
22 |
Print message "VFS: Unable to mount root fs via NFS, trying floppy.\n" |
23 |
Set root device as floppy disk 0 |
24 |
If CONFIG_BLK_DEV_FD (floppy disk) is defined |
25 |
If the root device is a floppy |
26 |
If dual initrd/ramload is enabled |
27 |
If the first partition of the ramdisk image could be |
28 |
loaded into memory |
29 |
Set the root device as a ramdisk |
30 |
Set the root device name as null |
31 |
Else |
32 |
Prompt for root floppy |
33 |
If CONFIG_BLOCK is defined |
34 |
Create a device named "/dev/root" with the major & minor modes |
35 |
equal to the root device |
36 |
Mount "/dev/root" with root device mountflags |
37 |
|
38 |
If you want more detail, you should post to lkml. |
39 |
|
40 |
All I have done was replace the following line: |
41 |
If CONFIG_BLK_DEV_FD (floppy disk) is defined |
42 |
with |
43 |
If false |
44 |
|
45 |
} |
46 |
> Thanks again!! |
47 |
No problem. |
48 |
In reality, the fix was simple. |
49 |
All I did was grep the source tree for the exact string (grep -R "VFS: |
50 |
Unable to mount root fs via NFS, trying floppy" . |
51 |
) |
52 |
Then open up vim (or emacs or nano), find the line, and add an #if 0 |
53 |
... #endif block where needed. |
54 |
> |
55 |
> On Fri, 10 Oct 2008 23:06:09 -0400 |
56 |
> "Andrey Vul" <andrey.vul@×××××.com> wrote: |
57 |
> |
58 |
>> On Fri, Oct 10, 2008 at 10:33 PM, David Wei <davidwei@×××××××××××.cn> wrote: |
59 |
>> > Sorry, I forgot that file . |
60 |
>> > the .config is in the attachment this time. |
61 |
>> > Thank you . |
62 |
>> > |
63 |
>> > On Fri, 10 Oct 2008 10:05:36 -0400 |
64 |
>> > "Andrey Vul" <andrey.vul@×××××.com> wrote: |
65 |
>> > |
66 |
>> >> 2008/10/10 David Wei <davidwei@×××××××××××.cn>: |
67 |
>> >> > Hi, |
68 |
>> >> > I am trying kexec with "kernel panic reboot" cause i have to manage my server remotely. |
69 |
>> >> > the "kernel panic reboot" (http://gentoo-wiki.com/TIP_Kernel_Panic_Reboot) has beening working so good so far for the regular kernel panic.However,sometimes when i were missed some file system items,the booking process would ask me: |
70 |
>> >> > "VFS: Unable to mount root fs via NFS,trying floppy |
71 |
>> >> > Insert root floppy and Press Enter." |
72 |
>> >> > And the system hungup there waiting for my Enter. |
73 |
>> >> > How can I remove this item from the booting process and panic directly so that it can reboot? Besides,I want to keep the NFS service. |
74 |
>> >> > Thank you in advance. |
75 |
>> >> I'm guessing that this is due to the floppy being compiled into the |
76 |
>> >> emergency kernel. |
77 |
>> >> In any case, can you post your .config for the emergency kernel? |
78 |
>> >> |
79 |
>> |
80 |
>> Nothing in the .config looks suspicious. |
81 |
>> It looks like it's inevitable that kernel patching will be needed, at |
82 |
>> least, using the preprocessor to "hide" the floppy code. |
83 |
>> Try this (it comments out floppy support which happens after NFS support): |
84 |
>> comment_floppy.patch |
85 |
>> --- init/do_mounts.c 2008-04-16 22:49:44.000000000 -0400 |
86 |
>> +++ init/do_mounts2.c 2008-10-10 23:03:06.867876561 -0400 |
87 |
>> @@ -308,7 +308,8 @@ |
88 |
>> ROOT_DEV = Root_FD0; |
89 |
>> } |
90 |
>> #endif |
91 |
>> -#ifdef CONFIG_BLK_DEV_FD |
92 |
>> +/* #ifdef CONFIG_BLK_DEV_FD */ |
93 |
>> +#if 0 |
94 |
>> if (MAJOR(ROOT_DEV) == FLOPPY_MAJOR) { |
95 |
>> /* rd_doload is 2 for a dual initrd/ramload setup */ |
96 |
>> if (rd_doload==2) { |
97 |
>> |
98 |
>> cd to your /usr/src/linux-... and run patch -p0 < comment_floppy.patch |
99 |
>> It should fix the _specific_ issue. It might not fix the root cause, however. |
100 |
>> |
101 |
>> -- |
102 |
>> Andrey Vul |
103 |
>> |
104 |
>> A: Because it messes up the order in which people normally read text. |
105 |
>> Q: Why is top-posting such a bad thing? |
106 |
>> A: Top-posting. |
107 |
>> Q: What is the most annoying thing in e-mail? |
108 |
>> |
109 |
> |
110 |
> |
111 |
> ------------------------------- |
112 |
> 魏亮 David Wei |
113 |
> |
114 |
> 您可以通过下面的方式和我联系: |
115 |
> MSN: inadavid@×××××××.com |
116 |
> Gtalk: inadavid@×××××.com |
117 |
> Email: davidwei@×××××××××××.cn |
118 |
> |
119 |
> |
120 |
|
121 |
|
122 |
|
123 |
-- |
124 |
Andrey Vul |
125 |
|
126 |
A: Because it messes up the order in which people normally read text. |
127 |
Q: Why is top-posting such a bad thing? |
128 |
A: Top-posting. |
129 |
Q: What is the most annoying thing in e-mail? |