• Some users have recently had their accounts hijacked. It seems that the now defunct EVGA forums might have compromised your password there and seems many are using the same PW here. We would suggest you UPDATE YOUR PASSWORD and TURN ON 2FA for your account here to further secure it. None of the compromised accounts had 2FA turned on.
    Once you have enabled 2FA, your account will be updated soon to show a badge, letting other members know that you use 2FA to protect your account. This should be beneficial for everyone that uses FSFT.

Can't import ZFS pool

avattz

n00b
Joined
Jun 25, 2012
Messages
26
Hello guys,

I finished up building my home server and I was playing around in FreeBSD via SSH. I created a zpool consisting of 8 3TB WD Green (WD30EZRX) drives, I set them up as 4 mirrored vdevs. Everything was fine and dandy until I wanted to change the name of the pool, I exported the pool and when I tried importing it said that all disks were corrupted and unavailable. Not sure what happened but trying to force import doesn't work.

There is no data on this system as its a fresh build, FreeBSD is hosted on a 60GB SSD on an Apricorn Velocity Solo. On a side note I would also like some help in understanding raidz vs mirror, since at first I thought in raidz you can lose data if a hard drive fails but reading more about it, I'm no longer sure (more space is always welcomed as I only get about 10TB usable storage with mirrors).

Thanks!
 
Yes, raidz has redundancy. raidz is similar to raid5. raidz2 is similar to raid6. raidz3 is 3 disks that can fail before you lose the pool.
 
I read a little more on how parity block works, and it was quite interesting, but I think I'll still go mirror as the server only has a dual core Celeron.

Anyone have any ideas on what is going on with the import/export problem?
 
Here is what I get with zpool import:

Code:
Flac-Frigate# camcontrol devlist
<WDC WD30EZRX-00MMMB0 80.00A80>    at scbus1 target 0 lun 0 (ada0,pass0)
<WDC WD30EZRX-00MMMB0 80.00A80>    at scbus2 target 1 lun 0 (ada1,pass1)
<OCZ-AGILITY3 2.22>                at scbus3 target 0 lun 0 (ada2,pass2)
<WDC WD30EZRX-00MMMB0 80.00A80>    at scbus5 target 0 lun 0 (ada3,pass3)
<WDC WD30EZRX-00MMMB0 80.00A80>    at scbus6 target 0 lun 0 (ada4,pass4)
<WDC WD30EZRX-00MMMB0 80.00A80>    at scbus7 target 0 lun 0 (ada5,pass5)
<WDC WD30EZRX-00MMMB0 80.00A80>    at scbus8 target 0 lun 0 (ada6,pass6)
<WDC WD30EZRX-00MMMB0 80.00A80>    at scbus9 target 0 lun 0 (ada7,pass7)
<WDC WD30EZRX-00MMMB0 80.00A80>    at scbus10 target 0 lun 0 (ada8,pass8)
Flac-Frigate# zpool import tank
cannot import 'tank': one or more devices is currently unavailable
Flac-Frigate# zpool import
  pool: tank
    id: 6079871540185148080
 state: FAULTED
status: One or more devices contains corrupted data.
action: The pool cannot be imported due to damaged devices or data.
   see: http://www.sun.com/msg/ZFS-8000-5E
config:

	tank                      FAULTED  corrupted data
	  mirror-0                ONLINE
	    5921980069522109251   UNAVAIL  corrupted data
	    12356177934128887992  UNAVAIL  corrupted data
	  mirror-1                ONLINE
	    18356362040955685513  UNAVAIL  corrupted data
	    5136230817573534250   UNAVAIL  corrupted data
	  mirror-2                ONLINE
	    14666804217518755158  UNAVAIL  corrupted data
	    8453004469172803376   UNAVAIL  corrupted data
	  mirror-3                ONLINE
	    30484839791503665     UNAVAIL  corrupted data
	    7298257926871081925   UNAVAIL  corrupted data

It was perfectly fine before using export.
 
I'm pretty sure its not a hardware failure (that would be absurd lol), so it's definitely something with settings or incompatibilities.
 
Not sure how to check disk labels, but using glabel I see that there are still partitions formatted NTFS (labeled "ntfs/New Volume") from when I checked the hard drives with my Windows machine. I thought zpool automatically formatted the hard drives, but it seems that I was incorrect. How do I prepare disks for ZFS usage or is there a good guide online?
 
Wow, this sounds totally f*cked. There is NO way any ZFS implementation should have left drives as NTFS! Are you sure you didn't somehow reformat them under windows before you discovered this?
 
how did you add them to the pool initially? by label? path? uuid?
If you did label or uuid I think you should be ok, if you did path then the ordering might have gotten messed up

Not sure how to check disk labels, but using glabel I see that there are still partitions formatted NTFS (labeled "ntfs/New Volume") from when I checked the hard drives with my Windows machine. I thought zpool automatically formatted the hard drives, but it seems that I was incorrect. How do I prepare disks for ZFS usage or is there a good guide online?

If you are using a ZVOL shared as an iSCSI endpoint with an NTFS volune on it then INSIDE of the ZFS is an entire legit NTFS partition, it will just have a higher offset than usual
 
I did format them on Windows so I could do a quick SMART test on them with the WD diagnostic tools. I never really "unformatted" them because I was expecting FreeBSD to do that for me lol. Here is the NTFS partitions I found on ada0 (all other drives except for the SSD have it too):

Code:
Geom name: ada0p1
Providers:
1. Name: gpt/Microsoft reserved partition
   Mediasize: 134217728 (128M)
   Sectorsize: 512
   Stripesize: 4096
   Stripeoffset: 1024
   Mode: r0w0e0
   secoffset: 0
   offset: 0
   seclength: 262144
   length: 134217728
   index: 0

Geom name: ada0p2
Providers:
1. Name: ntfs/New Volume
   Mediasize: 3000457232384 (2.7T)
   Sectorsize: 512
   Stripesize: 4096
   Stripeoffset: 0
   Mode: r0w0e0
   secoffset: 0
   offset: 0
   seclength: 5860268032
   length: 3000457232384
   index: 0
 
how did you add them to the pool initially? by label? path? uuid?
If you did label or uuid I think you should be ok, if you did path then the ordering might have gotten messed up



If you are using a ZVOL shared as an iSCSI endpoint with an NTFS volune on it then INSIDE of the ZFS is an entire legit NTFS partition, it will just have a higher offset than usual

Added them by path... aka mirror ada0 ada1 mirror etc.

Edit: That last part confused me, are you telling me that you can put another FS ontop of "ZFS"? I thought ZFS was a format all of its own. I started using ZFS last Saturday so some parts I still don't understand (as well as FreeBSD).
 
Last edited:
I did format them on Windows so I could do a quick SMART test on them with the WD diagnostic tools. I never really "unformatted" them because I was expecting FreeBSD to do that for me lol.

Seriously? WTF? How could you possibly think that was a good idea? While much of your data should be possible to recover, overwriting a partition table is already bad enough in this case. Also, Windows is going to write some files to your disk without asking. Even if you recreate the partition table for ZFS, you're most likely going to lose some data. Even just hooking up drives and booting them into Windows can destroy header information necessary for your RAID implementation. Like if you use Intel Matrix RAID, update your BIOS, forget to turn RAID mode back on, and boot back into Windows, it's possible to experience partial data loss. I did that once - had to use R-Studio to recover (most of) my stuff.

If you want to test your non-Windows disks, you need to do it with non-Windows tools. UBCD would have been a good place to start.
 
Just to let you know, I did note in the OP that there is NO data on any of these hard drives, this was recently built but I did a basic health test on the Windows machine to make sure the drives were good (since they were new, sometimes they can arrive DOA and I had 8 of them). If I had data on the drives, I definitely would not format them until I moved all the data. Anyway this is my first ZFS pool so I guess I just stumbled a bit getting started, that's all.

Any guides on ZFS would be nice, I refer to the FreeBSD documentation, but sometimes it can get too technical for me.
 
Sorry, my bad. Just make a new pool then.

You use RAID-10 (in ZFS terms, you'd add several mirrors of 2 drives each to a zpool, which is the equivalent of RAID-10) when you need your disks to be as fast as possible (particularly in random reads/writes) while caring a bit less about capacity. You use RAID-Z, RAID-Z2, and/or RAID-Z3 when you only need low to moderate speed and won't be doing too much seeking.

BTW, never put a database server on RAID-5/6/Z/Z2/Z3 (unless perhaps it sees very light traffic).
 
Last edited:
Sorry, my bad. Just make a new pool then.

You use RAID-10 (in ZFS terms, you'd add several mirrors of 2 drives each to a zpool, which is the equivalent of RAID-10) when you need your disks to be as fast as possible (particularly in random reads/writes) while caring a bit less about capacity. You use RAID-Z, RAID-Z2, and/or RAID-Z3 when you only need low to moderate speed and won't be doing too much seeking.

BTW, never put a database server on RAID-5/6/Z/Z2/Z3 (unless perhaps it sees very light traffic).

Primary purpose of the server is for personal use, pretty much a common place to store all my files for all my computers, and I'll be mirroring as it will also be my backup. I may plan to use CrashPlan for an offsite backup of the server that doesn't include videos, music, or other large files (because of transfer speed). The server will be hooked up to gigabit ethernet to a router with 300Mb/s Wireless-N capabilities.

The current problem it seems is that I need to format the hard drives as zpool created the pool without formatting (I'm guessing) which is why the import didn't work. Not sure how to go about doing that though.
 
Use a partition manager (not in Windows :p) to remove the existing partitions and then start anew, I guess.

A new disk without a partition is ok as well as any (non ZFS) partition - at least with Solaris.
If your disk is ZFS formatted, you cannot reuse until you delete/reformat this partition.

I do reformatting with Windows for easyness. (With the help of an sata -> usb adapter)
 
A new disk without a partition is ok as well as any (non ZFS) partition - at least with Solaris.
If your disk is ZFS formatted, you cannot reuse until you delete/reformat this partition.

I do reformatting with Windows for easyness. (With the help of an sata -> usb adapter)

How do you format a drive so it is ZFS formatted? I expected zpool to do it automatically but it didn't when I built the pool.
 
Seriously? WTF? How could you possibly think that was a good idea? While much of your data should be possible to recover, overwriting a partition table is already bad enough in this case. Also, Windows is going to write some files to your disk without asking. Even if you recreate the partition table for ZFS, you're most likely going to lose some data. Even just hooking up drives and booting them into Windows can destroy header information necessary for your RAID implementation. Like if you use Intel Matrix RAID, update your BIOS, forget to turn RAID mode back on, and boot back into Windows, it's possible to experience partial data loss. I did that once - had to use R-Studio to recover (most of) my stuff.

If you want to test your non-Windows disks, you need to do it with non-Windows tools. UBCD would have been a good place to start.
So what was the problem? You formatted your zpool with Windows, and then tried to import a formatted zpool into ZFS?
 
So what was the problem? You formatted your zpool with Windows, and then tried to import a formatted zpool into ZFS?

No. They were NTFS drives. Just stating that Windows can partially destroy data on drives just because it doesn't know what they are. And this was with Windows 7. IMO, Windows should not change a single f**king bit on a drive without being told to, but that is unfortunately not how it works. All I did was forget to use RAID mode. I did not attempt to use any drives or anything. Windows booted and Windows immediately 'found new hardware' and wrote to, for some reason, 2 out of my 4 drives, literally before I did ANYTHING in Windows myself. Thus enabling RAID mode did not work and I had to recover my data with R-Studio. FU Microsoft. You should fire the guy responsible for that behavior.
 
How do you format a drive so it is ZFS formatted? I expected zpool to do it automatically but it didn't when I built the pool.

I have not had a problems, using a non-ZFS disk for ZFS..
I can use a non ZFS formatted disk for ZFS without doing anything.
(without a partition or with another partition beside ZFS)

If a disk was part of a ZFS pool (example part of a pool that was not destroyed properly) i must reformat/ repartition with Windows, Solaris format ar another format utility or it is detected as "cannot use this disk because it is in use by a ZFS pool"

You do not need to "ZFS"-preformat prior use, It must just be "Non-ZFS" and "not partitioned/sliced or single partition"
 
Last edited:
Ah okay, so that was the problem, all the drives already had NTFS partitions when I built the pool.

I hit another roadblock, after formatting with dd count=100 I can't create a new pool with the drives:
Code:
Flac-Frigate# zpool create media mirror ada0 ada1 mirror ada5 ada7 mirror ada6 ada8 mirror ada4 ada3
invalid vdev specification
use '-f' to override the following errors:
/dev/ada0 is part of exported pool 'tank'
Flac-Frigate# zpool destroy tank
cannot open 'tank': no such pool
Flac-Frigate#

Is it recommended to override? What will happen to the old pool "tank" if I do? Basically I want to remove tank from the system, but I feel overriding will leave scraps of it behind.

Also these drives report logical=512 and physical=4096 sectors, so not sure if I should use gnop to fake 4k drives.
 
No. They were NTFS drives. Just stating that Windows can partially destroy data on drives just because it doesn't know what they are. And this was with Windows 7. IMO, Windows should not change a single f**king bit on a drive without being told to, but that is unfortunately not how it works. All I did was forget to use RAID mode. I did not attempt to use any drives or anything. Windows booted and Windows immediately 'found new hardware' and wrote to, for some reason, 2 out of my 4 drives, literally before I did ANYTHING in Windows myself. Thus enabling RAID mode did not work and I had to recover my data with R-Studio. FU Microsoft. You should fire the guy responsible for that behavior.

Ive plugged ZFS drives into Windows 7 with no issues. OSX has also corrupted a USB drive I mounted read only.... So dont go railing against Microsoft alone.
 
Back
Top