How to recover data from a truenas data drive?

^ fresh install of truenas core

I have lost the old truenas installation, so i am left with a 1tb drive that i want to get the data out of. How do i do that? I have a fresh truenas installation in a spare drive.

There is no stated pool for the drive when in the drive menu in the TrueNAS interface. This is also proven by the return off "no pool available to import. " when running zpool import in the shell.

Same things happens when using ubuntu, they only detected the 16gb drive, not the 1tb. According to gparted, the drive is just one partition with zfs, “-” in used and used. Also, nothing returns after using sudo zfs get all.

The error message is something like this:
Error mounting /dev/sdb : Unknown filesystem type “zfs_member”

If I remember correctly this is my config:
I have 2 drives, a 2tb and 1tb. I made both of them separated, no mirror or raid. So two pools I think, one for the 2tb and one for the 1tb.

Specs:
Pentuim g630
8gb ddr3 1333mhz
Mobo: ga-b76m-d3v
Lan: Atheros GbE LAN chip
Ubuntu ver: 22.—
TrueNas ver: core-the newest one (just downloaded a few days ago)

I think I somehow messed up the config when setting it up, I think I would wipe the drive if nothing works, RIP data but can’t do anything about that. If possible i would like to put it in an external drive before wiping the drive and putting exfat file system.

Thank you

By “lost the old truenas installation” do you mean a boot pool failure?
If that is the case, all you have to do is get a new drive, install truenas, import your pools via the gui and re-create your config (shares users etc) and you should be able to access your data.

Edit: If you have a saved copy of your config, you can also upload the config backup and after a reboot your truenas should back as if nothing happened.

1 Like

Could you post the output of the following commands:

  • gpart list ada1
  • zdb -l /dev/ada1p0
  • zpool import -d /dev/ada1p0
1 Like

Either i wiped the drive or a lost the drive. I dont really remember where the physical drive is now.

Please run the commands by Bacon and post back the results using Preformatted Text (ctrl+e). Looks like (</>) on toolbar above where you type your replies.

I assume you mean the physical boot drive?

You can use any 8GB or larger drive, even a USB drive if recovery is the objective. Install a current version of TrueNAS core and then you should be able to import your pool.

Yes no idea where it went, i tried Importing the pool on a new installation but it did not detect the pool/give the drive option in “import pool” or “import drive”.

I will send the result of the code upstairs in a while, rn my server address is 0.0.0.0 so i need to fix that first. Thanks for your help

Sorry for using a photo and the late reply, cant seem to acsess the web gui.

you can’t access the webui because your nic didnt get a ip via dhcp, so your first step should be menu point 1 thats shown on the screen and configure a static ip for your nas. After that is done and the nas rebooted you should be able to access the webui.

2 Likes

Looks like there are no partitions on that 1TB drive. I would expect either one or two partitions on the disk if there was a pool created in truenas core.

Would be good to know what happened to that drive. When did you last successfully use the drive?

Do you know when you created the zfs pool and what version of truenas (or freenas) you used? Do you remember if you added swap space?

You did mention that according to gparted the drive is just one partition with zfs. Can you show the gparted output?

I think its around a year ago, i tried to solve this problem several times before but to no avail.

I dont remember the version that i installed before but i have the iso, sadly all the metadata was lost.
The name of the file is TrueNAS-13.0-Release.iso (1gb). I remember i added ssd as my swapspace.

The image attached is the gparted output(ubuntu). I am very gratefull for your help till now.

Ah, I see. gparted doesn’t actually list any partitions for that disk. It is odd to have a GPT partition table but no partitions.

It is possible to format an entire disk instead of individual partitions, but I don’t think truenas core would do that.

Because somehow gparted identifies the disk as having a zfs file system: Could you post the output of the following commands in linux/ubuntu (these commands won’t work in truenas core).

  • sudo blkid --probe /dev/sdb
  • sudo wipefs --no-act /dev/sdb

I suppose it is possible that the partition table got wiped somehow. If the pool really was created in truenas without swap space, I’d expect the zfs partition to either start at 1 MiB or 64KiB.

You can check both locations and see if they contain a zfs partition. Run the following commands (both don’t modify any data), check if the ascii output on the right-hand side contain the words “version”,“name”,“state”,“pool_guid”. Do not post the output in the forum as the might contain your data.
Commands should work on linux and freebsd(*) without issues:

  • sudo dd if=/dev/sdb bs=512 skip=2080 count=1 | hexdump -C
  • sudo dd if=/dev/sdb bs=512 skip=160 count=1 | hexdump -C

(*) freebsd (truenas core) device paths would be /dev/ada1 instead of /dev/sdb. Device paths may change on each reboot.

Sorry for the late reply,
I was quite busy for the last few days, now I have some free time.

For the first two commands this is the output:

/dev/sdb: VERSION="5000" TYPE="zfs_member" USAGE="filesystem" PTUUID="4d8ccf0a-e340-11ec-9a75-902b34191c60" PTTYPE="gpt"

and

DEVICE OFFSET       TYPE       UUID LABEL
sdb    0xe8e0d3f000 zfs_member      
sdb    0xe8e0d3e000 zfs_member      
sdb    0xe8e0d3d000 zfs_member      
sdb    0xe8e0d3c000 zfs_member      
sdb    0xe8e0d3b000 zfs_member      
sdb    0xe8e0d3a000 zfs_member      
sdb    0xe8e0d39000 zfs_member      
sdb    0xe8e0d38000 zfs_member      
sdb    0xe8e0d37000 zfs_member      
sdb    0xe8e0d36000 zfs_member      
sdb    0xe8e0d35000 zfs_member      
sdb    0xe8e0d34000 zfs_member      
sdb    0xe8e0d33000 zfs_member      
sdb    0xe8e0d7f000 zfs_member      
sdb    0xe8e0d7e000 zfs_member      
sdb    0xe8e0d7d000 zfs_member      
sdb    0xe8e0d7c000 zfs_member      
sdb    0xe8e0d7b000 zfs_member      
sdb    0xe8e0d7a000 zfs_member      
sdb    0xe8e0d79000 zfs_member      
sdb    0xe8e0d78000 zfs_member      
sdb    0xe8e0d77000 zfs_member      
sdb    0xe8e0d76000 zfs_member      
sdb    0xe8e0d75000 zfs_member      
sdb    0xe8e0d74000 zfs_member      
sdb    0xe8e0d73000 zfs_member      
sdb    0xe8e0d72000 zfs_member      
sdb    0xe8e0d71000 zfs_member      
sdb    0xe8e0d70000 zfs_member      
sdb    0x200        gpt             
sdb    0xe8e0db5e00 gpt             
sdb    0x1fe        PMBR 

For the last two commands, there is no alphabet listed after the command was completed, Only numbers and dots (“…”) . Is it still salvageable
? Do you recommend me to wipe the drive? Thanks again.

Sorry for disturbing, but mind giving me closure? Thanks

Sorry, I missed the post.

Difficult to provide support for these kinds of salvage operations in forum posts.

You are missing the partition table entries on the disk, but I can’t tell if the partition table is the only thing that’s wrong.

If you use the tool testdisk it can automatically find lost partitions. I does support zfs but I don’t quite know how well it performs, I’ve only used it for other file systems. But it can be worth a try. You can run a “Quick Search” in the “Analyze” section of the program.

If the data is important, you want to clone the drive as soon as possible.