Cannot import raidz pool after zero fill one hdd.
Bartosz Stec
admin at kkip.pl
Sun May 23 14:57:41 UTC 2010
Hello list.
I'm not sure if it was my terrible mistake or some bug, but at this
moment my filesystem is unbootable and unimportable from fixit
environment and I'm pulling my hair off :(.
Here's how it happened:
I have a raidz pool consists of 3 HDD - ad0, ad1, ad2. It's zfs-only
i386-CURRENT system created by guide
http://wiki.freebsd.org/RootOnZFS/GPTZFSBoot/RAIDZ1.
Smartctl has showing some warnings about offline uncorrectable sectors
on ad0 every reboot, so I've decided to get rid of this by filling hdd
with zeroes, rebuilding gpt table and resilver zfs partition. So what I
did was:
zpool offline zroot gpt/disk0
swapoff gpt/swap0
sysctl kern./geom/.debugflags=/0x10/
dd if=/dev/zero of=/dev/ad0 bs=1M
After a while I've checked zpool status and ad0 was indeed offline, but
with about 200 errors? Shouldn't ZFS stop using this drive at all?
A moment later I tried to run bash script but I got i/o error. zpool
status showed some unrecoverable error in this file and in some
libraries. My guess was that zpool was still trying to use partition
gpt/disk0 which is offline, so to avoid fs corruption I've shutdown my
system and booted parted magic bootCD which has zerofill utility, and
ad0 was filled with zeroes.
After reboot loader shows some LBA errors and that it cannot find zpool.
I've booted this machine using about month old freebsd-current snapshot
and got into fixit environment.
Here's output of zpool import:
http://img715.imageshack.us/img715/7860/19843139.jpg
Zroot is in UNAVAIL state because of ad2p3 OFFLINE (which was never
offline), gpt/disk1 UNAVAIL, which is the same partition as ad1p3 which
is showed as ONLINE.
ad1p3 (gpt/disk1) and ad2p3 (gpt/disk2) should be both online and alive
because I didn't do anything with them. I played with labels to correct
this situation bu without success. I'm out of ideas, maybe some of you
could help with this mess. Taking ad2p3 online should be enough but is
it possible without importing pool? Google isn't really helpful with
that case.
Just to be sure if I filled correct drive with zeroes I checked output
of 'head /dev/ad[0-2]p3. ad[1-2]p3 contain data so there was no mistake
in there.
BUT I could made a mistake in other place - I didn't checked if
gpt/disk0 lays for sure on ad0 :( Maybe this is a cause of trouble - ad2
could be offline and zeroes flied to ad0 which was online. Hovewer,
system should be still alive if I could revert offline state of ad2p3.
Thanks in advance for help .
--
Bartosz
More information about the freebsd-fs
mailing list