Test System - Drive Offlined and want to bring it back into the pool

Status
Not open for further replies.

Alan Smithee

Dabbler
Joined
Feb 24, 2015
Messages
13
Testing the RaidZ2 system (with no meaningful data on it) on FreeNAS 9.3. In the GUI I took a drive offline, wrote some data to the degraded array (still worked) and wanted to bring the offline drive back online. The GUI has a "replace" button, but when I select the offline drive and hit the replace button, I get

Code:
[MiddlewareError: Disk replacement failed: "invalid vdev specification, use '-f' to override the following errors:, /dev/gptid/dcd6788b-bd71-11e4-88bf-ac9e17e0a1f4 is part of active pool 'tank', "]


I tried to RTFM (and follow procedures for replacing a drive) but no matter what I do, the offline drive will not come back online. This scenario is just a simple case of offline one drive / see if raid still works / online one drive....but I'm stuck on the last step. I'd like the raidz2 to be non-degraded in the end.

Code:
[root@freenas] /mnt/tank/media2# zpool status
  pool: freenas-boot
state: ONLINE
  scan: scrub repaired 0 in 0h1m with 0 errors on Tue Feb 24 18:09:05 2015
config:

        NAME        STATE     READ WRITE CKSUM
        freenas-boot  ONLINE       0     0     0
          da0p2     ONLINE       0     0     0

errors: No known data errors

  pool: tank
state: DEGRADED
status: One or more devices could not be opened.  Sufficient replicas exist for
        the pool to continue functioning in a degraded state.
action: Attach the missing device and online it using 'zpool online'.
   see: http://illumos.org/msg/ZFS-8000-2Q
  scan: scrub repaired 0 in 3h11m with 0 errors on Wed Feb 25 23:08:05 2015
config:

        NAME                                            STATE     READ WRITE CKSUM
        tank                                            DEGRADED     0     0     0
          raidz2-0                                      DEGRADED     0     0     0
            gptid/359e0da7-bc44-11e4-9b5c-ac9e17e0a1f4  ONLINE       0     0     0
            6653922782831483518                         UNAVAIL      0     0     0  was /dev/gptid/35fbaef8-bc44-11e4-9b5c-ac9e17e0a1f4
            gptid/36580bea-bc44-11e4-9b5c-ac9e17e0a1f4  ONLINE       0     0     0
            gptid/36b8783a-bc44-11e4-9b5c-ac9e17e0a1f4  ONLINE       0     0     0

errors: No known data errors

[root@freenas] /mnt/tank/media2# zpool online tank gptid/35fbaef8-bc44-11e4-9b5c-ac9e17e0a1f4
warning: device 'gptid/35fbaef8-bc44-11e4-9b5c-ac9e17e0a1f4' onlined, but remains in faulted state
use 'zpool replace' to replace devices that are no longer present


I'm not sure what I need to do on the CLI to make the replace command happy.
 

cyberjock

Inactive Account
Joined
Mar 25, 2012
Messages
19,526
Yep. The drive still has a partition table on it, so FreeNAS won't reformat the drive.

You have two choices (three if you want to do some CLI stuff I don't recommend):

1. Wipe the drive you removed, then add it back to the pool. The error won't happen because the disk will be blank
2. Reboot the server. ZFS will recognize the currently missing drive and put it back in the pool.

The not recommended 3rd option: Do CLI stuff to online the disk (I don't recommend you go this route).
 

Alan Smithee

Dabbler
Joined
Feb 24, 2015
Messages
13
Yep. The drive still has a partition table on it, so FreeNAS won't reformat the drive.

You have two choices (three if you want to do some CLI stuff I don't recommend):

1. Wipe the drive you removed, then add it back to the pool. The error won't happen because the disk will be blank
2. Reboot the server. ZFS will recognize the currently missing drive and put it back in the pool.

The not recommended 3rd option: Do CLI stuff to online the disk (I don't recommend you go this route).

Thanks for the help.

I think i'd like to wipe the drive so I can simulate adding a "fresh" drive, rather than going the "recognized an already used drive" route I think would happen with a reboot.

Under Storage > Volumes > View Disks, I can see all of my drives, but I don't know which one to wipe (i.e. view disks page lists ada0, ada1, etc and serial numbers, but how do I know which one of those is the drive I offlined?)

I think the 3rd option is probably something like truncate or dd to strip the old data from the drive right? Probably similar to what wipe is doing....but I'd similarly need to know which device to address.
 
Last edited:

cyberjock

Inactive Account
Joined
Mar 25, 2012
Messages
19,526
You will have to pull the disk out of the system and wipe it elsewhere. The wipe buttons in the WebGUI won't even work if there is a partition on the disk. Again, that's to protect users from doing things that might result in data loss.

The 3rd option involves manipulating the zpool. That's why I don't recommend it.
 

Alan Smithee

Dabbler
Joined
Feb 24, 2015
Messages
13
You will have to pull the disk out of the system and wipe it elsewhere. The wipe buttons in the WebGUI won't even work if there is a partition on the disk. Again, that's to protect users from doing things that might result in data loss.

The 3rd option involves manipulating the zpool. That's why I don't recommend it.

Got it. Thanks.

I found this example : http://www.bsdnow.tv/tutorials/zfs

Looks like it does a truncate and then is able to do a replace.

One last question, is there a good primer on mapping a physical drive to a logical one? For example, I'd like to be able to go from drive serial number (perhaps using smart) to somewhere in /dev to however zfs is identifying the drive (by gptid or UUID, ada, or number). I feel like I don't understand those mappings.
 

cyberjock

Inactive Account
Joined
Mar 25, 2012
Messages
19,526
camcontrol devlist gives you a list of disk devices. Then do "smartctl -a /dev/XXX" to find the matching serial number.
 
Status
Not open for further replies.
Top