kgdb of kernel issues FB7.0 (mangled inode)

Kayven Riese kayvey at gmail.com
Fri Oct 17 08:39:43 PDT 2008


> I wasn't sure if I should have edited this.
> ------------------------------
>
> Message: 29
> Date: Thu, 16 Oct 2008 18:48:31 -0700
> From: "Kayven Riese" <kayvey at gmail.com>
> Subject: kgdb of kernel issues FB7.
> To: freebsd-questions at freebsd.org, california71_lv at hotmail.com,
>        stan at cs.sfsu.edu
> Message-ID:
>        <28b9b4180810161848ua342669l9cbaeaa61b357407 at mail.gmail.com>
> Content-Type: text/plain; charset=ISO-8859-1
>
> I was running my FreeBSD 7.0-RELEASE (160GB HD) on this laptop:
>
> http://www.monkeyview.net/id/965/fsck/dmesg/PB12001901.vhtml
>
> Right now I am swapped out
>
> http://www.monkeyview.net/id/965/fsck/torrent/p5120212.vhtml
>
> but I have the problem disk mounted using this:
>
> http://www.monkeyview.net/id/965/fsck/torrent/p5120226.vhtml
>
> This is a much older disk with 60GB and
> $ uname -a
> FreeBSD  6.2-RELEASE FreeBSD 6.2-RELEASE #0: Fri Jan 12 11:05:30 UTC
> 2007     root at dessler.cse.buffalo.edu:/usr/obj/usr/src/sys/SMP  i386
> $
>
> It makes clunking sounds sometimes, but for the most part it seems to run
> fine.
>
> Some diagnostics on the 160GB HD FB 7.0 that have been done:
>
> # mount /dev/da0s4 /mnt/usr
> # fsck_ufs -y /mnt/usr
> ** /dev/da0s4 (NO WRITE)
> ** Last Mounted on /mnt/usr
> ** Phase 1 - Check Blocks and Sizes
> INCORRECT BLOCK COUNT I=2779162 (4 should be 0)
> CORRECT? no
>
> fsck_ufs: cannot alloc 871186332 bytes for inoinfo
> #
>
> I have been told that doing fsck while mounted is a very bad thing, but I
> did fsck before the
> above depicted instantiation of the fsck command and after this and it
> always did the same
> thing. I have done fsck using the argument /dev/da0s4,
>  I have done fsck in single user mode (the 160GB hard boots a character
> based shell, but crashes
> and reboots during "startx") and always the fsck looks the same.  My
> configuration of the 160GB
> is a little goofy, in my estimation, just to explain.  I currently have
> three hard drives representing
> all the times I have installed FreeBSD, two of them are dual booted with MS
> Vista, and this latest
> one with 160GB has FreeBSD all to itself, but when I was creating it, I
> mistook partitions for
> slices so I configured 4 partitions, leaving some of the disk unallocated
> thinking that would be
> good for that 10% utilization thing.  I mount  three partitions on /, /var,
> and /usr; respectively
> and the last one as swap.  I learned the vi editor in 1985 and tend to
> recount the flavor of
> unix as "evax" but at this point I wonder if this "evax" concept is
> mistaken.  I have done a bunch
> of c programming in university courses, but also spent some time doing
> molecular biology but
> they had me on a SUN SPARCstation I guess.  Didn't mess with that source
> code.
>
> Anyway.  Sorry for not being concise. I thought maybe my background might
> be
> useful information.
> I was told to do another diagnostic, alleged to pin the disk down as having
> no bad sectors:
>
> # dd if=/dev/da0 bs=65536 of=/dev/null
> 2442045+1 records in
> 2442045+1 records out
> 160041885696 bytes transferred in 5718.122211 secs (27988539 bytes/sec)
> # echo $?
> 0
> #
>
> I was told that the fact that it returns 0 was good.
>
>
> I also tried the port called recoverdisk, but that was taking extremely
> long.  I accidently disconnected the
> USB port
>
> # /usr/src/tools/tools/recoverdisk
> zsh: permission denied: /usr/src/tools/tools/recoverdisk
> # set -o vi
> # ls /usr/src/tools/tools/recoverdisk
> Makefile        recoverdisk.1   recoverdisk.c
> # cd /usr/src/tools/tools/recoverdisk
> # make
> Warning: Object directory not changed from original
> /usr/src/tools/tools/recoverdisk
> cc -O2 -fno-strict-aliasing -pipe  -Wsystem-headers -Werror -Wall
> -Wno-format-y2k -W -Wno-unused-parameter -Wstrict-prototypes
> -Wmissing-prototypes -Wpointer-arith -Wreturn-type -Wcast-qual
> -Wwrite-strings -Wswitch -Wshadow -Wcast-align -Wunused-parameter
> -Wchar-subscripts -Winline -Wnested-externs -Wredundant-decls -c
> recoverdisk.c
> cc -O2 -fno-strict-aliasing -pipe  -Wsystem-headers -Werror -Wall
> -Wno-format-y2k -W -Wno-unused-parameter -Wstrict-prototypes
> -Wmissing-prototypes -Wpointer-arith -Wreturn-type -Wcast-qual
> -Wwrite-strings -Wswitch -Wshadow -Wcast-align -Wunused-parameter
> -Wchar-subscripts -Winline -Wnested-externs -Wredundant-decls  -o
> recoverdisk recoverdisk.o
> gzip -cn recoverdisk.1 > recoverdisk.1.gz
> # ls
> Makefile                recoverdisk.1           recoverdisk.c
> recoverdisk             recoverdisk.1.gz        recoverdisk.o
> # ./recoverdisk
> usage: recoverdisk [-r worklist] [-w worklist] source-drive [destination]
> # ./recoverdisk /dev/da0s4
>        start    size           len state          done     remaining    %
> done
>    590348288 1048576  134551002112     0     590348288  134551002112
> 0.0043684
>
> It had run for perhaps half an hour and still was only 0.3% done or so.
>
>
> finally, the guy downstairs told me to debug the kernel so I found this
> page:
>
>
> http://www.freebsd.org/doc/en/books/developers-handbook/kerneldebug-gdb.html
>
> and after mounting the /usr partition I am here:
>
> -rw-r--r--  1 root  wheel     21360 Jun 22 10:30 yarrow.o
> # kgdb /mnt/nexstar/obj/usr/src/sys/KV_KERN/kernel.debug vmcore.12
> [GDB will not be able to debug user-mode threads: /usr/lib/libthread_db.so:
> Undefined symbol "ps_pglobal_lookup"]
> GNU gdb 6.1.1 [FreeBSD]
> Copyright 2004 Free Software Foundation, Inc.
> GDB is free software, covered by the GNU General Public License, and you
> are
> welcome to change it and/or distribute copies of it under certain
> conditions.
> Type "show copying" to see the conditions.
> There is absolutely no warranty for GDB.  Type "show warranty" for details.
> This GDB was configured as "i386-marcel-freebsd".
>
> Unread portion of the kernel message buffer:
> dev = ad0s4d, block = 1, fs = /usr
> panic: ffs_blkfree: freeing free block
> cpuid = 0
> Uptime: 8m2s
> Physical memory: 1010 MB
> Dumping 78 MB: 63 47 31 15
>
> #0  0x00000000 in ?? ()
> (kgdb)
>
> ::sigh::


# kgdb /mnt/nexstar/obj/usr/src/sys/KV_KERN/kernel.debug vmcore.0
[GDB will not be able to debug user-mode threads: /usr/lib/libthread_db.so:
Undefined symbol "ps_pglobal_lookup"]
GNU gdb 6.1.1 [FreeBSD]
Copyright 2004 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain
conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB.  Type "show warranty" for details.
This GDB was configured as "i386-marcel-freebsd".

Unread portion of the kernel message buffer:
panic: ufs_dirbad: /usr: bad dir ino 9750624 at offset 28160: mangled entry
cpuid = 0
Uptime: 5m6s
Physical memory: 1010 MB
Dumping 149 MB: 134 118 102 86 70 54 38 22 6

#0  0x00000000 in ?? ()
(kgdb)


>
>
>
>
> I  was figuring I would try again, but right now I am running the
> intermediary (120GB) HD..
> let me reacquaint you with my disks:
>
>  relative age          capacity        dual boot?        partition 1
>        partition 2                   notes
>    oldest                  60GB               yes               FreeBSD 6.2
>             Vista                   makes the
>
> gnome (operational)      (broken)               clunking noises
>
>   intermediate         120GB             yes                Vista
>           FreeBSD (6.3?)
>
>  (running now)            (broken)
>
>    newest                160GB             no               FreeBSD 7.0
>           n/a                     subject of this
>                                                                         KDE
> (won't start)                                         question
>
>
>
>   - Accept and Award
> Points<
> http://www.experts-exchange.com/Storage/Hard_Drives/splitPoints.jsp?qid=23798083&aid=22692235
> >
>
> *----------------------------------------------------------*
>   Kayven Riese, BSCS, MS (Physiology and Biophysics)
>   (415) 902 5513 cellular
>   http://kayve.net
>   Webmaster http://ChessYoga.org
> *----------------------------------------------------------*
>
>
>


More information about the freebsd-questions mailing list