[PLUG] Need help booting M0n0wall (FreeBSD) using Grub

eehouse eehouse at eehouse.org
Sun Oct 29 15:55:29 UTC 2006


This weekend's project is a WRAP box I use as a home firewall/router.

For storage I have a 1G (Sandisk) CF card with GRUB on the MBR.  There
are three extended partitions, formatted ext2, with Grub's files in
one and a couple of LEAF releases in the others.  Everything works
that far: on boot I see the Grub menu over the serial console and can
boot either of the LEAF releases.  Here's how LEAF's fdisk sees the
card:

Command (m for help): p

Disk /dev/hda: 1024 MB, 1024966656 bytes
32 heads, 63 sectors/track, 993 cylinders
Units = cylinders of 2016 * 512 = 1032192 bytes

   Device Boot      Start         End      Blocks   Id  System
/dev/hda1               1         125      125968+  a5  FreeBSD
/dev/hda2             126         250      126000   a5  FreeBSD
/dev/hda3             251         375      126000   a5  FreeBSD
/dev/hda4             376         993      622944    5  Extended
/dev/hda5             376         377        1984+  83  Linux
/dev/hda6             378         382        5008+  83  Linux
/dev/hda7             383         387        5008+  83  Linux

I got the card (1G Sandisk CF and SD cards are $20 at Staples this
week, BTW :-) and set aside the larger primary partitions in order to
play with M0n0wall, a FreeBSD-based firewall/router distribution.  But
I can't get Grub to boot M0n0wall.

I downloaded a monowall image, and wrote it to an old but proven 8M
card (in a USB reader) just to confirm that it works:

# dd if=/tmp/wrap-1.22.img of=/dev/sda

Here's what my desktop's fdisk says about that card after dd finishes:

Command (m for help): p

Disk /dev/sda: 8 MB, 8028160 bytes
256 heads, 63 sectors/track, 0 cylinders
Units = cylinders of 16128 * 512 = 8257536 bytes

   Device Boot      Start         End      Blocks   Id  System
/dev/sda4   *           1           4       25000   a5  FreeBSD
Partition 4 has different physical/logical endings:
     phys=(1023, 255, 63) logical=(3, 25, 41)

I can boot my WRAP box off of this card, and it takes me into the
M0n0wall setup process, so I think the image is good.

But if I then write the image to the 1G card grub can't handle it.
I've tried writing the original image (the same I dd'd to /dev/sda) to
/dev/sda3, which I think was wrong since that image is an entire disk.
But I've also dd'd /dev/sda4 from the working M0n0wall 8M disk and
written that to /dev/sda3 of the 1G disk.  In either case grub can't
boot, and the failures look the same:

root (hd0,2)
 Filesystem type unknown, partition type 0xa5
makeactive
chainloader +1

Not ufs
Not ufs
No /boot/loader
 
>> FreeBSD/i386 BOOT
Default: 0:ad(0,a)/kernel
boot: 
Not ufs
No /kernel
 
>> FreeBSD/i386 BOOT
Default: 0:ad(0,a)/kernel
boot: 

I got my Grub off my desktop, which is current Debian "testing".  It
doesn't seem to include support for ufs.  But what I've read about
booting FreeBSD suggests that at least the chainloader method should
work, yet it doesn't.  I downloaded grub 0.97 sources (apt-get source
is broken for me for some reason, so I went to gnu.org) and built with
ufs support, but it wasn't clear to me how to install onto the CF
card, so I haven't tried that yet.  I did copy the ufs2_stage1_5 file
over, and ran grub's setup command on the WRAP box, but that didn't
help.

All of the instructions I've seen for dual-booting FreeBSD with Grub
assume you're doing a normal install onto a disk, then setting up
Grub.  I'm working with an image, and suspect that's part of the
problem.

Can anybody suggest a next step?

Thanks!

--Eric
-- 
******************************************************************************
* From the desktop of: Eric House, xwords at eehouse.org                        *
*        Crosswords 4.1.4 for PalmOS now ARM-native: xwords.sourceforge.net  *
******************************************************************************



More information about the PLUG mailing list