Page 1 of 1

Can't import pool after replacing bad OS drive

Posted: 03 Jan 2015 04:05
by NoXid
Overnight, the OS hard drive went bad, as I discovered when I tried to access the share in the morning and found that it wasn't there.

Well, fine I thought, Happy New Year :twisted:

In addition I thought, to heck with replacing the drive, I'll put the OS on a USB stick like any true NAS nerd would have done in the first place. So I whipped out my NAS4Free 9.1.0.1.724 CD and installed to a USB stick. All went well. Well, except I never knew (hey, I just learned) about the Config backup feature, so I don't have the old config file.

I panicked about that until I read more and learned that one should be able to import the pool without having the old config file. Except, well, that I can't :shock:

If I run "zpool import" at the CLI, it returns the name of my pool, the virtual device, and the 3 drives that are in it. It shows ONLINE for each item. Good so far ...

But if I run the command against the pool, with or without -f, or I run "Disks|ZFS|Configuration|Detected [Import on-disk ZFS config]" from the GUI the drives are active for about 10 seconds and then the system just sits there and never exits from the command.

FYI I used the same CD as I did for the original install, which had happily ran since May 2013. Nothing changed in the system other than booting from the USB stick instead of a hard drive.

***********

So from there, I have since picked up an SSD and installed it to the same controller where the OS hard drive had been and then did an install to it. I still have exactly the same problem as described above.

In the GUI, if I do "Disks|Management [Import disks]" the drives show up as ONLINE and as being ZFS.

Suggestions most appreciated. Thanks

(Oh, and I would have a spiffy avatar ... but you can probably guess well enough where all my spiffy files are.)

Re: Can't import pool after replacing bad OS drive

Posted: 03 Jan 2015 22:19
by Onichan
Did you have dedupe enabled? You are just doing

Code: Select all

zpool import -f poolname
right?

I have imported and exported pools many times and it has always worked within 15 seconds or so. Only thing I can think of is either you had dedupe enabled or something happened to it. If it has corruption it should have given you a warning when trying to import it so that doesn't seem like the problem.

Re: Can't import pool after replacing bad OS drive

Posted: 03 Jan 2015 23:41
by NoXid
Hi, thanks for the reply.

No, I have never had dedupe enabled (it always sounded like a problem waiting to happen, from what I have read).

Yes, I ran the command as you show. No warning. No nothing after hitting Enter on the command; it just spins the drives for 10 seconds, or so, then never does anything again until forced to reboot with a manual power-off/on.


I suppose it is possible that the OS drive failure caused NAS4Free to somehow damage the data drives ... but the failure seemed to happen overnight when the data was not in use. My windows systems couldn't see the share the next morning when I started them up, failed to connect to it.

Re: Can't import pool after replacing bad OS drive

Posted: 04 Jan 2015 00:38
by Onichan
Well you could try the capital F "zpool import -F poolname" which is supposed to import it if there are errors and just discard last few transactions, never used it before though.

Also you could try using a different OS to see if maybe a different ZFS implementation can somehow read the pool. Like boot off a ubuntu livecd and then install the zfs package. Then try the import with f and F and if it does import it I would first make a copy of the important data right then. Then export it properly and then boot NAS4Free and see if you can import it now that it's in a clean state.

Re: Can't import pool after replacing bad OS drive

Posted: 04 Jan 2015 00:53
by crowi
Also you could try using a different OS to see if maybe a different ZFS implementation can somehow read the pool.
I would not recommend this, this can screw up the whole pool. Stay with NAs4free or freeBSD.

Re: Can't import pool after replacing bad OS drive

Posted: 04 Jan 2015 02:53
by NoXid
Thanks.

I've tried all the reasonable variations on the "zpool import" command, including -F -n. They all seem to hang the system. Of course, none of the other zpool commands see the pool at all, so they are of no use.


I've found a number of similar cases online, but see no common element other than the import freeze. One was fixed by installing a newer version of the OS (it was a Solaris system). A number involved systems that had once had dedupe enabled. Some seem to have been instigated by a power failure (mine is on an UPS and shuts down after 5 minutes, so has never had a "hard" off--other than my current pulling of the cord to recover from these freezes). Most of these cases do not seem to have been resolved.


I, of course, do have backups. But the latest is from a few weeks ago, and leaves unrecoverable a good amount of work as well as some recent purchases of software and stock photos (all relevant emails, account info, receipts, etc were on the server). Yes, so in the future I will implement a daily backup of the email data, at least.

Between raidz, scrubs, email notifications, UPS, and occasional backups to external USB drives, I thought my data was reasonably safe. Back when I ran FreeNAS, a scrub showed that a drive was going bad, so I ordered a new drive, swapped them out, and no problems! It never occurred to me that a failure of the OS drive could leave my data unrecoverable ... Even if I can't solve this, it would be interesting to know how this happened.

Re: Can't import pool after replacing bad OS drive

Posted: 04 Jan 2015 09:29
by NoXid
Thanks for looking! :)

I've been researching and experimenting with this since the morning of the 1st, and no dice. So I've bitten the bullet and started over with a new zpool. NAS4Free sure is easy to install and setup :)

I realized that the most critical emails would still be available online so I could just download them again (since I have total control of my business email server), but my recent personal emails will be a loss. So not as bad as I had thought above. I'll still have to recreate some recent work, but I had fun doing it the first time, so ...

If you're reading this and have any insight into what might have happened, I'd still be curious to know about it.

Thanks!