Installing kFreeBSD

While looking at some of our groups overloaded and slowly dying file servers we kept thinking "man ZFS" would be cool, but installing it on linux is a pain. At some point I noticed the existance of Debian kFreeBSD, and thought that although it's a different kernel, having the same system management tools should make something that's reasonably easy to maintain.

I decided to download the testing build on november 20th with jigdo.

I downloaded the CD using:
jigdo-lite http://cdimage.debian.org/cdimage/weekly-builds/kfreebsd-amd64/jigdo-cd/debian-testing-kfreebsd-amd64-CD-1.jigdo

I thought I should try writing the boot image a usb stick instead of burning to a CD.

My first attempt was to dd the iso directly to raw disk /dev/sd?. (? was b in my case, but it may be different for others.) That didn't work so I tried again with creating a 1GB partition and then dding the iso to /dev/sd?1. That produced a USB disk that wasn't bootable.

I tried the instructions for building a boot usb stick from the Linux amd64 installation instructions, using the msdos mbr, msdosfs, but that didn't work for me either.

Eventually what I did was as follows (though it still has issues).

  • partition the usb stick
parted /dev/sdb mklabel msdos
parted /dev/sdb mkpart primary ext2 1 1024
parted /dev/sdb mkpart primary ext2 1025 -1
  • made a filesystem on the usb stick
mkfs -t ext2 /dev/sdb1
mount /dev/sdb1 /mnt
  • mounted the iso
losetup /dev/loop0 debian-testing-kfrebsd-amd64-CD-1.iso
mkdir /tmp/iso
mount /dev/loop0 /mnt/iso
  • copied all the files from the iso to the usb stick
rsync -av --progress /tmp/iso/ /mnt/
  • Installed grub on the usb stick
grub-install --boot-directory=/mnt/boot /dev/sdb

That usb stick did boot. Unfortunately the installer failed when it wanted to look for the cdrom. Earlier I had tried to boot off of a cd I'd burt, (which failed dropping me in a grub prompt).

So I combined my bootable usb stick that lacked all the packages, with my not-bootable, but filled with packages cdrom, and was able to install.

After rebooting I had some other problems.:

timecounter TSC must not be in use when changing frequencies; change denied
nfe0: discard frame w/o leading ethernet header

The nfe error would go away when I unplugged the ethernet cable.

I found the description of a solution at https://forums.freebsd.org/viewtopic.php?p=102477&sid=26e19a1139af0c0dbb50be3ed62369d6#p102477

It appears that frequency scaling causes problems with the timer. I followed the suggestions in the above post. To see what timers the FreeBSD kernel had available, and which it was using.

root# sysctl kern.timecounter.choice
kern.timecounter.choice: TSC-low(800) i8254(0) dummy(-1000000)
root# sysctl kern.timecounter.hardware
kern.timecounter.hardware: TSC-low

Running:

sysctl kern.timecounter.hardware=i8254

made the log messages go away.

So I edited my /etc/rc.local and added before exit 0

sysctl kern.timecounter.hardware=i8254

Since I hadn't seen the FreeBSD the above post was refering to.

tags: debian