# zpool error after replacing a drive.



## msothard (Sep 30, 2012)

I'm very much a FreeBSD newbie, been learning a lot on these forums and finally decided I needed to post this:

After replacing a drive, I continually get this output, even after doing multiple scrubs (Which another is running right now.)


```
[root@MediaNAS] ~# zpool status -v
  pool: Media
 state: DEGRADED
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: resilver in progress for 0h15m, 1.09% done, 23h57m to go
config:

	NAME                      STATE     READ WRITE CKSUM
	Media                     DEGRADED     0     0     0
	  raidz1                  DEGRADED     0     0     0
	    ada0p2                ONLINE       0     0     0
	    ada1p2                ONLINE       0     0     0
	    ada10p2               ONLINE       0     0     0
	    ada11p2               ONLINE       0     0     0
	    ada2p2                ONLINE       0     0     0
	    ada3p2                ONLINE       0     0     0
	    ada4p2                ONLINE       0     0     0
	    replacing             DEGRADED     0     0     0
	      783181260560719434  UNAVAIL      0     0     0  was /dev/ada5p2/old
	      ada5p2              ONLINE       0     0     0  17.8G resilvered
	    ada6p2                ONLINE       0     0     0
	    ada7p2                ONLINE       0     0     0
	    ada8p2                ONLINE       0     0     0
	    ada9p2                ONLINE       0     0     0

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

        Media:<0x1d1ae>
        Media:<0x1d1b5>
        Media:<0x1d1b8>
        Media:<0x1d1bb>
        Media:<0x1d1c2>
        Media:<0x1d1c5>
        Media:<0x1d1e8>
```

I have not been able to get rid of "783181260560719434". 

Also, the permanent errors have existed for a long time. a  zpool clear will not get rid of them.


----------



## usdmatt (Sep 30, 2012)

This seems to be quite a common issue, not sure if it still happens with the latest FreeBSD releases.
It doesn't seem to remove the old disk after the rebuild.
Try the following


```
zpool detach Media {dev}
```

Where device is that long string of numbers.


----------



## phoenix (Oct 1, 2012)

The "replacing" device will not disappear until the resilver is finished.

The only way to remove "permanent errors" is to figure out which file(s) is corrupt and delete them from the pool (and any snapshots they exist in).


----------



## msothard (Oct 3, 2012)

Thanks guys! Got it all figured out.


----------

