Port-xen archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

grub vs. raidframe



I recently had occasion to want to run Xen on a system with mirrored
root disks (mmm, RAIDframe), and whereas a message from around a year
ago hinted at how to do it, the details were left as an exercise to
the reader.  Since I've just gone and done it, I thought I'd share
the recipe here for the enlightenment of others in the same boat.
(and also because I'm likely to forget details myself!)


I started with a NetBSD system with two disks, wd0 and wd1, in a RAID1
configuration.  (for details how to set this up, see the NetBSD guide)
The RAID partition on each disk was the 'a' partition:

 a:  39102273        63       RAID                     # (Cyl.      0*-  38791)


From the message last year, I knew that I'd need to create an overlapping
partition offset by 63 plus RF_PROTECTED_SECTORS (64), for GRUB to look at.
I did this on partition 'f':

 f:  37005056       127     4.2BSD   1024  1024 46608  # (Cyl.      0*-  36711*)

(f is the same size as my raid0a partiton, offset by 127 sectors from the
beginnning of the disk)

The tricky part was figuring out how to actually _install_ grub - as Thor
noted in his message, grub-install _insists_ on trying to use raid0a,
even when given rwd0d, so I had to use the grub shell by hand.  First,
I created /grub , and populated it with the various stage* files.  Then,
I created /grub/menu.lst with enough to chainload a netbsd kernel:

# menu.lst
default=0
timeout=10
serial --unit=0 --speed=9600 --word=8 --parity=no --stop=1
terminal --timeout=10 serial console
# for now, just chainload NetBSD
title NetBSD chain
  root          (hd0,0)
  chainloader +1
# GRUB native netbsd
title NetBSD GRUB
  root          (hd0,f)
  kernel --type=netbsd /netbsd


(I added the "GRUB native" because in one of my iterations, I accidentally
overwrote the NetBSD bootblock in wd0f with GRUB, so chainloading was
a bit... circular)

Then, I used the grub "shell" to install the bootblocks:

# grub --no-floppy

grub> root (hd0,f)
 Filesystem type is ffs, partition type 0xa9

grub> setup --stage2=/grub/stage2 --prefix=/grub (hd0)
 Checking if "/grub/stage1" exists... yes
 Checking if "/grub/stage2" exists... yes
 Checking if "/grub/ffs_stage1_5" exists... yes
 Running "embed /grub/ffs_stage1_5 (hd0)"...  14 sectors are embedded.
succeeded
 Running "install --stage2=/grub/stage2 /grub/stage1 (hd0) (hd0)1+14 p (hd0,0,f

)/grub/stage2 /grub/menu.lst"... succeeded
Done.

grub> quit

#


Once this is done, you should be able to boot /netbsd from the raid with
grub!  From there, it's simple enough to set up grub for Xen usage, as
per the Xen howto..


I hope this helps somebody else - 

+j



Attachment: pgpairsSQFMA_.pgp
Description: PGP signature



Home | Main Index | Thread Index | Old Index