Jump to content

My FreeNAS machine decided it wasn't going to boot anymore (cheap USB drive, my fault), so I reinstalled FreeNAS 11.1 onto a spare 320GB SATA mechanical drive. It works fine, and it boots a lot faster now, but I need to access my old data. Before I reinstalled the OS, I had 2x 500GB WD drives, and they were somehow setup with Windows shares (1 share for 1 drive). I don't know how to properly connect the drives to FreeNAS so I can create new shares and get my data. Anyone know how? (I have a spare 500GB Seagate HDD and a 1TB WD Blue I can add if needed)

Link to comment
https://linustechtips.com/topic/935564-disk-problem-with-freenas/
Share on other sites

Link to post
Share on other sites

While I don't know how to fix your current issue, in the future during the FreeNAS install you can insert 2 USB devices and install FreeNAS on both, the USB drives will function in RAID 1 to prevent this issue if a single device fails.

 

If people are unable to help you here you can ask on the FreeNAS forums, they are extremely helpful

Link to post
Share on other sites

1 hour ago, Snipergod87 said:

While I don't know how to fix your current issue, in the future during the FreeNAS install you can insert 2 USB devices and install FreeNAS on both, the USB drives will function in RAID 1 to prevent this issue if a single device fails.

 

If people are unable to help you here you can ask on the FreeNAS forums, they are extremely helpful

Yeah, I don't depend on my NAS to a point that I need any sort of redundancy (although I may look into it, it does sound like a good option), but my main bottleneck is USB 2.0 and flash drives. Booting FreeNAS on this system takes forever with a flash drive, but it's only a couple minutes with the SATA hard drive I am using now. Do you think it may have something to do with the fact that I moved the disks from a FreeNAS 9.x install to a FreeNAS 8.x install before now moving them to FreeNAS 11.1?

Link to post
Share on other sites

1 hour ago, Lenovo1984 said:

Yeah, I don't depend on my NAS to a point that I need any sort of redundancy (although I may look into it, it does sound like a good option), but my main bottleneck is USB 2.0 and flash drives. Booting FreeNAS on this system takes forever with a flash drive, but it's only a couple minutes with the SATA hard drive I am using now. Do you think it may have something to do with the fact that I moved the disks from a FreeNAS 9.x install to a FreeNAS 8.x install before now moving them to FreeNAS 11.1?

You just need to import the existing disks:

https://doc.freenas.org/9.3/freenas_storage.html#import-disk

https://doc.freenas.org/9.3/freenas_storage.html#import-volume

 

Take a look at these links, and try that.

 

You will likely need to recreate the Share itself, but you just create a new Samba/SMB share, and point to the existing data.

 

I'd recommend backing up the FreeNAS config, so that in the future, you can just install FreeNAS, then import the config, and all your settings should be restored:

https://www.45drives.com/wiki/index.php?title=How_to_back_up_configurations_in_FreeNAS_in_the_event_of_boot_failure

For Sale: Meraki Bundle

 

iPhone Xr 128 GB Product Red - HP Spectre x360 13" (i5 - 8 GB RAM - 256 GB SSD) - HP ZBook 15v G5 15" (i7-8850H - 16 GB RAM - 512 GB SSD - NVIDIA Quadro P600)

 

Link to post
Share on other sites

25 minutes ago, dalekphalm said:

You just need to import the existing disks:

https://doc.freenas.org/9.3/freenas_storage.html#import-disk

https://doc.freenas.org/9.3/freenas_storage.html#import-volume

 

Take a look at these links, and try that.

 

You will likely need to recreate the Share itself, but you just create a new Samba/SMB share, and point to the existing data.

 

I'd recommend backing up the FreeNAS config, so that in the future, you can just install FreeNAS, then import the config, and all your settings should be restored:

https://www.45drives.com/wiki/index.php?title=How_to_back_up_configurations_in_FreeNAS_in_the_event_of_boot_failure

I took a look at that, and I've tried it. When I choose to import a volume, there is nothing listed. 

Link to post
Share on other sites

Just now, Lenovo1984 said:

I took a look at that, and I've tried it. When I choose to import a volume, there is nothing listed. 

Did you import the disks first?

For Sale: Meraki Bundle

 

iPhone Xr 128 GB Product Red - HP Spectre x360 13" (i5 - 8 GB RAM - 256 GB SSD) - HP ZBook 15v G5 15" (i7-8850H - 16 GB RAM - 512 GB SSD - NVIDIA Quadro P600)

 

Link to post
Share on other sites

33 minutes ago, Lenovo1984 said:

Oops, no, that's a facepalm moment. What do I choose as the destination?

Can you post a screenshot? I've never had to go through the process myself yet.

 

I assume you need to choose a "mount" location.

For Sale: Meraki Bundle

 

iPhone Xr 128 GB Product Red - HP Spectre x360 13" (i5 - 8 GB RAM - 256 GB SSD) - HP ZBook 15v G5 15" (i7-8850H - 16 GB RAM - 512 GB SSD - NVIDIA Quadro P600)

 

Link to post
Share on other sites

12 minutes ago, Lenovo1984 said:

mnt.PNG.d60be86e2f3867ce2e308606a021658c.PNG

I believe you can put it in the destination you have selected "/mnt". The zpool name should end up being "/mnt/zpoolname".

 

I can check my server when I get home - in about an hour.

For Sale: Meraki Bundle

 

iPhone Xr 128 GB Product Red - HP Spectre x360 13" (i5 - 8 GB RAM - 256 GB SSD) - HP ZBook 15v G5 15" (i7-8850H - 16 GB RAM - 512 GB SSD - NVIDIA Quadro P600)

 

Link to post
Share on other sites

7 minutes ago, dalekphalm said:

I believe you can put it in the destination you have selected "/mnt". The zpool name should end up being "/mnt/zpoolname".

 

I can check my server when I get home - in about an hour.

This is what I get when I try to import to the "/mnt" destination:

mnt2.PNG.4bde5ccd6cd1445cedc74e3609ff8b66.PNG

Link to post
Share on other sites

10 minutes ago, Lenovo1984 said:

This is what I get when I try to import to the "/mnt" destination:

mnt2.PNG.4bde5ccd6cd1445cedc74e3609ff8b66.PNG

Hmm. Well, I'll take a look at what mine looks like when I get home, and see if I can help.

 

In the mean time, perhaps someone else can be of more assistance.

For Sale: Meraki Bundle

 

iPhone Xr 128 GB Product Red - HP Spectre x360 13" (i5 - 8 GB RAM - 256 GB SSD) - HP ZBook 15v G5 15" (i7-8850H - 16 GB RAM - 512 GB SSD - NVIDIA Quadro P600)

 

Link to post
Share on other sites

I don't use FreeNAS so I don't know about restoring it's config but importing a ZFS pool can be done by doing

 

zpool import

 

https://www.freebsd.org/doc/handbook/zfs-zpool.html

 

(You may have to haggle with it a little since it wasn't exported in most cases I've found this just works though)

 

In the above screenshots it looks like your importing UFS disks, not sure why you'd be using UFS but thats ok in some circumstances. Also keeping OS on USB is fine but you will want to backup that config.

 

Again I don't use FreeNAS but that might be useful to you if you needed to do recovery.

"Only proprietary software vendors want proprietary software." - Dexter's Law

Link to post
Share on other sites

Here's a question I didn't see posted. Did you encrypt the disks and if you did do you have the keys? If you didn't encrypt them then ignore my question.

 

/mnt/ is the correct directory. I myself have yet to import a disk or array so I'm unsure as to how to add it back. I wonder if uploading the freeNAS config file would have helped after reinserting the drives. Perhaps it would have remounted them for you.

Link to post
Share on other sites

2 hours ago, Windows7ge said:

Here's a question I didn't see posted. Did you encrypt the disks and if you did do you have the keys? If you didn't encrypt them then ignore my question.

 

/mnt/ is the correct directory. I myself have yet to import a disk or array so I'm unsure as to how to add it back. I wonder if uploading the freeNAS config file would have helped after reinserting the drives. Perhaps it would have remounted them for you.

I didn't encrypt any of the disks in the system. I've never messed around with that sort of thing. Unfortunately for me, I didn't have any backup of the old config file. I'll try to get the old installation to boot (I do still have it's USB flash drive). 

Link to post
Share on other sites

56 minutes ago, Lenovo1984 said:

I didn't encrypt any of the disks in the system. I've never messed around with that sort of thing. Unfortunately for me, I didn't have any backup of the old config file. I'll try to get the old installation to boot (I do still have it's USB flash drive). 

Is the USB readable if you pop it into a different computer and boot into a different OS, like Linux?

 

I took a look at my own setup, and I couldn't find anything that would be useful.

For Sale: Meraki Bundle

 

iPhone Xr 128 GB Product Red - HP Spectre x360 13" (i5 - 8 GB RAM - 256 GB SSD) - HP ZBook 15v G5 15" (i7-8850H - 16 GB RAM - 512 GB SSD - NVIDIA Quadro P600)

 

Link to post
Share on other sites

3 hours ago, Lenovo1984 said:

I didn't encrypt any of the disks in the system. I've never messed around with that sort of thing. Unfortunately for me, I didn't have any backup of the old config file. I'll try to get the old installation to boot (I do still have it's USB flash drive). 

OK, I got home from work and found an absolute trash old 80GB WD drive. To import an old drive go to Storage > Import Volume > Step 1 of 2: Encrypted ZFS volume? (in your case NO) > Step 2 of 2 (select the name of the volume to recover) > OK

 

It should pop up in the list again. Then you can reassign your NFS/SMB/iSCSI/whatever network share.

 

Now if this was a whole raidz/stripe/mirror array...I'm not sure if it wold work the same way.

Link to post
Share on other sites

7 hours ago, Windows7ge said:

OK, I got home from work and found an absolute trash old 80GB WD drive. To import an old drive go to Storage > Import Volume > Step 1 of 2: Encrypted ZFS volume? (in your case NO) > Step 2 of 2 (select the name of the volume to recover) > OK

 

It should pop up in the list again. Then you can reassign your NFS/SMB/iSCSI/whatever network share.

 

Now if this was a whole raidz/stripe/mirror array...I'm not sure if it wold work the same way.

Unfortunately it's not working like that for me. I can choose Import Volume, but there's nothing listed. I don't know how to get around that. 

 

11 hours ago, dalekphalm said:

Is the USB readable if you pop it into a different computer and boot into a different OS, like Linux?

 

I took a look at my own setup, and I couldn't find anything that would be useful.

Not sure, haven't gotten to that yet. 

Link to post
Share on other sites

3 hours ago, Lenovo1984 said:

Unfortunately it's not working like that for me. I can choose Import Volume, but there's nothing listed. I don't know how to get around that. 

Hmn...my test was by properly dismounting the drive then adding it back. In your case yours was forcefully ejected as the boot drive failed. It's possible this action corrupted the drive in some way.

 

OK, I just read the FreeNAS Guide (sometimes you're forced to RTFM) and Import Disk isn't the way to do it:

 

"The Volume → Import Disk screen, shown in Figure 8.1.6, is used to import a single disk that has been formatted with the UFS, NTFS, MSDOS, or EXT2 filesystem. The import is meant to be a temporary measure to copy the data from a disk to an existing ZFS dataset." - FreeNAS Guide, 8.1.5. Import Disk

 

So Import Volume is how you re-add a disk or array to the server. Why it's not showing up I'm not sure. Did you try restarting the server with the drive attached?

Link to post
Share on other sites

1 hour ago, Windows7ge said:

Hmn...my test was by properly dismounting the drive then adding it back. In your case yours was forcefully ejected as the boot drive failed. It's possible this action corrupted the drive in some way.

 

OK, I just read the FreeNAS Guide (sometimes you're forced to RTFM) and Import Disk isn't the way to do it:

 

"The Volume → Import Disk screen, shown in Figure 8.1.6, is used to import a single disk that has been formatted with the UFS, NTFS, MSDOS, or EXT2 filesystem. The import is meant to be a temporary measure to copy the data from a disk to an existing ZFS dataset." - FreeNAS Guide, 8.1.5. Import Disk

 

So Import Volume is how you re-add a disk or array to the server. Why it's not showing up I'm not sure. Did you try restarting the server with the drive attached?

I had the drive in there before I booted it up the first time. The disk is connected to a PCI SATA RAID card (2x SATA 1 ports) and has worked with that card for a long time now. 

Link to post
Share on other sites

3 minutes ago, Lenovo1984 said:

I had the drive in there before I booted it up the first time. The disk is connected to a PCI SATA RAID card (2x SATA 1 ports) and has worked with that card for a long time now. 

Did you setup RAID on the RAID card or has it been running in JBOD mode?

Link to post
Share on other sites

Did you actually try the command I listed?

 

Import all pools found

zpool import -a

 

to see the existing pools

zpool status

 

It's safe to do and if it mounts you can just export it and mount it in the web ui after a

zpool export

 

Look at the man page for more examples.

 

There is nothing you can do to your FreeNAS config that could prevent you from recovering a ZFS volume. So long as the pool is (even partially) intact and the system can read it, it will be recoverable. This is why we use ZFS as opposed to other solutions that DO need a config. There is no fstab and no raidtab etc.

 

Edit: You don't even need FreeNAS to do this, FreeBSD, Linux or even Mac OS X can read ZFS (though they may import readonly if the feature flags are incompatible)

"Only proprietary software vendors want proprietary software." - Dexter's Law

Link to post
Share on other sites

@Lenovo1984 Might want to export / backup your FreeNAS this go-round :-) - also possibly duplicate your installation to another flash drive via DD or something else for future emergencies.

 

Also that's a bit of a heart-attack moment if it didn't just detect and prompt you to import, possibly a compatibility issue between FreeNAS 8 and 11, quite a few BSD versions apart and I'm sure the ZFS pool versions are far apart. If you're going to continue using FreeNAS 8 - keep an ISO of that installer handy.

Link to post
Share on other sites

4 hours ago, Mikensan said:

@Lenovo1984 Might want to export / backup your FreeNAS this go-round :-) - also possibly duplicate your installation to another flash drive via DD or something else for future emergencies.

 

Also that's a bit of a heart-attack moment if it didn't just detect and prompt you to import, possibly a compatibility issue between FreeNAS 8 and 11, quite a few BSD versions apart and I'm sure the ZFS pool versions are far apart. If you're going to continue using FreeNAS 8 - keep an ISO of that installer handy.

An older pool wouldn't be a problem for it. You can even go back and read/write/update OpenSolaris / Solaris 10 volumes made 10 years ago. It's the newer volumes that have problems because for instance.. newer compression algorithms etc. For the most part ZFS is portable though.

 

Yes, you do want to backup the server. but that shouldn't ever really stop you from restoring a pool.

 

The very first thing OpenZFS did after the fork is create the feature flag options that attempt to solve this so good on them being ahead of the game.

"Only proprietary software vendors want proprietary software." - Dexter's Law

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×