From NAS-Central Buffalo - The Linkstation Wiki
Overview of the installation process
First, you have to install a working GNU/Linux-distribution. I prefer a Debian installation, and will use that in this guide, but you can probably do the same with Gentoo or any other installation. We use this GNU/Linux installation to set up a working NetBSD installation on a memory stick (USB stick). From this stick we can bootstrap NetBSD by partitioning/disklabeling and copying the installation. Finally, we boot into the NetBSD installation on the harddisk.
You keep your GNU/Linux-system on your Kurobox. This is required in order to boot NetBSD.
- A Kurobox HG (this will probably work on a regular Kurobox as well, but I did not test it. If you do, please update this page).
- A PC to connect to the Kurobox. This can be a GNU/Linux, *BSD, Windows, Mac OS X system, anything that has a network connection, ssh and telnet.
- An HDD in your Kurobox that is sufficiently large (a few GB should suffice).
- A memory stick of at least 256 MB.
- A little bit NetBSD knowledge could come in handy but it is not required.
Installing Debian GNU/Linux
Follow the steps on this page, with a few minor comments:
- I only created a 1GB partition on /dev/hda1, but this should not matter much.
- You probably don't need a swap partition (/dev/hda2) if you are not going to use your GNU/Linux-installation much.
- Do not create a /dev/hda3-partition. We let NetBSD's fdisk do this.
- I upgraded to Debian Etch but this is not necessary if you are not going to use your GNU/Linux-installation much. The Debian installation page is for Woody (3.0). This distribution is no longer supported by Debian, you should upgrade to Sarge (3.1) and then to Etch (4.0) if you are going to use Debian on a regular basis in order to get the latest security updates.
- Do not install U-boot, keep Linux 2.4.17 or 2.4.20. (You can probably compile the module for other versions of Linux 2.4.x as well, not sure about Linux 2.6)
Installing NetBSD on your memory stick
Fetch the following files from the Internet:
- NetBSD 3.0 kernel: http://kurobsd.ki.nu/download/kernel/sample/netbsd.GENERIC3.20060417.bin.bz2
- Linux 2.4-modules to load the NetBSD kernel: http://kurobsd.ki.nu/download/boot/loader/nbloader_v2.20060225.tar.bz2
- The NetBSD 3.0 installation: http://kurobsd.ki.nu/download/testing/disk-image/20060528/256M_BSD3.img.bz2
- The NetBSD startup-script: http://www.student.tue.nl/Q/j.f.berndsen/netbsd_load
- Install the bunzip2-utility:
apt-get install bzip2
- Make a directory for your NetBSD-stuff:
mkdir /root/netbsd ; cd /root/netbsd
- FTP / SCP the above files to your Kurobox and place them in /root/netbsd
- Unpack the kernel:
- Unpack the NetBSD 3.0-installation:
- Unpack the Linux 2.4-modules:
- Make the startup-script executable:
chmod a+x netbsd_load
- Determine which module to use:
ln -s nbloader_v2/binary/`uname -r`/nbloader_v2.o nbloader_v2.o
- Insert your USB-stick into the Kurobox. The device will probably be /dev/sda. You can check this:
dmesg | tail
- Your USB-stick will be wiped with the next command!! Copy NetBSD to the USB-stick:
dd if=256_BSD3.img of=/dev/sda bs=1M sync
- Start NetBSD from your USB-stick:
- If you have a DHCP-server on your network, the Kurobox will get an IP from your DHCP-server. Otherwise, it falls back to either 192.168.200.200 (Kurobox) or 192.168.200.210 (Kurobox HG). Determine the IP-address that your Kurobox got.
- Telnet into your box (replace 192.168.1.37 with your Kurobox's IP). The user is 'bsduser', no password needed.
Congratulations, you have now successfully run NetBSD.
Note: when I was doing this, a power outage in my town made my USB-stick unreadable. You have to shutdown your box with the 'halt' command (rebooting into Debian can be done with the 'reboot' command).
Installing NetBSD on your Kurobox's HDD
Next, we are going to install NetBSD on your Kurobox's hard disk drive. I assume you have booted into NetBSD.
- Create a partition for NetBSD (wd0 is your first drive. This is called "hda" in Linux.)
fdisk -u wd0
- Press Enter
Disk: /dev/rwd0d NetBSD disklabel disk geometry: cylinders: 620181, heads: 16, sectors/track: 63 (1008 sectors/cylinder) total sectors: 625142448
BIOS disk geometry: cylinders: 1024, heads: 255, sectors/track: 63 (16065 sectors/cylinder) total sectors: 625142448
Do you want to change our idea of what BIOS thinks? [n]
- Enter the partition you want to use for NetBSD (if you have no swap, this is 1, otherwise, as in my case, 2):
Partition table: 0: Linux native (sysid 131) start 63, size 2056257 (1004 MB, Cyls 0-128) 1: Linux swap or Prime or Solaris (sysid 130) start 2056320, size 1060290 (518 MB, Cyls 128-194) 2: NetBSD (sysid 169) start 3116610, size 622020735 (303721 MB, Cyls 194-38913) 3: <UNUSED> Which partition do you want to change?: [none] 2
- Enter 169 (the NetBSD partition type):
The data for partition 2 is: NetBSD (sysid 169) start 3116610, size 622020735 (303721 MB, Cyls 194-38913) sysid: [0..255 default: 169]
- The defaults for the location of your partition are usually fine, but double check them. Finally press 'y' on:
Should we write new partition table? [n]
- The NetBSD partitioning system works a little bit different from that of GNU/Linux or Windows. We now have to 'disklabel' the wd0-disk:
disklabel -i -I wd0
- Create a 1GB NetBSD-"subpartition" on 'g':
- Select 4.2BSD
Filesystem type [?] [none]: 4.2BSD
- Choose the partition to start after your swap-partition (which NetBSD does not detect and displays as 'unknown')
Start offset ('x' to start after partition 'x'): f
- Choose 1024M:
Partition size ('$' for all remaining): 1024M
- Write the new disklabel to the disk
- Create a new filesystem on /dev/wd0g:
- Mount this filesystem:
mount /dev/wd0g /mnt
- Copy over the NetBSD-installation from the USB-stick to the HDD:
cd /mnt dump 0af - / | restore rf -
- Edit /mnt/etc/fstab. Make sure the first line, first column is "/dev/wd0g" and NOT something else, or your system will not boot. Edit this with:
vi etc/fstab cw/dev/wd0g<ESC>:wq<ENTER>
- Reboot into Debian:
We have installed NetBSD on your Kurobox. You can remove your USB-stick.
- You can now boot into NetBSD with:
cd /root/netbsd ./netbsd_load hdd
- You can telnet into your box again using the same IP as before!
Using an encrypted filesystem
To be written.