Subject: Re: [RAIDframe] 16.3.7 Setting up kernel dumps
To: None <netbsd-docs@NetBSD.org>
From: Ryan Cresawn <cresawn@chass.utoronto.ca>
List: netbsd-docs
Date: 08/16/2005 13:36:56
Jukka,
As promised, I have updated chap-rf.xml based on your RAIDframe
advice. Please note that I have also corrected a small problem with
an example in the document. The correction is that the kernel dump
flag was shown to be 'dw' in the documentation, but it should read
'dp'. 'dp' is also what is stated to be the correct flag elsewhere in
the documentation and it corresponds with fstab(5).
Finally, there is a problem with booting from the bootblock on
/dev/sd0a; however, not from /dev/sd1a. I'm not quite sure how to
remedy this and wonder if it is something that should be documented as
a sparc64-specific problem. I found this URL which partially
addresses the problem:
http://www.netbsd.org/Ports/sparc64/faq.html#fast-dmmu-miss
My screen looks like this when I execute 'boot' or 'boot disk0' or
'boot disk0 netbsd', which all do the same thing:
Rebooting with command: boot
Boot device: disk File and args:
NetBSD IEEE 1275 Bootblock
.Inode not directory
Fast Data Access MMU Miss
ok _
But it really isn't ok. ;^) I don't quite understand how this could
happen. I was successfully booting disk0 without any problems prior
to this RAID-1 configuration. Any thoughts?
Ryan
*** chap-rf.xml 2005/08/16 16:53:07 1.1
--- chap-rf.xml 2005/08/16 17:10:34 1.2
***************
*** 983,988 ****
--- 983,1039 ----
d: 19541088 0 unused 0 0
</screen>
+ <para>On sparc64:</para>
+
+ <screen>
+ &rprompt; <command>disklabel raid0</command>
+
+ 8 partitions:
+ # size offset fstype [fsize bsize cpg/sgs]
+ a: 19015680 0 4.2BSD 1024 8192 64
+ b: 525184 19015680 swap
+ c: 19540864 0 unused 0 0 0
+
+
+ &rprompt; <command>disklabel wd1</command>
+
+ 8 partitions:
+ # size offset fstype [fsize bsize cpg/sgs]
+ a: 19541088 0 RAID
+ c: 19541088 0 unused 0 0
+ </screen>
+
+ <para>
+ Each RAID set has a 64 block reserved area (see RF_PROTECTED_SECTORS in
+ <dev/raidframe/raidframevar.h>) in the beginning of the set
+ to store the internal RAID structures.
+ </para>
+
+ <screen>
+ &rprompt; <command>dc</command>
+ 64 # RF_PROTECTED_SECTORS
+ 19015680 # offset of raid0b
+ +p
+ 19015744 # offset of swap within wd1
+ q
+ </screen>
+
+ <para>We know now that real offset of the still-nonexisting wd1b
+ is 19015744 and size is 525184. Next we need to add wd1b to
+ wd1's disklabel.</para>
+
+ <screen>
+ &rprompt; <command>disklabel wd1 > disklabel.wd1</command>
+ &rprompt; <command>vi disklabel.wd1</command>
+
+ 8 partitions:
+ # size offset fstype [fsize bsize cpg/sgs]
+ a: 19541025 63 RAID
+ b: 2097152 19015807 swap
+ c: 19541025 63 unused 0 0
+ d: 19541088 0 unused 0 0
+ </screen>
+
<para>Next we install the new disklabel.</para>
<screen>
***************
*** 1047,1053 ****
/dev/raid0a / ffs rw 1 1
/dev/raid0b none swap sw 0 0
! /dev/wd0b none swap dw 0 0
kernfs /kern kernfs rw
procfs /proc procfs rw</screen>
--- 1098,1104 ----
/dev/raid0a / ffs rw 1 1
/dev/raid0b none swap sw 0 0
! /dev/wd0b none swap dp 0 0
kernfs /kern kernfs rw
procfs /proc procfs rw</screen>
On Mon, Aug 15, 2005 at 08:22:51PM +0200, Jukka Salmi wrote:
> Hi,
>
> Ryan Cresawn --> netbsd-docs (2005-08-15 12:09:24 -0400):
> > http://www.netbsd.org/guide/en/chap-rf.html#chap-rf-setup-kerneldump
> >
> > The trouble I'm having is that the sparc64 documentation for this
> > section is absent.
>
> Until about two weeks ago, the whole chapter 16.3.7. ("Setting up
> kernel dumps") was missing. It was commented out some time ago while
> applying a documentation update. For details see PR [1]misc/30427.
>
> I recalculated the numbers for i386 only because I don't have a sparc64
> system to test with. This also means: what follows in this message is
> what I think is correct, but I can't test it, so use it with care.
>
>
> > The use of the 'dc' command gets a bit confusing due to the offset of
> > 'sd1a' on sparc64 being 0 as opposed to 63 on i386.
>
> Just substitute 0 for 63 (see below).
>
>
> > What is equally
> > confusing to me is that since 'sd1a' and 'sd1c' have the same size it
> > appears I have left no room for a swap partition at 'sd1b'.
>
> That's the same situation as described for i386 in the documentation.
> In your case, the RAID partition (sd1a) uses the whole disk (sd1c);
> thus these two partitions have the same offset size. Your swap partition
> (raid0b) resides _within_ the RAID partition (sd1a). To calculate the
> offset of your dump partition, add RF_PROTECTED_SECTORS to raid0b's
> offset; the size is the same as raid0b's size. In your case, this is:
>
> # disklabel raid0
> [...]
> # size offset fstype [fsize bsize cpg/sgs]
> a: 33804288 0 4.2BSD 2048 16384 28368
> b: 1573888 33804288 swap
> c: 35378432 0 unused 0 0
>
> # disklabel sd1
> [...]
> # size offset fstype [fsize bsize cpg/sgs]
> a: 35378533 0 RAID
> b: 1573888 33804352 swap
> c: 35378533 0 unused 0 0
>
>
> > I am happy to document the sparc64-specific section of the
> > RAIDframe documentation and send a unified diff file if that would be
> > desirable.
>
> That would be great. The file to patch is [2]htdocs/guide/en/chap-rf.xml.
>
>
> Cheers, Jukka
>
> [1] http://www.netbsd.org/cgi-bin/query-pr-single.pl?number=30427
> [2] http://cvsweb.netbsd.org/bsdweb.cgi/htdocs/guide/en/chap-rf.xml
>
> --
> bashian roulette:
> $ ((RANDOM%6)) || rm -rf ~