Have two identical 2Tb disks in mirror ZFS pool. Unfortunately, overwriten start of disks with errorneus attempt to attach them via HP Smartarray P400 RAID controller as separate RAID0 logical volumes who writen it's own metadata there.

Partition table (if was any created by zpool create - see below) and L0, L1 labels are lost. L1, L2 labels and data are intact as seen in hex.

zpool initially was created by simply adding raw devices to mirror pool like this - zpool create tank mirror /dev/sda /dev/sdb.

Is there any way to recover?

  • Were these disk originally connected to a Smart Array controller? Can you explain a bit more about what happened?
    – ewwhite
    Jan 5, 2015 at 12:57
  • No. They were connected to regular SATA HBA. My mistake was trying to use SmartArray controller as regular HBA when rebuilding server.
    – kenga13
    Jan 5, 2015 at 13:39
  • So you moved to a different server?
    – ewwhite
    Jan 5, 2015 at 13:41
  • 1
    Yes. And, I have root HDD of old server, zpool.cache and, probably hostid of old server from it's /etc directory. In hex, there first several megabytes zeroided. Next are going regular data structures, I'm not so proficient to tell whose one they are and how to recover. zdb tells cannot unpack label 0 and label 1, L2 L3 and their uberblocks are ok. zpool import tells pool is faulted "corrupted data" and pool member are UNAVAIL "corrupted data". import -f, -F -nF and vice versa do not help.
    – kenga13
    Jan 5, 2015 at 13:49

2 Answers 2


Yes, you've rendered your disks unusable...

Maybe there's some ZDB magic that can help, but creating RAID 0 HP Logical Drives is a pretty deliberate action. There would have been a clear warning that the data contained on the disks would be lost because of the Smart Array metadata.

In general, multiple RAID 0 Logical Drives for ZFS is a bad idea behind a hardware RAID controller. But this was a bad mistake.


I recommend taking this question to the ZFS-discuss mailing list or IRC channel.

  • They're not owerwroten. That's clearly visible in hex dump. Only first severl Mbs (2-3-4 - who can tell clearly) Where should that be magic be hunted for? I think, the main Q is how to replicate L2/L3 to L0/L1 (need L0.position L1.position L2.position L3.position calculated). Second - if zpool create on raw disk builds some partition table - rebuild it. May be - change hostid to the one of old server. Third - will be determined.
    – kenga13
    Jan 5, 2015 at 13:59
  • What operating system are you using?
    – ewwhite
    Jan 5, 2015 at 14:00
  • Ubuntu 14.04.1 64 bit both servers.
    – kenga13
    Jan 5, 2015 at 14:06
  • @kenga13 That's a start. You should take this to the ZFS mailing list/Google Group: groups.google.com/a/zfsonlinux.org/forum/#!forum/zfs-discuss
    – ewwhite
    Jan 5, 2015 at 16:52

Finally I've found that my ZFS pool is not corrupted. Old server imports/exports pool without any problem. The only difference was in ZFS kernel version and modules versions:

Old: kernel 3.13.0-39-generic, SPL: v0.6.3-1~trusty, ZFS: v0.6.3-3~trusty

New: kernel 3.13.0-43-generic, SPL: v0.6.3-3~trusty, ZFS: v0.6.3-5~trusty

And, zfs slices were made in single partitions, starting from block 2048. So the RAID controller doesn't affect L0,L1 labels at all, just zeroed partition tables.

The only thing I've done to import - restored partition tables (zpool import still shows pool as FAULTY) and make the /dev/disk/myzfs dir and made symlinks to zpool members partitions devices similarly like /dev/disk/by-id have (attempt to "zpool import -d /dev/disk/by-id" shows pool as FAULTY).

"zpool import -d /dev/disk/myzfs" shows my pool as ONLINE and "zpool import -d /dev/disk/myzfs nas" have succeeded.

Unfortunately, I was unable to replicate the kernel-SPL-ZFS kernel and modules combination like on old server - have not found how to get the old ppa:zfs-native/stable packages. So, I couldn't tell if this is the module revision changes or whatever it could be.

  • I'm glad you have your data back.
    – ewwhite
    Jan 6, 2015 at 20:06

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.