[TAG] udev hosed

Mike Orr mso at oz.net
Mon Oct 24 21:12:48 MSD 2005


I was going on a trip, so I set my Gentoo computer to shutdown and proceeded 
to unplug everything in my apartment except the refrigerator.  But I forgot 
the computer was plugged into the big white outlet strip, and pulled the plug 
in the middle of the shutdown.  When I came back and turned on the computer, 
Gentoo doth said:

``
* Mounting ramfs at /dev     [ok]
* Configuring system to use udev
*     Populating /dev with device nodes
/sbin/rc: line 25: cannot redirect standard input from /dev/null: no such file 
or directory   [oops]
* The "tar" command failed with error: (stdin) is not a bzip2 file
tar: child returned status 2
''

This is a fatal error and it won't boot except to single-user mode.  /dev has 
only three entries (/dev/vc*).  I unmounted /dev and it uncovered the full 
static /dev, but that wasn't enough to get to multiuser mode.  Since I had 
just installed Kubuntu on the same computer before leaving, I switched to 
that and managed to send this email.

/sbin/rc is a shell script, and line 25 is in the middle of an error-reporting 
wrapper ('try').  The 'tar' command is line 193:

``
try tar -jxpf /lib/udev-state/devices.tar.bz2 -C /dev
''

I tried untarring this file manually and got the same error.  The 'file' 
program says it's "data" format, meaning it doesn't recognize it.  I tried 
renaming the file, but that just gave a fatal error saying the file couldn't 
be found.

So I created a dummy tarball containing only '.dummy'.  That was enough to get 
it to boot.  Then when I shutdown, it saved the real devices to the tarball:

``
/lib/udev-state/devices.tar.bz2: bzip2 compressed data, block size = 900k
''

So things are OK now.  One thing I couldn't figure out is, line 164 of /dev/rc 
seems to imply I can use a boot option to disable udev  -- "gentoo noudev" -- 
but it didn't work.  Neither did "gentoo noudev=1".  It just ignored these, 
even though /proc/cmdline reported them.  Here's the function 
from /sbin/functions.sh :

``#   EXAMPLE:  if get_bootparam "nodevfs" ; then ....
#
get_bootparam() {
    local x copt params retval=1

    [ ! -e "/proc/cmdline" ] && return 1

    for copt in $(< /proc/cmdline)
    do
        if [ "${copt%=*}" = "gentoo" ]
        then
            params="$(gawk -v PARAMS="${copt##*=}" '
                BEGIN {
                    split(PARAMS, nodes, ",")
                    for (x in nodes)
                        print nodes[x]
                }')"

            # Parse gentoo option
            for x in ${params}
            do
                if [ "${x}" = "$1" ]
                then
#                   echo "YES"
                    retval=0
                fi
            done
        fi
    done

    return ${retval}
}
''

-- Mike Orr <mso at oz.net> or <sluggoster at gmail.com>



-- 
Mike Orr <mso at oz.net> or <sluggoster at gmail.com>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: rc
Type: application/x-shellscript
Size: 18709 bytes
Desc: not available
Url : http://lists.linuxgazette.net/mailman/private/tag/attachments/20051024/b052972d/attachment-0001.bin 



More information about the TAG mailing list