Remounting ZFS RAID-1 2 x 1TB USB Drive Array

Status
Not open for further replies.

strawdog74

Dabbler
Joined
May 23, 2012
Messages
42
Howdy folks,

I had 2 x 1TB USB drives mounted on FreeNAS 8.2 as RAID-1 ZFS striped array, buy stupidly unplugged them forgetting which one was plugged where. Now I have the following error in GUI :-

bkup /mnt/bkup None (Error) Error getting available space Error getting total space UNAVAIL

Is there anyway for me to force remount (or import) these whilst retaining the data on them? Ideally I don't want to start the backup again from scratch.

TIA
 

strawdog74

Dabbler
Joined
May 23, 2012
Messages
42
I have managed to get the ZFS pool ONLINE now, by doing the following :-

zpool clear bkup ---> This cleared the errors associated with the mount
zpool export bkup ---> This removes the pool from memory
zpool import bkup bkup ---> This re-imports the pool to the original mount point

Now GUI shows the pool as follows (I really thought I'd fixed it when I saw this!) :-

hdd1 /mnt/hdd1 1.9 TiB (51%) 1.7 TiB 3.6 TiB HEALTHY
bkup /mnt/bkup 2.5 KiB (8%) 755.5 KiB 823.5 KiB HEALTHY


BUT.....The trouble is now that I have some corrupted data on one of the drives :-

[root@freenas] /mnt# zpool status -v
pool: bkup
state: ONLINE
status: One or more devices has experienced an error resulting in data
corruption. Applications may be affected.
action: Restore the file in question if possible. Otherwise restore the
entire pool from backup.
see: http://www.sun.com/msg/ZFS-8000-8A
scrub: scrub in progress for 0h36m, 6.54% done, 8h43m to go
config:

NAME STATE READ WRITE CKSUM
bkup ONLINE 0 0 0
gptid/587327c2-f28c-11e1-a744-441ea13ee656 ONLINE 0 0 0
gptid/5bb7570b-f28c-11e1-a744-441ea13ee656 ONLINE 0 0 0

errors: Permanent errors have been detected in the following files:

<metadata>:<0x0>
<metadata>:<0x14>
<metadata>:<0x15>
<metadata>:<0x16>


So I have issued the following Scrub command in a vain attempt to fix the file-system errors :-

zpool scrub bkup

It is currently 6% of it's way through, but I don't hold out much hope. Looks like I'll have to start again with these drives :*-(

For anyone else reading this, here's a useful page I found that really helped :-

http://docs.oracle.com/cd/E19082-01/817-2271/gbbvf/index.html
 

cyberjock

Inactive Account
Joined
Mar 25, 2012
Messages
19,526
It is currently 6% of it's way through, but I don't hold out much hope. Looks like I'll have to start again with these drives :*-(

Your situation is precisely why anyone who posts in the forum that they want to use USB drives as a anything more than a short term plan to get data onto the server is flogged to hell and back. It is almost suicide for your data to even consider using USB drives except during situations where you're doing it as a one time thing.

There's just too much room for error using USB drives as anything except a "one time" solution. USB drivers can have bugs, the USB->SATA/IDE controller can have problems, you can accidentally unplug a cable, etc.

Honestly, I'm expecting you to kiss your data on those drives goodbye and take this as a lesson of what not to do with USB. Depending on how bad your corruption is you may suffer anything from a few corrupt files to complete failure of the zpool. Only time will tell.
 

strawdog74

Dabbler
Joined
May 23, 2012
Messages
42
Honestly, I'm expecting you to kiss your data on those drives goodbye and take this as a lesson of what not to do with USB. Depending on how bad your corruption is you may suffer anything from a few corrupt files to complete failure of the zpool. Only time will tell.

Well I got VERY lucky, I woke up this morning to find the scrub had succeeded, and my bkup pool has been restored error-free (no more metadata errors!). (Please note that it appears this is quite rare, so don't bank on it happening to you) :-

[root@freenas] /mnt/bkup# zpool status -v
pool: bkup
state: ONLINE
scrub: none requested
config:

NAME STATE READ WRITE CKSUM
bkup ONLINE 0 0 0
gptid/587327c2-f28c-11e1-a744-441ea13ee656 ONLINE 0 0 0
gptid/5bb7570b-f28c-11e1-a744-441ea13ee656 ONLINE 0 0 0

errors: No known data errors


Also, after doing the following, I fixed the pool in the GUI too :-

- Detach Volume (in GUI) ---> This caused GUI to hang returned a "pool is busy" error, but the entry disappeared after refresh
- umount /bkup (in SSH) ---> Somewhere along the way, the drive had been mounted to the root (/bkup instead of /mnt/bkup)
- zpool export bkup (in SSH) ---> This removes the bkup entry from zpool list
- Auto-Import (in GUI) ---> This imports the ZFS pool (both USB drives) to the original mount-point and re-adds entry in GUI

Volume Path Used Available Size Status Available actions
hdd1 /mnt/hdd1 1.9 TiB (52%) 1.7 TiB 3.6 TiB HEALTHY
bkup /mnt/bkup 1.2 TiB (67%) 595.0 GiB 1.8 TiB HEALTHY


I think part of the problem was that unplugging the USB drives somehow "pushed" the mount point onto the next available USB device, which just happened to be a partition on the 2GB USB thumb-drive containing FreeNAS. This explains why my second post shows the bkup pool as Healthly with only 823.5 KiB of space, and why it appeared to move to the root directory (or that could have been the "zpool import bkup bkup" command).

So in summary, noobs is right and I totally agree with his rhetoric about using USB drives - I have learned my lesson, and (when finances allow) will move to a more robust backup solution now. But hopefully, my posts will help someone with a similar problem, even when performing a one-time transfer. I have also fixed the GUI by detaching the pool, and auto-importing after the errors had been cleared.

For those thinking of using USB drives permanently with FreeNAS.....don't. :o
 
Status
Not open for further replies.
Top