# Problem replacing a drive...



## jyavenard (Aug 24, 2011)

Hi there.

Smartclt started to report a lot of errors so I replaced it.
I did the usual 
	
	



```
zpool offline pool ada7
halt
... replace the disk, power on
zpool replace pool ada7
```

Now something happened, kernel panic and I had to cold start the machine
rebooted (this is FreeBSD 8.2)

Since it's been showing:

```
pool: pool
 state: DEGRADED
status: One or more devices is currently being resilvered.  The pool will
	continue to function, possibly in a degraded state.
action: Wait for the resilver to complete.
 scrub: resilver in progress for 307445734561825851h8m, 18.33% done, 307445734561825819h33m to go
config:

	NAME            STATE     READ WRITE CKSUM
	pool            DEGRADED     0     0     0
	  raidz2        DEGRADED     0     0     0
	    ada3        ONLINE       0     0     0
	    ada4        ONLINE       0     0     0
	    ada5        ONLINE       0     0     0
	    ada6        ONLINE       0     0     0
	    replacing   UNAVAIL      0     0     0  insufficient replicas
	      ada7/old  OFFLINE      0     0     0
	      ada7      OFFLINE      0     0     0
	    ada8        ONLINE       0     0     0
	cache
	  ada0          ONLINE       0     0     0
	  ada1          ONLINE       0     0     0

errors: No known data errors
```

Trying to replace the disk:

```
# zpool replace pool ada7
invalid vdev specification
use '-f' to override the following errors:
/dev/ada7 is part of active pool 'pool'
[root@server4 /pool/home/jean-yves.avenard]# zpool replace -f pool ada7
invalid vdev specification
the following errors must be manually repaired:
/dev/ada7 is part of active pool 'pool'
```

I have tried zeroing the 1sta= and last MB of the disk (so *zdb -l /dev/ada7* would show nothing) , to no available...

I tried:

```
zpool export pool"]
zpool import pool
```

to no avail ...

Not sure what's going on... I'm not sure what it's resilvering right now considering both the old disk (removed) and the new one are considered offline.

Any help would be greatly appreciated.

Thank you in advance
Jean-Yves


----------



## phoenix (Aug 24, 2011)

Did you try to online the disk:  `# zpool online pool ada7`

If you have to the old disk handy, you can power off the system, swap in the old disk, then detach the missing "new" disk.  It should show up in the zpool output as a UUID, so you: `# zpool detach pool <longstringofnumbers>`

That should get the pool back to the old setup, prior to the replace, and you can try to do the replace operation again.


----------



## jyavenard (Aug 25, 2011)

Ok I tried that.

It still wouldn't let me perform
`# zpool replace pool ada7`
Would error about not being able to replace a replacing drive.


I ran then:
`# Zpool detach pool ada7`

This worked.

Followed by
`# zpool replace pool ada7`

And now:

```
[root@server4 /pool/home/jean-yves.avenard]# zpool status
  pool: pool
 state: DEGRADED
status: One or more devices is currently being resilvered.  The pool will
        continue to function, possibly in a degraded state.
action: Wait for the resilver to complete.
 scrub: resilver in progress for 0h4m, 0.04% done, 206h9m to go
config:

        NAME            STATE     READ WRITE CKSUM
        pool            DEGRADED     0     0     0
          raidz2        DEGRADED     0     0     0
            ada4        ONLINE       0     0     0
            ada5        ONLINE       0     0     0
            ada6        ONLINE       0     0     0
            ada8        ONLINE       0     0     0
            replacing   DEGRADED     0     0     0
              ada7/old  UNAVAIL      0     0     0  cannot open
              ada7      ONLINE       0     0     0  301M resilvered
            ada9        ONLINE       0     0     0
        cache
          ada0          ONLINE       0     0     0
          ada1          ONLINE       0     0     0

errors: No known data errors
```

Seems all good to go now...

Just going to take a while by the look of things, hopefully less than the 307445734561825819h33m it was originally quoting me. We may run out of atoms by then...


----------

