Score:0

Recovering data from zfs pool with deleted partition tables

jp flag

I was consolidating the hard drives from two nas's into one nas and when I put the hard drives from the second nas into the new enclosure, my raid card wiped the partition tables for all the connected drives. The 5 drives I was adding had previously been hardware raid-5 formatted with ext4 The 5 drives that were already in the nas had been zfs raidz. Both sets of drives had nearly identical data as I had mirrored them before doing this. The system is running Ubuntu Server. Is there any way to recover the data on either set of drives? I figure that recovering the partition table's on the zfs pool should be possible but I can't find a resource on how.

Pilot6 avatar
cn flag
How is this related to Ubuntu?
guiverc avatar
cn flag
I suspect the answers you seek relate mostly to the RAID card(s) in those devices; and not the Ubuntu OS that sent the data to those NAS devices.
jp flag
the data i think is most likely recoverable was a zfs pool in ubuntu. The raid card is out of the picture at this point. The ubuntu os is acting as a NAS.
Someone avatar
my flag
This question has nothing to do with Ubuntu , it is not an Ubuntu problem or something similar .
karel avatar
sa flag
This question is on topic because it's also about Ubuntu Server.
Score:1
jp flag

I ended up finding a reddit thread covering how to do this. It involved rebuilding the partition tables using sgdisk after figuring out where all the partitions should have gone. this was done by looking at the partition table for a zfs drive of the same model since it seems that zfs partitions drives in a very predictable manner.

In my case, the command was:

sgdisk -n1:2048:15628036095 -t1:BF01 -n9:15628036096:15628052479 -t9:BF07 <device>

which had to be run on every drive that had been part of the array after which zpool import <pool name> was able to work and restore the array.

credit to fields_g on reddit: https://www.reddit.com/r/zfs/comments/d6v47t/deleted_disk_partition_tables_of_a_zfs_pool/f17yt5s/

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.