Diff for /wikisrc/guide/raidframe.mdwn between versions 1.6 and 1.12

version 1.6, 2013/03/02 13:20:56 version 1.12, 2013/04/29 16:45:04
Line 1 Line 1
   **Contents**
   
   [[!toc levels=3]]
   
 # NetBSD RAIDframe  # NetBSD RAIDframe
   
 ## RAIDframe Introduction  ## RAIDframe Introduction
Line 73  obtaining help. Line 77  obtaining help.
     search the list for the NetBSD platform on which you are using RAIDframe:      search the list for the NetBSD platform on which you are using RAIDframe:
     port-*`${ARCH}`*@NetBSD.org.      port-*`${ARCH}`*@NetBSD.org.
   
     ### Caution      *Caution*: Because RAIDframe is constantly undergoing development, some information in
   
         Because RAIDframe is constantly undergoing development, some information in  
         mailing list archives has the potential of being dated and inaccurate.          mailing list archives has the potential of being dated and inaccurate.
   
  3. Search the [Problem Report   3. Search the [Problem Report
Line 164  the RAID and: Line 166  the RAID and:
    be able to quickly reconfigure the system to boot from the remaining     be able to quickly reconfigure the system to boot from the remaining
    component (platform dependent).     component (platform dependent).
   
 ![RAID-1 Disk Logical Layout](/guide/images/raidframe_raidL1-diskdia.png)  ![RAID-1 Disk Logical Layout](/guide/images/raidframe_raidl1-diskdia.png)  
 **RAID-1 Disk Logical Layout**  **RAID-1 Disk Logical Layout**
   
 Because RAID-1 provides both redundancy and performance improvements, its most  Because RAID-1 provides both redundancy and performance improvements, its most
Line 192  has become the de facto standard for set Line 194  has become the de facto standard for set
  1. Install a stock NetBSD onto Disk0 of your system.   1. Install a stock NetBSD onto Disk0 of your system.
   
   
     ![Perform generic install onto Disk0/wd0](/guide/images/raidframe_r1r-pp1.png)      ![Perform generic install onto Disk0/wd0](/guide/images/raidframe_r1r-pp1.png)  
     **Perform generic install onto Disk0/wd0**      **Perform generic install onto Disk0/wd0**
   
  2. Use the installed system on Disk0/wd0 to setup a RAID Set composed of   2. Use the installed system on Disk0/wd0 to setup a RAID Set composed of
     Disk1/wd1 only.      Disk1/wd1 only.
   
     ![Setup RAID Set](raidframe_r1r-pp2.png)      ![Setup RAID Set](/guide/images/raidframe_r1r-pp2.png)  
     **Setup RAID Set**      **Setup RAID Set**
   
  3. Reboot the system off the Disk1/wd1 with the newly created RAID volume.   3. Reboot the system off the Disk1/wd1 with the newly created RAID volume.
   
   
     ![Reboot using Disk1/wd1 of RAID](/guide/images/raidframe_r1r-pp3.png)      ![Reboot using Disk1/wd1 of RAID](/guide/images/raidframe_r1r-pp3.png)  
     **Reboot using Disk1/wd1 of RAID**      **Reboot using Disk1/wd1 of RAID**
   
   
  4. Add / re-sync Disk0/wd0 back into the RAID set.   4. Add/re-sync Disk0/wd0 back into the RAID set.
   
     ![Mirror Disk1/wd1 back to Disk0/wd0](/guide/images/raidframe_r1r-pp4.png)      ![Mirror Disk1/wd1 back to Disk0/wd0](/guide/images/raidframe_r1r-pp4.png)  
     **Mirror Disk1/wd1 back to Disk0/wd0**      **Mirror Disk1/wd1 back to Disk0/wd0**
   
 ### Hardware Review  ### Hardware Review
Line 221  RAID level. Booting from a RAID set is a Line 223  RAID level. Booting from a RAID set is a
 boot loader to understand both 4.2BSD/FFS and RAID partitions. The 1st boot  boot loader to understand both 4.2BSD/FFS and RAID partitions. The 1st boot
 block code only needs to know enough about the disk partitions and file systems  block code only needs to know enough about the disk partitions and file systems
 to be able to read the 2nd stage boot blocks. Therefore, at any time, the  to be able to read the 2nd stage boot blocks. Therefore, at any time, the
 system's BIOS / firmware must be able to read a drive with 1st stage boot blocks  system's BIOS/firmware must be able to read a drive with 1st stage boot blocks
 installed. On the i386 platform, configuring this is entirely dependent on the  installed. On the i386 platform, configuring this is entirely dependent on the
 vendor of the controller card / host bus adapter to which your disks are  vendor of the controller card/host bus adapter to which your disks are
 connected. On sparc64 this is controlled by the IEEE 1275 Sun OpenBoot Firmware.  connected. On sparc64 this is controlled by the IEEE 1275 Sun OpenBoot Firmware.
   
 This article assumes two identical IDE disks (`/dev/wd{0,1}`) which we are going  This article assumes two identical IDE disks (`/dev/wd{0,1}`) which we are going
Line 365  use Line 367  use
 [disklabel(8)](http://netbsd.gw.com/cgi-bin/man-cgi?disklabel+8+NetBSD-5.0.1+i386)  [disklabel(8)](http://netbsd.gw.com/cgi-bin/man-cgi?disklabel+8+NetBSD-5.0.1+i386)
 to allocate the entire second disk to the RAID-1 set.  to allocate the entire second disk to the RAID-1 set.
   
 *Tip*: The best way to ensure that Disk1/wd1 is completely empty is to 'zero'  *Tip*:
 out the first few sectors of the disk with  > The best way to ensure that Disk1/wd1 is completely empty is to 'zero'
 [dd(1)](http://netbsd.gw.com/cgi-bin/man-cgi?dd+1+NetBSD-5.0.1+i386) . This will  > out the first few sectors of the disk with
 erase the MBR (i386) or Sun disk label (sparc64), as well as the NetBSD disk  > [dd(1)](http://netbsd.gw.com/cgi-bin/man-cgi?dd+1+NetBSD-5.0.1+i386) . This will
 label. If you make a mistake at any point during the RAID setup process, you can  > erase the MBR (i386) or Sun disk label (sparc64), as well as the NetBSD disk
 always refer to this process to restore the disk to an empty state.  > label. If you make a mistake at any point during the RAID setup process, you can
   > always refer to this process to restore the disk to an empty state.
 *Note*: On sparc64, use `/dev/rwd1c` instead of `/dev/rwd1d`!  > 
   > *Note*: On sparc64, use `/dev/rwd1c` instead of `/dev/rwd1d`!
     # dd if=/dev/zero of=/dev/rwd1d bs=8k count=1  > 
     1+0 records in  >     # dd if=/dev/zero of=/dev/rwd1d bs=8k count=1
     1+0 records out  >     1+0 records in
     8192 bytes transferred in 0.003 secs (2730666 bytes/sec)  >     1+0 records out
   >     8192 bytes transferred in 0.003 secs (2730666 bytes/sec)
 Once this is complete, on i386, verify that both the MBR and NetBSD disk labels  > 
 are gone. On sparc64, verify that the Sun Disk label is gone as well.  > Once this is complete, on i386, verify that both the MBR and NetBSD disk labels
   > are gone. On sparc64, verify that the Sun Disk label is gone as well.
 On i386:  > 
   > On i386:
     # fdisk /dev/rwd1d  > 
       >     # fdisk /dev/rwd1d
     fdisk: primary partition table invalid, no magic in sector 0  >     
     Disk: /dev/rwd1d  >     fdisk: primary partition table invalid, no magic in sector 0
     NetBSD disklabel disk geometry:  >     Disk: /dev/rwd1d
     cylinders: 19386, heads: 16, sectors/track: 63 (1008 sectors/cylinder)  >     NetBSD disklabel disk geometry:
     total sectors: 19541088  >     cylinders: 19386, heads: 16, sectors/track: 63 (1008 sectors/cylinder)
       >     total sectors: 19541088
     BIOS disk geometry:  >     
     cylinders: 1023, heads: 255, sectors/track: 63 (16065 sectors/cylinder)  >     BIOS disk geometry:
     total sectors: 19541088  >     cylinders: 1023, heads: 255, sectors/track: 63 (16065 sectors/cylinder)
       >     total sectors: 19541088
     Partition table:  >     
     0: <UNUSED>  >     Partition table:
     1: <UNUSED>  >     0: <UNUSED>
     2: <UNUSED>  >     1: <UNUSED>
     3: <UNUSED>  >     2: <UNUSED>
     Bootselector disabled.  >     3: <UNUSED>
       >     Bootselector disabled.
     # disklabel -r wd1  >     
       >     # disklabel -r wd1
     [...snip...]  >     
     16 partitions:  >     [...snip...]
     #        size    offset     fstype [fsize bsize cpg/sgs]  >     16 partitions:
      c:  19541025        63     unused      0     0        # (Cyl.      0* - 19385)  >     #        size    offset     fstype [fsize bsize cpg/sgs]
      d:  19541088         0     unused      0     0        # (Cyl.      0 - 19385)  >      c:  19541025        63     unused      0     0        # (Cyl.      0* - 19385)
   >      d:  19541088         0     unused      0     0        # (Cyl.      0 - 19385)
 On sparc64:  > 
   > On sparc64:
     # sunlabel /dev/rwd1c  > 
       >     # sunlabel /dev/rwd1c
     sunlabel: bogus label on `/dev/wd1c' (bad magic number)  >     
       >     sunlabel: bogus label on `/dev/wd1c' (bad magic number)
     # disklabel -r wd1  >     
       >     # disklabel -r wd1
     [...snip...]  >     
     3 partitions:  >     [...snip...]
     #        size    offset     fstype [fsize bsize cpg/sgs]  >     3 partitions:
      c:  19541088         0     unused      0     0        # (Cyl.      0 -  19385)  >     #        size    offset     fstype [fsize bsize cpg/sgs]
     disklabel: boot block size 0  >      c:  19541088         0     unused      0     0        # (Cyl.      0 -  19385)
     disklabel: super block size 0  >     disklabel: boot block size 0
   >     disklabel: super block size 0
   
 Now that you are certain the second disk is empty, on i386 you must establish  Now that you are certain the second disk is empty, on i386 you must establish
 the MBR on the second disk using the values obtained from Disk0/wd0 above. We  the MBR on the second disk using the values obtained from Disk0/wd0 above. We
Line 520  On sparc64: Line 523  On sparc64:
     a: start cyl =      0, size = 19541088 (19386/0/0 - 9541.55Mb)      a: start cyl =      0, size = 19541088 (19386/0/0 - 9541.55Mb)
     c: start cyl =      0, size = 19541088 (19386/0/0 - 9541.55Mb)      c: start cyl =      0, size = 19541088 (19386/0/0 - 9541.55Mb)
   
 *Note*: On i386, the `c:` and `d:` slices are reserved. `c:` represents the  *Note*: On i386, the `c:` and `d:` slices are reserved. `c:` represents the 
 NetBSD portion of the disk. `d:` represents the entire disk. Because we want to  NetBSD portion of the disk. `d:` represents the entire disk. Because we want to 
 allocate the entire NetBSD MBR partition to RAID, and because `a:` resides  allocate the entire NetBSD MBR partition to RAID, and because `a:` resides 
 within the bounds of `c:`, the `a:` and `c:` slices have same size and offset  within the bounds of `c:`, the `a:` and `c:` slices have same size and offset 
 values and sizes. The offset must start at a track boundary (an increment of  values. The offset must start at a track boundary (an increment of sectors 
 sectors matching the sectors/track value in the disk label). On sparc64 however,  matching the sectors/track value in the disk label). On sparc64 however, `c:` 
 `c:` represents the entire NetBSD partition in the Sun disk label and `d:` is  represents the entire NetBSD partition in the Sun disk label and `d:` is not 
 not reserved. Also note that sparc64's `c:` and `a:` require no offset from the  reserved. Also note that sparc64's `c:` and `a:` require no offset from the 
 beginning of the disk, however if they should need to be, the offset must start  beginning of the disk, however if they should need to be, the offset must start 
 at a cylinder boundary (an increment of sectors matching the sectors/cylinder  at a cylinder boundary (an increment of sectors matching the sectors/cylinder 
 value).  value).
   
 ### Initializing the RAID Device  ### Initializing the RAID Device
   
 Next we create the configuration file for the RAID set / volume. Traditionally,  Next we create the configuration file for the RAID set/volume. Traditionally,
 RAIDframe configuration files belong in `/etc` and would be read and initialized  RAIDframe configuration files belong in `/etc` and would be read and initialized
 at boot time, however, because we are creating a bootable RAID volume, the  at boot time, however, because we are creating a bootable RAID volume, the
 configuration data will actually be written into the RAID volume using the  configuration data will actually be written into the RAID volume using the
Line 632  as `/dev/raid0b`. Line 635  as `/dev/raid0b`.
 NetBSD Guide can expand on proper partitioning technique. See [Installing  NetBSD Guide can expand on proper partitioning technique. See [Installing
 NetBSD: Preliminary considerations and preparations*](inst).  NetBSD: Preliminary considerations and preparations*](inst).
   
 *Note*: Note that 1 GB is 2\*1024\*1024=2097152 blocks (1 block is 512 bytes, or  *Note*: 1 GB is 2\*1024\*1024=2097152 blocks (1 block is 512 bytes, or
 0.5 kilobytes). Despite what the underlying hardware composing a RAID set is,  0.5 kilobytes). Despite what the underlying hardware composing a RAID set is,
 the RAID pseudo disk will always have 512 bytes/sector.  the RAID pseudo disk will always have 512 bytes/sector.
   
Line 716  The NetBSD install now exists on the RAI Line 719  The NetBSD install now exists on the RAI
 mount-points in the new copy of `/etc/fstab` or the system will not come up  mount-points in the new copy of `/etc/fstab` or the system will not come up
 correctly. Replace instances of `wd0` with `raid0`.  correctly. Replace instances of `wd0` with `raid0`.
   
       # mv /mnt/etc/fstab /mnt/etc/fstab.old
       # sed 's/wd0/raid0/g' /mnt/etc/fstab.old > /mnt/etc/fstab
   
 The swap should be unconfigured upon shutdown to avoid parity errors on the RAID  The swap should be unconfigured upon shutdown to avoid parity errors on the RAID
 device. This can be done with a simple, one-line setting in `/etc/rc.conf`.  device. This can be done with a simple, one-line setting in `/etc/rc.conf`.
   
Line 773  rebooted. After the reboot everything is Line 779  rebooted. After the reboot everything is
     [...snip...]      [...snip...]
     # shutdown -r now      # shutdown -r now
   
 ### Warning  *Warning*: Always use
   
 Always use  
 [shutdown(8)](http://netbsd.gw.com/cgi-bin/man-cgi?shutdown+8+NetBSD-5.0.1+i386)  [shutdown(8)](http://netbsd.gw.com/cgi-bin/man-cgi?shutdown+8+NetBSD-5.0.1+i386)
 when shutting down. Never simply use  when shutting down. Never simply use
 [reboot(8)](http://netbsd.gw.com/cgi-bin/man-cgi?reboot+8+NetBSD-5.0.1+i386).  [reboot(8)](http://netbsd.gw.com/cgi-bin/man-cgi?reboot+8+NetBSD-5.0.1+i386).
Line 935  priority to Disk1/wd1 before Disk0/wd0.  Line 939  priority to Disk1/wd1 before Disk0/wd0. 
   
 BIOS.  BIOS.
   
 ![Award BIOS i386 Boot Disk1/wd1](/guide/images/raidframe_awardbios2.png)  ![Award BIOS i386 Boot Disk1/wd1](/guide/images/raidframe_awardbios2.png)  
 **Award BIOS i386 Boot Disk1/wd1**  **Award BIOS i386 Boot Disk1/wd1**
   
 Save changes and exit:  Save changes and exit:
Line 951  You can determine that the BIOS is readi Line 955  You can determine that the BIOS is readi
 boot loader is 30 seconds instead of 15. After the reboot, re-enter the BIOS an  boot loader is 30 seconds instead of 15. After the reboot, re-enter the BIOS an
 configure the drive boot order back to the default:  configure the drive boot order back to the default:
   
 ![Award BIOS i386 Boot Disk0/wd0](/guide/images/raidframe_awardbios1.png)  ![Award BIOS i386 Boot Disk0/wd0](/guide/images/raidframe_awardbios1.png)  
 **Award BIOS i386 Boot Disk0/wd0**  **Award BIOS i386 Boot Disk0/wd0**
   
 Save changes and exit:  Save changes and exit:

Removed from v.1.6  
changed lines
  Added in v.1.12


CVSweb for NetBSD wikisrc <wikimaster@NetBSD.org> software: FreeBSD-CVSweb