Problems with first attempts to use ZFS
jmc-freebsd2 at milibyte.co.uk
Thu Jul 29 13:10:10 UTC 2010
Thinking that it's about time to learn a bit about ZFS I started with
the tutorial at <http://flux.org.uk/howto/solaris/zfs_tutorial_01>
I'm currently running 8.1-RELEASE i386 with a generic kernel and 3 disk
slices, each mirrored across 2 drives with gmirror. I appreciate the
current configuration is far from ideal for ZFS but I could use a file
based ZFS pool and the reduced performance shouldn't matter for a small
learning exercise. Though it appears that running a disk based pool on
a gmirror system was not a good thing.
First I created a couple of file based pools:
dd if=/dev/zero of=disk1 count=128 bs=1m
dd if=/dev/zero of=disk2 count=128 bs=1m
zpool create trout mirror /disk1/z/disk1 /disk1/z/disk2
zpool status trout
That looked ok, the ZFS filesystem /trout was created and I was able to
create data on it with dd if=/dev/zero of=/trout/foo count=32 bs=1m.
The next step was to test it by overwriting the first disk label with
dd if=/dev/random of=/disk1/z/disk1 bs=512 count=1
Then force ZFS to check with the zfs scrub command.
zpool scrub trout
At this point everything went pear shape, the whole system stopped and I
finally had to force a reboot with a hard reset.
On rebooting gmirror reported that all 3 slices on one of the drives
were degraded and rebuilt them.
Subsequent attempts to run zpool commands like list or status just lead
to kernel panics followed by gmirror rebuilds on rebooting.
How do I clear up this mess either by fixing the existing test ZFS pool
or just getting rid of it so that "zpool list" returns the "no pools
available" message instead of crashing the system. And, yes, I do have
backups so I can restore any files which might be needed.
More information about the freebsd-questions