Subject: Re: misc/30427: guide raidframe chapter has lost dump information
To: None <misc-bug-people@netbsd.org, gnats-admin@netbsd.org,>
From: Jukka Salmi <j+nbsd@2005.salmi.ch>
List: netbsd-bugs
Date: 07/20/2005 13:21:02
The following reply was made to PR misc/30427; it has been noted by GNATS.

From: Jukka Salmi <j+nbsd@2005.salmi.ch>
To: gnats-bugs@netbsd.org
Cc: Tracy Di Marco White <nb-pr@gendalia.org>,
	Rui Paulo <rpaulo@NetBSD.org>,
	"Brian A. Seklecki" <lavalamp@spiritual-machines.org>
Subject: Re: misc/30427: guide raidframe chapter has lost dump information
Date: Wed, 20 Jul 2005 15:20:16 +0200

 --98e8jtXdkpgskNou
 Content-Type: text/plain; charset=us-ascii
 Content-Disposition: inline
 
 Rui Paulo wrote:
 > That section is currently commented on the XML file (I don't know why,
 > maybe it's old/broken ?). That's why you don't see it in the rendered
 > version.
 
 The section was commented while applying the patch provided by Brian
 A. Seklecki in PR misc/27059 to htdocs/guide/en/chap-rf.xml (rev 1.20).
 
 Quoting that PR:
 
 	A list of to-do's:
 	[...]
 	*) Re-add Dump-to-raw-SWAP-offset calculation instructions.
 
 The attached patch adds the missing information for i386. Additionaly,
 it re-adds the section about "Testing kernel dumps" which was deleted
 (why not commented out like the other kernel-dump-specific parts?).
 
 Comments are welcome.
 
 
 Cheers, Jukka
 
 -- 
 bashian roulette:
 $ ((RANDOM%6)) || rm -rf ~
 
 --98e8jtXdkpgskNou
 Content-Type: text/plain; charset=us-ascii
 Content-Disposition: attachment; filename="chap-rf.xml.diff"
 
 Index: chap-rf.xml
 ===================================================================
 RCS file: /cvsroot/htdocs/guide/en/chap-rf.xml,v
 retrieving revision 1.32
 diff -u -r1.32 chap-rf.xml
 --- chap-rf.xml	5 May 2005 12:21:22 -0000	1.32
 +++ chap-rf.xml	20 Jul 2005 13:13:37 -0000
 @@ -957,7 +957,6 @@
  1 files, 1 used, 4680062 free (14 frags, 585006 blocks, 0.0% fragmentation)</screen>
      </sect2>
  
 -    <!--
        <sect2 id="chap-rf-setup-kerneldump">
        <title>Setting up kernel dumps</title>
  
 @@ -977,24 +976,25 @@
        <para>First we need to take a look at the disklabel for swap (raid0b)
          and the real physical disk (wd1).</para>
  
 +      <para>On i386:</para>
 +
    <screen>
    &rprompt; <command>disklabel raid0</command>
  
    8 partitions:
    #        size    offset     fstype  [fsize bsize cpg/sgs]
 -   a:  16777216         0     4.2BSD   1024  8192    64
 -   b:   2097152  16777216     swap
 -   d: 241254528         0     unused      0     0     0
 -   e: 222380160  18874368     4.2BSD   1024  8192    64
 +   a:  19015680         0     4.2BSD   1024  8192    64
 +   b:    525184  19015680     swap
 +   d:  19540864         0     unused      0     0     0
  
  
    &rprompt; <command>disklabel wd1</command>
  
    8 partitions:
    #        size    offset     fstype  [fsize bsize cpg/sgs]
 -   a: 241254657        63     RAID
 -   c: 241254657        63     unused      0     0
 -   d: 241254720         0     unused      0     0
 +   a:  19541025        63     RAID
 +   c:  19541025        63     unused      0     0
 +   d:  19541088         0     unused      0     0
     </screen>
  
        <para>
 @@ -1008,15 +1008,15 @@
    63              # offset of wd1a
    64              # RF_PROTECTED_SECTORS
    +
 -  16777216        # offset of raid0b
 +  19015680        # offset of raid0b
    +p
 -  16777343        # offset of swap within wd1
 +  19015807        # offset of swap within wd1
    q
    </screen>
  
        <para>
 -        We know now that real offset of the still-nonexisting wd1b is 16777343
 -        and size is 2097152. Next we need to add wd1b to wd1's disklabel.
 +        We know now that real offset of the still-nonexisting wd1b is 19015807
 +        and size is 525184. Next we need to add wd1b to wd1's disklabel.
        </para>
  
    <screen>
 @@ -1025,10 +1025,10 @@
  
    8 partitions:
    #        size    offset     fstype  [fsize bsize cpg/sgs]
 -   a: 241254657        63       RAID
 -   b:   2097152  16777343       swap
 -   c: 241254657        63     unused      0     0
 -   d: 241254720         0     unused      0     0
 +   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>
 @@ -1044,19 +1044,18 @@
  
    <screen>
    &rprompt; <command>dc</command>
 -  241254657   # size of wd1a
 +  19541025    # size of wd1a
    64          # RF_PROTECTED_SECTORS
    -
    128         # stripe width
    /p
 -  1884801     # number of stripes
 +  152663      # number of stripes
    128         # number of blocks per stripe
    *p
 -  241254528   # size of raid0d
 +  19540864    # size of raid0d
    </screen>
  
      </sect2>
 -    -->
  
      <sect2 id="chap-rf-moving-files">
        <title>Migrating System to RAID</title>
 @@ -1078,7 +1077,7 @@
  	correctly.  Replace instances of <filename>wd0 </filename> with
  	<filename>raid0</filename>.</para>
  
 -      <!-- <para>Note that the kernel crash dumps must not be saved on a RAID
 +      <para>Note that the kernel crash dumps must not be saved on a RAID
          device but on a real physical disk (wd0b). This dump area was
          created in the previous chapter on the second disk (wd1b) but we
          will make wd0 an identical copy of wd1 later so wd0b and wd1b
 @@ -1090,12 +1089,13 @@
          new drive and we haven't initialized it yet with fdisk and
          disklabel. In this short period of time we can not make crash
          dumps in case of kernel panic.  Note how the dump device has the
 -        <quote>dp</quote> keyword on the 4th field.</para>-->
 +        <quote>dp</quote> keyword on the 4th field.</para>
  
        <screen>&rprompt; <command>vi /mnt/etc/fstab</command>
  
  /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>
  
 @@ -1494,4 +1494,29 @@
  Copyback is 100% complete.</screen>
      </sect2>
    </sect1>
 +
 +  <sect1 id="chap-rf-test-kernel-dumps">
 +    <title>Testing kernel dumps</title>
 +    <para>
 +      It is also important to test the kernel crash dumps so that
 +      they work correctly and do not overwrite any important
 +      filesystems (like the raid0e filesystem).
 +    </para>
 +
 +    <para>
 +      Press Ctrl+Alt+Esc to test the kernel crash dump. This will invoke the
 +      kernel debugger. Type <command>sync</command> or <command>reboot
 +      0x104</command> and press Enter. This will save the current kernel
 +      memory to the dump area (wd0b) for further analysis. Most likely the offset
 +      and/or size of wd0b is wrong if the system will not come up correctly
 +      after reboot (unable to mount /home, corrupted super-blocks, etc).
 +      It is very important to test this now, not when we have lots of
 +      valuable files in /home. As an example, the author destroyed his 100+ GB
 +      /home with a kernel crash dump! No real harm was caused by this because of
 +      up-to-date backups (backup was made just before converting to RAID-1).
 +      One more time: take a backup of all your files before following these
 +      instructions!
 +    </para>
 +
 +  </sect1>
  </chapter>
 
 --98e8jtXdkpgskNou--