# Mounting FreeNAS drives.



## knightjp (May 29, 2022)

My FreeNAS server went down due to hardware failure. There was some data in it that I wanted and decided to take out the drives and put them into my Desktop. However it seems that my desktop is unable to see them; even though all the drives are formatted with zfs from the FreeNAS installation. 

I did the `geom disk list` and the system shows the disks are there.. but when I check Dolphin, I can't see them. 
I tried `zpool import` and that didn't work either. I keep looking for information online, but all I get is about formatting the disks using fdisk. 

Is there anything I should be doing? 

I was not too happy with the way that FreeNAS was handling my drives as it forced me to put them in some sort of RAID. I just wanted a normal home file server with 3 drives. I was thinking of removing FreeNAS anyways and using standard FreeBSD. 

Any advise in getting these drives mounted on my desktop without formatting them would be helpful.


----------



## PrometheousJames (May 29, 2022)

I would be careful how I implement these types of systems. For example, I use a hypervisor for my base system, then virtualize the different OS's I use. That way you can take snapshots of the VMs before updating, and revert back to a snap shot if need be. You can also attach separate Hard disks to whichever VM you wish for back-ups.

As for the RAID, most likely this is a ZRAID? I would assume so if you're using ZFS. ZFS is probably the best file system for storage there is, right now. It should automatically set up the ZRAID after minor configuration.

I apologize, as I do not know the exact fix for your situation. But if a redesign and implementation is possible, I would highly consider a different route. While using a hypervisor, you should be able to update the OS's in the guest VMs while not effecting the ZRAID. I hope this helps


----------



## Alain De Vos (May 29, 2022)

What's the output of

```
freebsd-version -kru
zfs --version
gpart show -p
zpool list -v
```


----------



## knightjp (May 29, 2022)

Alain De Vos said:


> What's the output of
> 
> ```
> freebsd-version -kru
> ...


`13.1-RELEASE
zfs-2.1.4-FreeBSD_g52bad4f23`
The output of 
	
	



```
gpart show -p
```



The output of 
	
	



```
zpool list -v
```


----------



## PrometheousJames (May 29, 2022)

knightjp said:


> `13.1-RELEASE
> zfs-2.1.4-FreeBSD_g52bad4f23`
> The output of
> 
> ...


Which device(s) are the old drives you're trying to detect?


----------



## sidetone (May 29, 2022)

Type `fstyp` for the freebsd-zfs partitions. What shows up?

Can you show the code using the code boxes, instead of screenshots? You can highlight the text from the terminal, then use the middle mouse button to paste it on here.


----------



## knightjp (May 29, 2022)

PrometheousJames said:


> Which device(s) are the old drives you're trying to detect?


Device ada2 and ada3


----------



## knightjp (May 29, 2022)

sidetone said:


> Type `fstyp` for the freebsd-zfs partitions. What shows up?


`usage: fstyp [-l] [-s] [-u] special`
That is what comes up. Sorry.. I'm a complete novice at this.

`=>       40  468862048    ada0  GPT  (224G)
         40     532480  ada0p1  efi  (260M)
     532520       1024  ada0p2  freebsd-boot  (512K)
     533544        984          - free -  (492K)
     534528    4194304  ada0p3  freebsd-swap  (2.0G)
    4728832  464132096  ada0p4  freebsd-zfs  (221G)
  468860928       1160          - free -  (580K)

=>       34  976773101    ada1  GPT  (466G)
         34          6          - free -  (3.0K)
         40     409600  ada1p1  efi  (200M)
     409640       2008          - free -  (1.0M)
     411648  976361472  ada1p2  ms-basic-data  (466G)
  976773120         15          - free -  (7.5K)

=>        40  7814037088    ada2  GPT  (3.6T)
          40          88          - free -  (44K)
         128     4194304  ada2p1  freebsd-swap  (2.0G)
     4194432  7809842696  ada2p2  freebsd-zfs  (3.6T)

=>        40  3907029088    ada3  GPT  (1.8T)
          40          88          - free -  (44K)
         128     4194304  ada3p1  freebsd-swap  (2.0G)
     4194432  3902834696  ada3p2  freebsd-zfs  (1.8T)

=>      63  15728577    da0  MBR  (7.5G)
        63      1985         - free -  (993K)
      2048  15726559  da0s1  fat32lba  (7.5G)
  15728607        33         - free -  (17K)`

the drives that I want to mount are ada2 and ada3

Output for zpool list -v

`NAME        SIZE  ALLOC   FREE  CKPOINT  EXPANDSZ   FRAG    CAP  DEDUP    HEALTH  ALTROOT
zroot       220G  13.0G   207G        -         -     0%     5%  1.00x    ONLINE  -
  ada0p4    220G  13.0G   207G        -         -     0%  5.91%      -    ONLINE`


----------



## grahamperrin@ (May 29, 2022)

knightjp said:


> Device ada2 and ada3



`fstyp /dev/ada2p2`

`fstyp /dev/ada3p2`


----------



## grahamperrin@ (May 29, 2022)

knightjp said:


> … `zpool import` and that didn't work …



I shouldn't jump to conclusions, but was there encryption? 

Found by Google (I haven't checked the page for sanity): FreeNAS, TrueNAS, GELI, and native ZFS encryption (2022-02-22)


----------



## hardworkingnewbie (May 29, 2022)

So your server broke. It happens. Is the HDD/SSD still working which contained the TrueNAS OS? 

If so, then the easiest solution is to retrieve the configuration of that drive and take it over to your desktop.


----------



## knightjp (May 29, 2022)

grahamperrin I don't recall doing anything with encryption on the FreeNAS or enabling it. 

hardworkingnewbie It was hardware failure. The power supply failed. It was just an old HP PC. However after installing and using FreeNAS, I think it was overkill for my needs. Normal FreeBSD with a series of shares would have been enough.


----------



## sidetone (May 29, 2022)

hardworkingnewbie said:


> If so, then the easiest solution is to retrieve the configuration of that drive and take it over to your desktop.


How are they going to get that information off of their drives like that, without accessing it first, if they don't have backup? With or without backup, they're still trying to access the drive, and would need to first, to get those configuration files as they are on the disk.


----------



## Beastie7 (May 29, 2022)

This type of task isn't supported here. I would instead fix the hardware issue on your FreeNAS box. Although FreeNAS uses FreeBSD; the entire base system is heavily modified; including zpool configurations.


----------



## sidetone (May 29, 2022)

Beastie7 said:


> This type of task isn't supported here. I would instead fix the hardware issue on your FreeNAS box. Although FreeNAS uses FreeBSD; the entire base system is heavily modified; including zpool configurations.


I thought they were using FreeBSD to access that harddisk with FreeNAS on it. A task on a FreeBSD machine. They're also considering switching to FreeBSD for the server.



knightjp said:


> My FreeNAS server went down due to hardware failure.


I also thought that FreeNAS had a name change to something else. It turns out, to TrueNAS.


----------



## Jose (May 29, 2022)

I've not had to deal with this particular problem, but I would look at the `-d` and `-F` options of the zpool-import(8) command.

```
-d    dir|device
             Uses device or searches for devices or files in dir. The
             -d option can be specified multiple times. This option
             is incompatible with the -c option.
-F         Recovery mode for a non-importable pool.  Attempt to re-
             turn the pool to an importable state by discarding the
             last few transactions.  Not all damaged pools can be re-
             covered by using this option. If successful, the data
             from the discarded transactions is irretrievably lost.
             This option is ignored if the pool is importable or al-
             ready imported.
```

Just in case you don't see it in the man page, the -F option *can cause data to be irretrievably los*t.


----------



## Phishfry (May 30, 2022)

sidetone said:


> I thought they were using FreeBSD to access that harddisk with FreeNAS on it. A task on a FreeBSD machine.


Yea but which ZFS? They usually lag so probably still on FreeBSD ZFS versus Open ZFS.









						ZFS Compatibility
					

The best free filesystem on Earth – ZFS – also often named OpenZFS recently – has also become very portable in recent years of its development. The OpenZFS Distributions page list…




					vermaden.wordpress.com


----------



## grahamperrin@ (May 30, 2022)

Jose said:


> … the `-d` and `-F` options …



Also options such as `-X` (extreme measures), with their suitably strong warnings.


----------



## hardworkingnewbie (May 30, 2022)

sidetone said:


> How are they going to get that information off of their drives like that, without accessing it first, if they don't have backup? With or without backup, they're still trying to access the drive, and would need to first, to get those configuration files as they are on the disk.


Most SOHO FreeNAS builds I do know have one small SSD for the OS and then the bunch of HDDs for the rest. So, where's the problem?

Also note: I didn't say that it is like that in his case, but if the OS is indeed on a separate HDD/SSD here you could try it that way.


----------

