Transfer Truenas zpool to JBOD in order to repair sparsebundle?

Fnuxus

Cadet
Joined
Apr 18, 2020
Messages
7
Hi!

I use a TrueNAS server for Time Machine backups in a sparsebundle. The sparsebundle is corrupted and all efforts to repair it failed.

My last hope to repair the sparsebundle is Diskwarrior. The problem is: Diskwarrior does not work over the network, so I must try to move the four harddisks from my server to my Mac with ZFS. I have already installed the four harddisks in my JBOD case.

I expected to see the pool from my server on my Mac, but zpool list does not show me the pool, only another pool on a thumb drive.

diskutil list only shows me this:

/dev/disk4 (external, physical):

#: TYPE NAME SIZE IDENTIFIER

0: GUID_partition_scheme *4.0 TB disk4

1: FreeBSD Swap 2.1 GB disk4s1

2: 516E7CBA-6ECF-11D6-8FF8-00022D09712B 4.0 TB disk4s2



/dev/disk5 (external, physical):

#: TYPE NAME SIZE IDENTIFIER

0: GUID_partition_scheme *4.0 TB disk5

1: FreeBSD Swap 2.1 GB disk5s1

2: 516E7CBA-6ECF-11D6-8FF8-00022D09712B 4.0 TB disk5s2



/dev/disk6 (external, physical):

#: TYPE NAME SIZE IDENTIFIER

0: GUID_partition_scheme *4.0 TB disk6

1: FreeBSD Swap 2.1 GB disk6s1

2: 516E7CBA-6ECF-11D6-8FF8-00022D09712B 4.0 TB disk6s2



/dev/disk7 (external, physical):

#: TYPE NAME SIZE IDENTIFIER

0: GUID_partition_scheme *4.0 TB disk7

1: FreeBSD Swap 2.1 GB disk7s1

2: 516E7CBA-6ECF-11D6-8FF8-00022D09712B 4.0 TB disk7s2


I found some pages on the net that I should have exported the pool beforehand.

I assumed that TrueNAS automatically exports the pool when I shutdown the server.

Was my assumption wrong?
 

sretalla

Powered by Neutrality
Moderator
Joined
Jan 1, 2016
Messages
9,703
I assumed that TrueNAS automatically exports the pool when I shutdown the server.

Was my assumption wrong?
Yes, you were wrong... export is not done at shutdown (even though an import ... a special one for known pools ... is always done for known pools at boot).

You will still be able to import on another system with the import -f poolname syntax to force it... when bringing it back, you'll need to re-import it on your TrueNAS system (having been careful not to mess with the feature flags while it was connected elsewhere).
 

Fnuxus

Cadet
Joined
Apr 18, 2020
Messages
7
@sretalla Thank you for your answer!

The sparsebundle repair was successful. I was surprised to find a swapspace partition on each of the drives, they had never shown up in the user interface.

I put the drives back into my server and imported them using the import option in the storage section of the user interface.

Does TrueNAS now automatically regain use of the swapspace on the drives?
 

sretalla

Powered by Neutrality
Moderator
Joined
Jan 1, 2016
Messages
9,703
Does TrueNAS now automatically regain use of the swapspace on the drives?
It will find all partitions of that type on startup, so should be the case.
 

Fnuxus

Cadet
Joined
Apr 18, 2020
Messages
7
It will find all partitions of that type on startup, so should be the case.
Thank you!

I rebooted after putting back the harddrives and importing the pool from the web interface, but he system seems to be much slower than it used to be, about a tenth of the usual speed.

How can I verify, that the system does indeed make use of the swapspace on the harddisks?
 

sretalla

Powered by Neutrality
Moderator
Joined
Jan 1, 2016
Messages
9,703
How can I verify, that the system does indeed make use of the swapspace on the harddisks?
It should never be doing that if things are working properly.

go to the shell and run htop

You can see the Swp (swap) right under Mem (memory/RAM) usage indicator at the top of the screen. It should be showing no use.
 

Arwen

MVP
Joined
May 17, 2014
Messages
3,611
Thank you!

I rebooted after putting back the harddrives and importing the pool from the web interface, but he system seems to be much slower than it used to be, about a tenth of the usual speed.

How can I verify, that the system does indeed make use of the swapspace on the harddisks?
If your TrueNAS server seems slow, it's possible it is running a ZFS scrub. Check with zpool status or through the GUI, (I don't remember where on the GUI).
 

Fnuxus

Cadet
Joined
Apr 18, 2020
Messages
7
It should never be doing that if things are working properly.

go to the shell and run htop

You can see the Swp (swap) right under Mem (memory/RAM) usage indicator at the top of the screen. It should be showing no use.

Thank you for your help! – It looks like this:

htop.png


Swapspace is obviously being used, but how can I tell if it is on the boot usb-stick or the harddisks?
 

anodos

Sambassador
iXsystems
Joined
Mar 6, 2014
Messages
9,554
What version of TrueNAS is this? What is output of testparm -s? There is a time-machine related SMB share preset configuration that automatically takes snapshots of your sparsebundle after successful backup (or at least disconnect -- heuristics will be better in 22.02.0 and TN 13).

If we've been taking automatic backups, then you might be able to copy out of that.
 

Fnuxus

Cadet
Joined
Apr 18, 2020
Messages
7
Thank you, great idea, I wasn’t aware of that.

TrueNAS-12.0-U8, but the Time Machine directory is shared via AFP, SMB is currently not in use, apparently.
 

anodos

Sambassador
iXsystems
Joined
Mar 6, 2014
Messages
9,554
Thank you, great idea, I wasn’t aware of that.

TrueNAS-12.0-U8, but the Time Machine directory is shared via AFP, SMB is currently not in use, apparently.
You may want to check for zfs snapshots of the dataset where it is stored (there is a hidden directory through which you can access snapshot data and make copies of old versions of sparsebundles -- if you had a snapshot task configured).
 
Top