Friday, February 11, 2005

 

Migration from OpenBSD to Linux

I had an old OpenBSD 3.4 box lying around, but as it had only a 150 MB hard disk, it was quite useless. I needed to build a firewall and as Debian woody fits nicely in that space, I migrated the box to Debian.

My setup:
wd0 - a 150 MB disk
wd0a - the 150 MB OpenBSD partition

Here's how:
  1. get the linux kernel and Debian setup initial ramdisk images:
    $ mkdir /lin; cd /lin
    $ wget ftp://ftp.ee.debian.org/debian/dists/stable/main/disks-i386/current/{bf2.4/linux.bin,images-1.44/bf2.4/root.bin}
  2. install grub into the boot block of the hard disk (THIS WILL DESTROY THE OPENBSD BOOTLOADER AND MAY RENDER YOUR DISK UNBOOTABLE):
    cd /tmp
    wget ftp://ftp.freebsd.org/pub/FreeBSD/ports/i386/packages-5-stable/All/grub-*
    tar jxf grub-*
    mv share/grub/i386-freebsd/ /grub
    dd if=/grub/stage1 of=/dev/wd0 bs=512 count=1
    dd if=/grub/stage2 of=/dev/wd0 bs=512 skip=1
  3. reboot, you will land into the grub shell,
    grub> root (hd0,1,a)
    grub> kernel /lin/linux.bin
    grub> initrd /lin/root.bin
    grub> boot
  4. Debian setup will start
Leave me comments and remember -- use the instructions at your own risk.
Comments: Post a Comment

<< Home

This page is powered by Blogger. Isn't yours?