Sophie

Sophie

distrib > Mandriva > 2010.1 > x86_64 > by-pkgid > 965e33040dd61030a94f0eb89877aee8 > files > 803

howto-html-en-20080722-2mdv2010.1.noarch.rpm

<HTML
><HEAD
><TITLE
>Troubleshooting, or The Agony of Defeat</TITLE
><META
NAME="GENERATOR"
CONTENT="Modular DocBook HTML Stylesheet Version 1.63
"><LINK
REL="HOME"
TITLE="The Linux Bootdisk HOWTO"
HREF="index.html"><LINK
REL="PREVIOUS"
TITLE="Putting them together: Making the diskette(s)"
HREF="x703.html"><LINK
REL="NEXT"
TITLE="Reducing root filesystem size"
HREF="slimfast.html"></HEAD
><BODY
CLASS="SECT1"
BGCOLOR="#FFFFFF"
TEXT="#000000"
LINK="#0000FF"
VLINK="#840084"
ALINK="#0000FF"
><DIV
CLASS="NAVHEADER"
><TABLE
WIDTH="100%"
BORDER="0"
CELLPADDING="0"
CELLSPACING="0"
><TR
><TH
COLSPAN="3"
ALIGN="center"
>The Linux Bootdisk HOWTO</TH
></TR
><TR
><TD
WIDTH="10%"
ALIGN="left"
VALIGN="bottom"
><A
HREF="x703.html"
>Prev</A
></TD
><TD
WIDTH="80%"
ALIGN="center"
VALIGN="bottom"
></TD
><TD
WIDTH="10%"
ALIGN="right"
VALIGN="bottom"
><A
HREF="slimfast.html"
>Next</A
></TD
></TR
></TABLE
><HR
ALIGN="LEFT"
WIDTH="100%"></DIV
><DIV
CLASS="SECT1"
><H1
CLASS="SECT1"
><A
NAME="TROUBLESHOOTING"
>7. Troubleshooting, or The Agony of Defeat</A
></H1
><P
>When building bootdisks, the first few tries often will not boot.  The general
approach to building a root disk is to assemble components from your existing
system, and try and get the diskette-based system to the point where it displays
messages on the console.  Once it starts talking to you, the battle is half over
because you can see what it is complaining about, and you can fix individual
problems until the system works smoothly.  If the system just hangs with no
explanation, finding the cause can be difficult.  The recommended procedure for
investigating the problem where the system will not talk to you is as follows:</P
><P
>&#13;<P
></P
><UL
><LI
><P
>You may see a message like this:
<TABLE
BORDER="1"
BGCOLOR="#E0E0E0"
WIDTH="90%"
><TR
><TD
><FONT
COLOR="#000000"
><PRE
CLASS="SCREEN"
>Kernel panic: VFS: Unable to mount root fs on XX:YY</PRE
></FONT
></TD
></TR
></TABLE
>
This is a common problem and it has only a few causes.  First, check the device
<EM
>XX:YY</EM
> against the list of device codes in
<TT
CLASS="FILENAME"
>/usr/src/linux/Documentation/devices.txt</TT
>.  If it is
incorrect, you probably didn't do an <B
CLASS="COMMAND"
>rdev -R</B
>, or you did it
on the wrong image.  If the device code is correct, then check carefully the
device drivers compiled into your kernel.  Make sure it has floppy disk, ramdisk
and ext2 filesystem support built-in.</P
></LI
><LI
><P
>If you see many errors like:
<TABLE
BORDER="1"
BGCOLOR="#E0E0E0"
WIDTH="90%"
><TR
><TD
><FONT
COLOR="#000000"
><PRE
CLASS="SCREEN"
>end_request: I/O error, dev 01:00 (ramdisk), sector NNN</PRE
></FONT
></TD
></TR
></TABLE
>
This is an I/O error from the ramdisk driver, usually because the kernel is
trying to write beyond the end of the device.  The ramdisk is too small to hold
the root filesystem.  Check your bootdisk kernel's initialization messages for a
line like:
<TABLE
BORDER="1"
BGCOLOR="#E0E0E0"
WIDTH="90%"
><TR
><TD
><FONT
COLOR="#000000"
><PRE
CLASS="SCREEN"
>        Ramdisk driver initialized : 16 ramdisks of 4096K size</PRE
></FONT
></TD
></TR
></TABLE
>
Check this size against the <EM
>uncompressed</EM
> size of
the root filesystem.  If the ramdisks aren't large enough, make them
larger.</P
></LI
><LI
><P
>Check that the root disk actually contains the directories you think
it does.  It is easy to copy at the wrong level so that you end up
with something like <TT
CLASS="FILENAME"
>/rootdisk/bin</TT
> instead of
<TT
CLASS="FILENAME"
>/bin</TT
> on your root diskette.&#13;</P
></LI
><LI
><P
>Check that there is a <TT
CLASS="FILENAME"
>/lib/libc.so</TT
> with the same link that
appears in your <TT
CLASS="FILENAME"
>/lib</TT
> directory on your hard disk.&#13;</P
></LI
><LI
><P
>Check that any symbolic links in your <TT
CLASS="FILENAME"
>/dev</TT
>
directory in your existing system also exist on your root diskette
filesystem, where those links are to devices which you have included
in your root diskette.  In particular,
<TT
CLASS="FILENAME"
>/dev/console</TT
> links are essential in many cases.</P
></LI
><LI
><P
>Check that you have included <TT
CLASS="FILENAME"
>/dev/tty1, /dev/null, /dev/zero,
/dev/mem, /dev/ram</TT
> and <TT
CLASS="FILENAME"
>/dev/kmem</TT
> files.&#13;</P
></LI
><LI
><P
>Check your kernel configuration -- support for all resources
required up to login point must be built in, not modules.  
So <EM
>ramdisk and ext2 support must be built-in</EM
>.&#13;</P
></LI
><LI
><P
>Check that your kernel root device and ramdisk settings are correct. </P
></LI
></UL
></P
><P
>Once these general aspects have been covered, here are some more
specific files to check:  

<P
></P
><OL
TYPE="1"
><LI
><P
>Make sure <B
CLASS="COMMAND"
>init</B
> is included as
<TT
CLASS="FILENAME"
>/sbin/init</TT
> or <TT
CLASS="FILENAME"
>/bin/init</TT
>.
Make sure it is executable.</P
></LI
><LI
><P
>Run <B
CLASS="COMMAND"
>ldd init</B
> to check init's libraries.  Usually
this is just <TT
CLASS="FILENAME"
>libc.so</TT
>, but check anyway.  Make
sure you included the necessary libraries and loaders.</P
></LI
><LI
><P
>Make sure you have the right loader for your libraries --
<TT
CLASS="FILENAME"
>ld.so</TT
> for a.out or <TT
CLASS="FILENAME"
>ld-linux.so</TT
>
for ELF.&#13;</P
></LI
><LI
><P
>Check the <TT
CLASS="FILENAME"
>/etc/inittab</TT
> on your bootdisk filesystem for
the calls to <B
CLASS="COMMAND"
>getty</B
> (or some <B
CLASS="COMMAND"
>getty</B
>-like
program, such as <B
CLASS="COMMAND"
>agetty</B
>, <B
CLASS="COMMAND"
>mgetty</B
> or
<B
CLASS="COMMAND"
>getty_ps</B
>).  Double-check these against your hard
disk <TT
CLASS="FILENAME"
>inittab</TT
>.  Check the man pages of the program you use
to make sure these make sense.  <TT
CLASS="FILENAME"
>inittab</TT
> is possibly the
trickiest part because its syntax and content depend on the init program used
and the nature of the system.  The only way to tackle it is to read the man
pages for <B
CLASS="COMMAND"
>init</B
> and <TT
CLASS="FILENAME"
>inittab</TT
> and work
out exactly what your existing system is doing when it boots.  Check to make
sure <TT
CLASS="FILENAME"
>/etc/inittab</TT
> has a system initialisation entry.
This should contain a command to execute the system initialization script,
which must exist.&#13;</P
></LI
><LI
><P
> As with <B
CLASS="COMMAND"
>init</B
>, run <B
CLASS="COMMAND"
>ldd</B
> on your
<B
CLASS="COMMAND"
>getty</B
> to see what it needs, and make sure the necessary
library files and loaders were included in your root filesystem.&#13;</P
></LI
><LI
><P
>Be sure you have included a shell program (e.g., <B
CLASS="COMMAND"
>bash</B
> or
<B
CLASS="COMMAND"
>ash</B
>)
capable of running all of your rc scripts.&#13;</P
></LI
><LI
><P
>If you have a <TT
CLASS="FILENAME"
>/etc/ld.so.cache</TT
> file on your rescue disk,
remake it.</P
></LI
></OL
>&#13;</P
><P
>If <B
CLASS="COMMAND"
>init</B
> starts, but you get a message like:  
<TABLE
BORDER="1"
BGCOLOR="#E0E0E0"
WIDTH="100%"
><TR
><TD
><FONT
COLOR="#000000"
><PRE
CLASS="SCREEN"
>        Id xxx respawning too fast: disabled for 5 minutes  </PRE
></FONT
></TD
></TR
></TABLE
>
it is coming from <B
CLASS="COMMAND"
>init</B
>, usually indicating that
<B
CLASS="COMMAND"
>getty</B
> or <B
CLASS="COMMAND"
>login</B
> is dying as soon as it
starts up.  Check the <B
CLASS="COMMAND"
>getty</B
> and <B
CLASS="COMMAND"
>login</B
>
executables and the libraries they depend upon.  Make sure the invocations in
<TT
CLASS="FILENAME"
>/etc/inittab</TT
> are correct.  If you get strange messages
from <B
CLASS="COMMAND"
>getty</B
>, it may mean the calling form in
<TT
CLASS="FILENAME"
>/etc/inittab</TT
> is wrong.</P
><P
> If you get a login prompt, and you enter a valid login name but the
system prompts you for another login name immediately, the problem may be
with PAM or NSS.  See <A
HREF="buildroot.html#PAMANDNSS"
>Section 4.4</A
>.  The problem may also be
that you use shadow passwords and didn't copy
<TT
CLASS="FILENAME"
>/etc/shadow</TT
> to your bootdisk.</P
><P
> If you try to run some executable, such as <B
CLASS="COMMAND"
>df</B
>, which
is on your rescue disk but you yields a message like: <TT
CLASS="LITERAL"
>df: not
found</TT
>, check two things: (1) Make sure the directory containing the
binary is in your PATH, and (2) make sure you have libraries (and loaders) the
program needs.  </P
></DIV
><DIV
CLASS="NAVFOOTER"
><HR
ALIGN="LEFT"
WIDTH="100%"><TABLE
WIDTH="100%"
BORDER="0"
CELLPADDING="0"
CELLSPACING="0"
><TR
><TD
WIDTH="33%"
ALIGN="left"
VALIGN="top"
><A
HREF="x703.html"
>Prev</A
></TD
><TD
WIDTH="34%"
ALIGN="center"
VALIGN="top"
><A
HREF="index.html"
>Home</A
></TD
><TD
WIDTH="33%"
ALIGN="right"
VALIGN="top"
><A
HREF="slimfast.html"
>Next</A
></TD
></TR
><TR
><TD
WIDTH="33%"
ALIGN="left"
VALIGN="top"
>Putting them together: Making the diskette(s)</TD
><TD
WIDTH="34%"
ALIGN="center"
VALIGN="top"
>&nbsp;</TD
><TD
WIDTH="33%"
ALIGN="right"
VALIGN="top"
>Reducing root filesystem size</TD
></TR
></TABLE
></DIV
></BODY
></HTML
>