OpenBSD Journal

Ask undeadly: is RAIDframe possible with pxeboot kernel?

Contributed by grey on from the interesting questions dept.

Jason Dixon writes in with an interesting question:

I wonder if it's possible to boot a RAIDframe mirror (RAID-1) using a raid-enabled kernel via pxeboot. I've looked in the raid and raidctl manpages, RAIDframe documentation, and all the OpenBSD list archives. The foremost relevant section I've seen is from the raid (4) manpage:

"RAID filesystems which are automatically configured are also 
eligible to be the root filesystem.  There is currently no support for 
booting a kernel directly from a RAID set.  To use a RAID set as the root 
filesystem, a kernel is usually obtained from a small non-RAID partition, 
after which any auto-configuring RAID set can be used for the root 
filesystem."
There's nothing here to suggest that a raid set can't be supported by booting the kernel from pxe. Has anyone else succeeded (or failed) attempting this type of configuration?

I have a gut feeling that this isn't likely to work, but do any undeadly readers have any suggestions for him? It is a neat idea at any rate.

(Comments are closed)


Comments
  1. By Chris Cappuccio (198.175.14.5) on

    I'm sorry...But what could possibly be interesting about this question? First, why would you want to do this.....More importantly, if you are curious, why not just try it? I can't imagine that it wouldn't work, and for that matter I can't imagine anyone having tried it either.

    Comments
    1. By Jason Dixon (68.65.108.126) jason_NO_SPAM@dixongroup_NO_SPAM.net on http://www.dixongroup.net/hatchet

      How else would you get a mirrored root partition using software RAID (particularly on 1U servers with only 2 drive bays)? Granted, hardware RAID is always an option, but there aren't any (AFAIK) management drivers/utilities for any of the OpenBSD-supported cards.

      I plan on attempting this soon, but was hoping someone from the community might provide their input on this before I reallocate hardware resources. I'm a little disappointed by your lack of imagination. What's with the sour attitude, anyways?

      Comments
      1. By djm@ (61.95.66.134) on

        Easy, the kernel doesn't need to live in the root partition.

        Comments
        1. By Pete (80.203.236.21) on http://www.petevickers.com

          little OT, but I have a sun V120, 1U server, with 2x36GB SCSI disk.

          I manually mirrored to two disks with:
          # dd if=dev/rsd0c of=/dev/rsd1c bs=16384 (after using disklabel to copy over label)

          Then set redundant boot in the prom:
          ok> setenv boot-device disk0 disk1

          Then adjust the two /etc/fstab versions as desired (depends on what you're protecting against). I also set altroot so 'daily' will sync up my backup root for me.

        2. By Jason Dixon (68.65.108.126) jason_NO_SPAM@dixongroup_NO_SPAM.net on http://www.dixongroup.net/hatchet

          Easy... if you're running more than two disks. How would you do that if you're stuck with only the two fully mirrored disks? I don't think you can.

          Comments
          1. By sthen (81.168.66.226) on

            The easiest way is probably to put the kernel onto compactflash and use a CF-IDE adapter. Although, your BIOS might boot from any working attached hard drive. If that's the case, just place a small standard partition on each to hold just the kernel.

          2. By djm@ (203.217.30.86) on

            Leave a small non-raid boot partition with the bookblocks and the kernel on each disk.

            Comments
            1. By click46 (216.193.221.121) on

              Maybe I'm just stuck up, but that doesn't seem very elegant a solution, to me.

              Comments
              1. By mirabile (2001:6f8:94d:1:2c0:9fff:fe1a:6a01) tg@66h.42h.de on http://mirbsd.de/

                Nope, it is actually the elegant solution. For RAID 1, it's good to "mirror" the slice with the kernel in it on the other disc as well. For RAID 0, you can just put some (32 MB or so should be enough for the bootloader and some kernels) additional swap on the disc. MirOS supports installing to a RAID device, even as root, natively; if you boot a ramdisk kernel you are asked for the root device as if you had given 'boot -a' (before, a RAID configured as ROOT device would override the 'root on rd0a' if the bsd.rd has autoconfig enabled), which is why 'boot -a' got fixed in OpenBSD for the first time after 2.8-current. I haven't tried pxeboot for that yet myself (I built it for the first time only a handfull of days ago), but successfully used our pxegrub port (with the diffs from Cedric Berger) for booting ramdisk kernels, and our main server is running with a root on RAID 1. I might suggest you play around with MirOS (since the need to recom- pile kernels and fix the installer ceases), and switch to OpenBSD once you are familiar with the setup.

                Comments
                1. By mirabile (2001:6f8:94d:1:2c0:9fff:fe1a:6a01) on

                  This is why I don't like the new deadly. Can't one make <pre> default?

      2. By Anonymous Coward (207.215.223.2) on

        This is from NetBSD, but appears they fixed a bug there, and allow for booting from RAID-1 sets using RAIDframe. E.g. http://www.netbsd.org/guide/en/chap-rf.html#chap-rf-boot-with-raid1

        Comments
        1. By Bill Hulley (81.187.213.245) jonny@abduction.org on

          This works 'cos NetBSD has specific support for raidframe raid-1 mirrors in its bootloader. You can fake up something similar using a slightly hacky disklabel and boot using the stock OpenBSD bootloader. For example:
          hostname# disklabel wd0
          [snip]
          #        size   offset    fstype   [fsize bsize   cpg]
            a:   262017      127    4.2BSD     1024  8192    85   # (Cyl.    0*- 260*)
            c: 19807200        0    unused        0     0         # (Cyl.    0 - 19649)
            f: 19807200        0      RAID                        # (Cyl.    0 - 19649)
          
          wd1 has an identical disklabel. then...
          hostname# disklabel raid0
          [snip]
          #        size   offset    fstype   [fsize bsize   cpg]
            a:   262017       63    4.2BSD     1024  8192    85   # (Cyl.    0*- 255*)
            b:   524160   262080      swap                        # (Cyl.  255*- 767*)
            c: 19807104        0    unused        0     0         # (Cyl.    0 - 19342*)
            d:   524160   786240    4.2BSD     1024  8192    85   # (Cyl.  767*- 1279*)
            e:  2097648  1310400    4.2BSD     1024  8192    85   # (Cyl. 1279*- 3328*)
            f:  2097648  3408048    4.2BSD     1024  8192    85   # (Cyl. 3328*- 5376*)
            g: 14301408  5505696    4.2BSD     1024  8192    85   # (Cyl. 5376*- 19342*)
          
          I found installboot complains when you try to run it against a /boot file on the mounted raid root file system, but mounting each half of the mirror (from the physical disk labels) then running installboot on each of them works:
          hostname# mount -o ro /dev/wd0a /mnt
          hostname# installboot /mnt/boot /usr/mdec/bootxx /dev/rwd0c
          hostname# umount /mnt
          hostname# mount -o ro /dev/wd1a /mnt
          hostname# installboot /mnt/boot /usr/mdec/bootxx /dev/rwd1c
          hostname# umount /mnt
          
          I have few machines using this now (i386 and alphas), they all seem to work just fine.

Credits

Copyright © - Daniel Hartmeier. All rights reserved. Articles and comments are copyright their respective authors, submission implies license to publish on this web site. Contents of the archive prior to as well as images and HTML templates were copied from the fabulous original deadly.org with Jose's and Jim's kind permission. This journal runs as CGI with httpd(8) on OpenBSD, the source code is BSD licensed. undeadly \Un*dead"ly\, a. Not subject to death; immortal. [Obs.]