Subject: Re: ddb sync and dump device questions
To: Jeff Rizzo <riz@tastylime.net>
From: Dan LaBell <dan4l-nospam@verizon.net>
List: netbsd-users
Date: 05/28/2005 01:36:12
On May 27, 2005, at 10:21 AM, Jeff Rizzo wrote:

> rudolf wrote:
>
>> Hi,
>>
>> I've tried several times to make kernel dump core to dump device and
>> restart, but the ddb never completed the job. It just hangs. I thought
>> that the problem could be raidframe dump device or mp kernel, but ddb
>> hangs even on non-mp kernel and ordinary wd dump device. Sometimes the
>> ddb hangs right after:
>>
>> Stopped at netbsd:cpu_Debugger+0x1: ret
>> db{0}> sync
>> syncing disks... done
>
>
> <snip>
>
>> yet. Savecore on consequent boot never saved anything. I don't really
>> understand these things so what do you think is wrong here? It's amd64
>> machine with 2 processors, kernel 2.0_STABLE.
>
>
> You can bypass the sync and force a crash dump by using a flag of 0x104
> to reboot:
> db{0}> reboot 0x104
>
> (0x104 represents RB_DUMP and RB_NOSYNC ... see sys/reboot.h for more
> reboot flags)
> If it's possible to make a crash dump (it isn't always), this will 
> cause
> it to.
>
>>
>> Are these valid examples how to set dump device to whatever I want on
>> startup using fstab:
>> /dev/raid4a none swap sw,dp 0 0
>> or
>> /dev/wd2a none swap dp 0 0
>
>
> I think you need "sw" and "dp" on different lines.  Here's what I have
> on one system:
>
> /dev/raid0b     none    swap    sw      0 0
> /dev/wd0b       none    swap    dp      0 0
>
> +j
>
I've noticed a similar problem with dump hanging.   With me, no raid is 
involved,  I realized I had too much swap active, and was wasting real 
mem, so I disabled some, -- I may have hit original poster's problem -- 
I know I ended up doing something like what you suggest. I had swap 
devices devices /dev/wd0b, /dev/wd0m, and /dev/wd1b.
/dev/wd0m I disabled by changing to options, sw to xx.
wd1b is swap from disk with a 1.6 install on it, mainly just because of 
a vague feeling of "separate device must be better", I set that to 
dump, ( sw, to dp ) and removed dp from /dev/wd0b

Seemed to work, at first, kernel reports dumps on wd0b , during init, 
"swapctl: setting dump device to /dev/wd1b" ,so it seemed to work, but 
then, I triggered a panic accessing a corrupt ext2fs partition on an 
old zip disk.
...
panic: bad dir
syncing disks... 2 1 done

dumping to dev 0,9 offset 437415

just seems hung there until I hit the reset button, If I change fstab 
for wd1b to sw,dp and trigger a panic ( I kept the zip disk as is for 
that purpose) it panics, and dumps
as expected:
...
panic: bad dir
syncing disks... 1 done

dumping to dev 0,9 offset 437415
dump 155 154 ... 1 succeeded

rebooting...

Currently, I have swap on /dev/wd1b and dump on /dev/wd0b and it works, 
that and some things I tried with swapctl from command line, left me 
with the impression that it wouldn't dump --it would hang, unless the 
partition had at least once (per uptime) been swap. (/dev/wd0b is the 
configured swap in the kernel )