SOLVED recover zvols from faulty pool

digity

Contributor
Joined
Apr 24, 2016
Messages
156
I have a faulty pool that I need to recover two zvols from. The problem is when this pool is connected, TrueNAS Core crashes at the import portion of boot up and then goes into a reboot loop. I tried a new/different TrueNAS Core installation, but when I try to import the pool within it's web GUI it crashes and also goes into a reboot loop. How do I recover, migrate or replicate the zvols from this faulty pool to another TrueNAS Core server?

P.S. - I was able to recover the regular datasets on this faulty pool using ZFS on Ubuntu (via simply copying the file structure), but not the zvols as they are not visible.
 

Patrick M. Hausen

Hall of Famer
Joined
Nov 25, 2013
Messages
7,776
Use the same Ubuntu. The zvols should be visible in zfs list and you can copy an entire zvol to a file by zfs send pool/name/of/zvol | gzip -c > /some/directory/with/empty/space/zvol.gz

You can later copy theses files over to a new system and create a zvol from them by zfs receive.

Assuming you still have sufficient redundancy so the data is actually intact.
 

digity

Contributor
Joined
Apr 24, 2016
Messages
156
Use the same Ubuntu. The zvols should be visible in zfs list and you can copy an entire zvol to a file by zfs send pool/name/of/zvol | gzip -c > /some/directory/with/empty/space/zvol.gz

You can later copy theses files over to a new system and create a zvol from them by zfs receive.

Assuming you still have sufficient redundancy so the data is actually intact.
Is it possible to simply replicate the zvol to a TrueNAS installation already up and running? I ask because I currently don't have enough space to hold the multiple copies needed to finally get the zvols to the new TrueNAS installation
 

Patrick M. Hausen

Hall of Famer
Joined
Nov 25, 2013
Messages
7,776
Sure. If both systems are able to communicate over the network. Logon as root to both.

On the destinaton:
Code:
nc -l 4444 | gzip -dc | zfs receive pool/path/to/some/zvol


On the source:
Code:
zfs send pool/path/to/some/zvol | gzip -c | nc -N ip.of.destination.system 4444


Good luck!
 

digity

Contributor
Joined
Apr 24, 2016
Messages
156
Sure. If both systems are able to communicate over the network. Logon as root to both.

On the destinaton:
Code:
nc -l 4444 | gzip -dc | zfs receive pool/path/to/some/zvol


On the source:
Code:
zfs send pool/path/to/some/zvol | gzip -c | nc -N ip.of.destination.system 4444


Good luck!

Ha, didn't even think about netcat. Smart!

I actually ended up using TrueNAS Scale beta and to my surprise it imported the faulty pool with no issues. I ran replication tasks for the zvols I needed to the new TN Core server and when complete, they mounted in my iSCSI projects just fine, no errors.

I'm still kind of in shock this worked so smoothly. Though now also a little worried that TNS didn't even complain about this faulty pool while TNC has a full on panic attack - makes me wonder TNS won't be as thorough or polished as TNC.

Anyway, thanks for the help!
 
Top