ZFS 'read-only' device / pool scan / import?

Freddie Cash fjwcash at gmail.com
Tue Oct 19 21:03:12 UTC 2010


On Tue, Oct 19, 2010 at 1:30 PM, Willem Jan Withagen <wjw at digiware.nl> wrote:
> On 2010-10-19 17:30, Karl Pielorz wrote:
>
>> As there is such a large aspect of human error (and controller
>> behaviour), I don't think it's worth digging into any deeper. It's the
>> first pool we've ever "lost" under ZFS, and like I said a combination of
>> the controller collapsing devices, and humans replacing wrong disks,
>> 'twas doomed to fail from the start.
>>
>> We've replaced failed drives on this system before - but never rebooted
>> after a failure, before a replacement - and never replaced the wrong
>> drive :)
>>
>> Definitely a good advert for backups though :)
>
> I'm running my ZFS stuff on a 3ware and an areca controller, and they once
> in a while forgot their order of disks during booting.
> (the 3ware got fixed by a bios upgrade)
> The areca just keeps reordering no matter how hard you like to tell it
> otherwise.
>
> But GPT really proves useful since reallocation of disks does not result in
> a different device in the gpt directory.
>
> eg.:
>  pool: zroot
>  state: ONLINE
>  scrub: none requested
> config:
>
>        NAME           STATE     READ WRITE CKSUM
>        zroot          ONLINE       0     0     0
>          mirror       ONLINE       0     0     0
>            gpt/root4  ONLINE       0     0     0
>            gpt/root6  ONLINE       0     0     0
>
> I could even migrate a disk from the 3ware controller to the std SATA
> interfaces without losing the the gpt-label.

While using labelled devices (be it glabel, gpt label, or whatever)
certainly helps keep things ordered and working.

However, ZFS also labels the devices in the pool.  A simple "zpool
export poolname" followed by a "zpool import poolname" will scan the
metadata on the drives, find all the devices in the pool, re-order
things internally, and carry on.

Back when I started with ZFS, I used unlabelled drives (also on 3Ware
controllers) and made the mistake once of booting with a failed drive
removed.  Pool came up faulted saying all the drives after the missing
one were also faulted.  Thought I lost the whole pool.  However, some
digging online showed the export/import info, and I was able to
continue on without losing any data.

-- 
Freddie Cash
fjwcash at gmail.com


More information about the freebsd-fs mailing list