Booting from ZFS raidz

Stefan Bethke stb at lassitu.de
Thu Jul 16 12:26:04 UTC 2009


Am 12.07.2009 um 09:06 schrieb Jonathan Noack:

> Anyone know how I should proceed?  I'm really frustrated that I  
> haven't
> been able to get this working.

Me too. I just decided to revisit this, and unfortunatly, I'm still  
stuck with the loader having trouble reading blocks off the raidz1  
volume.  I've updated the creation script (see below).  This is on  
r195709, with LOADER_ZFS_SUPPORT?=YES in /etc/make.conf.


Boot output, transcribed by hand:
error 4 lba 4290782259
error 4 lba 4290782258
error 4 lba 4290782259
error 4 lba 4290782258
error 4 lba 4290782257
error 4 lba 4290782257
...
error 4 lba 4292652987
error 4 lba 4292652986
error 4 lba 4292652987

BTX loader 1.00  BTX version is 1.02
Consoles: internal video/keyboard
BIOS drive A: is disk0
BIOS drive C: is disk1
BIOS drive D: is disk2
BIOS drive E: is disk3
BIOS 638kB/2095040kB available memory

FreeBSD/i386 bootstrap loader, Revision 1.1
(root at freebsd-current-lassitu.de, Wed Jul 15 19:31.22 CEST 2009)
Loading /boot/defaults/loader.conf
ZFS: i/o error - all block copies unavailable
ZFS: i/o error - all block copies unavailable
... (about 10 more of these)
Unable to load a kernel!
can't load 'kernel'

Then the prompt.


My setup script:

# cat prepare-zfs-boot
#!/bin/sh

idx=0

label() {
	dd if=/dev/zero of=/dev/$1 bs=1m count=10
	sz="$(diskinfo /dev/$1 | awk '{print $4}')"
	echo $sz
	gpart destroy $1
	gpart create -s gpt $1
	gpart add -b 34 -s 128 -t freebsd-boot -l "boot${idx}" $1
	gpart bootcode -b /boot/pmbr -p /boot/gptzfsboot -i 1 $1
	gpart add -b 512 -s $(($sz-1024)) -t freebsd-zfs -l "zfs${idx}" $1
	gpart list $1
	idx="$((idx+1))"
}

set -x

zpool destroy zroot

label da1
label da2
label da3

zpool create zroot raidz /dev/gpt/zfs[0-2]
zpool set bootfs=zroot zroot

zfs create -V 1gb zroot/swap
zfs set org.freebsd:swap=on zroot/swap
zfs set checksum=off zpool/swap

cd /usr/src && make installworld installkernel distribution DESTDIR=/ 
zroot
cp /boot/loader.conf /zroot/boot/loader.conf
echo 'zfs_load="YES"' >>/zroot/boot/loader.conf
echo 'vfs.root.mountfrom="zfs:zroot"' >>/zroot/boot/loader.conf

zpool export zroot
zpool import zroot
cp /boot/zfs/zpool.cache /zroot/boot/zfs/
zfs set mountpoint=legacy zroot
# eof

-- 
Stefan Bethke <stb at lassitu.de>   Fon +49 151 14070811






More information about the freebsd-fs mailing list