Subject: Problems with grub booting XEN 2 on RaidFrame.
To: NetBSD-current <current-users@NetBSD.org>
From: Marcin Jessa <lists@yazzy.org>
List: port-xen
Date: 05/04/2006 14:36:48
Hi guys.

I set up RAID 0 with RaidFrame to run XEN on my=20
CURRENT 3.99.18 system following=20
http://www.netbsd.org/guide/en/chap-rf.html=20
and
http://mail-index.netbsd.org/port-xen/2006/03/01/0010.html

The RaidFrame itself works fine but trying to boot GENERIC XEN0 kernel
with grub I get following error:
kernel(hd0,e)/xen.gz dom0_mem=3D524288
   [Multiboot-elf, <0x100000:0x3f080:0x35f80>, shtab=3D0x175078,
entry=3D0x100000] module (hd0,e)/netbsd-XEN0 root=3D/dev/hda1 ro console=3D=
pc
Error 14: Filesystem compatibility error, cannot read whole file

http://www.gnu.org/software/grub/manual/html_node/Stage2-errors.html=20
says :
14 : Filesystem compatibility error, cannot read whole file
Some of the filesystem reading code in GRUB has limits on the length of
the files it can read. This error is returned when the user runs into
such a limit.=20

This explenation itself does not make much sense to me though.=20
Typing in grub shell:
grub> kernel (hd0,e)/=20
and pressining tab lists all the files and directories in the root file
system - /=20

The XEN0 kernel is not compressed and it's size is about 8.5M.
I thought I can try a different, smaller kernel that I had compiled=20
on a different computer that I run XEN on.=20
It's size is about 3Megs (also uncompressed).
And voila! The system booted.
What is wrong with GRUB? What are it's kernel size limitations?
Can it be somehow related to the fast that I use UFS2 instead of 1?

Maybe someone compenent could work on a new bootloader
code as a SoC project to replace GRUB needed for XEN and create
bootloader with config file read at boot being able to load modules ?
Propably something similar to FreeBSD's boot loader.

Cheers,
Marcin.


Additional system info:

NetBSD 3.99.18  on cpu0: "Intel(R) Pentium(R) 4 CPU 3.00GHz"

# disklabel -r raid0
# /dev/rraid0d:
type: unknown
disk: raid
label: fictitious
flags:
bytes/sector: 512
sectors/track: 128
tracks/cylinder: 8
sectors/cylinder: 1024
cylinders: 152638
total sectors: 156301312
rpm: 3600
interleave: 1
trackskew: 0
cylinderskew: 0
headswitch: 0           # microseconds
track-to-track seek: 0  # microseconds
drivedata: 0

16 partitions:
#        size    offset     fstype [fsize bsize cpg/sgs]
 a:    409600         0     4.2BSD   1024  8192 40960  # (Cyl.      0
-    399) b:   4096000    409600       swap                     #
(Cyl.    400 -   4399) c: 156301312         0     unused      0
0        # (Cyl.      0 - 152637) d: 156301312         0
unused      0     0        # (Cyl.      0 - 152637) e:  20480000
4505600     4.2BSD   2048 16384 27560  # (Cyl.   4400 -  24399) f:
1024000  24985600     4.2BSD   1024  8192 46552  # (Cyl.  24400 -
25399) g: 130291712  26009600     4.2BSD   2048 16384 29160  # (Cyl.
25400 - 152637)


# disklabel -r wd0 (same for wd1)
# /dev/rwd0d:
type: unknown
disk: DISK01
label:
flags:
bytes/sector: 512
sectors/track: 63
tracks/cylinder: 16
sectors/cylinder: 1008
cylinders: 155061
total sectors: 156301488
rpm: 3600
interleave: 1
trackskew: 0
cylinderskew: 0
headswitch: 0           # microseconds
track-to-track seek: 0  # microseconds
drivedata: 0

16 partitions:
#        size    offset     fstype [fsize bsize cpg/sgs]
 a: 156301425        63       RAID                     # (Cyl.      0*-
155060) b:   4096000   4096127       swap                     # (Cyl.
4063*-   8127*) c: 156301425        63     unused      0     0        #
(Cyl.      0*- 155060) d: 156301488         0     unused      0
0        # (Cyl.      0 - 155060) e:    409600       127
4.2BSD      0     0     0  # (Cyl.      0*-    406*) disklabel:
partitions a and b overlap disklabel: partitions a and e overlap

/grub/menu.lst :

# Grub config file for NetBSD/xen.
default=3D0
fallback=3D4
# boot after 10s the default entry if the user didn't hit keyboard
timeout=3D10
# Pretty colours
color cyan/blue white/blue

# Configure serial port to use as console. Ignore if you'll use VGA only
serial --unit=3D0 --speed=3D115200 --word=3D8 --parity=3Dno --stop=3D1
# Let the user select which console to use (serial or VGA), default
# to serial after 10s
terminal --timeout=3D10 serial console
=03#
#
# Xen/NetBSD with 512 MB
title Xen 2.0 / NetBSD - HD1
  root(hd0,e)
  kernel (hd0,e)/xen.gz dom0_mem=3D524288
  module (hd0,e)/netbsd-XEN0 root=3D/dev/hda1 ro console=3Dpc
#
title Xen 2.0 / NetBSD - HD2
  root(hd1,e)
  kernel (hd1,e)/xen.gz dom0_mem=3D524288
  module (hd1,e)/netbsd-XEN0 root=3D/dev/hda1 ro console=3Dpc

#
# Load the NetBSD bootloader, letting it load the NetBSD/i386 kernel.
title NetBSD chain (HDD1:0)
  root (hd0,0)
  chainloader +1
  title NetBSD chain (HDD2:0)
  root (hd1,0)
  chainloader +1
#
# Regular NetBSD - does not get boot options
title NetBSD - HD1
  root (hd0,e)
  kernel --type=3Dnetbsd /netbsd-GENERIC
title NetBSD - HD2
  root (hd1,e)
  kernel --type=3Dnetbsd /netbsd-GENERIC

## end of grub config file.