# ZFS doesn't see a failed drive?



## mariourk (Nov 14, 2012)

So, I was playing with a ZFS array and janked out (disconnected the SATA and the power cable) a live SATA drive. Just to see what would happen. The server kept running fine, obviousy. But zpool didn't report anything wrong, dispite me having the unplugged drive in my hand.


```
#zpool status   
pool: Opslag
state: ONLINE
scan: none requested
config:
NAME        STATE     READ WRITE CKSUM
Opslag      ONLINE       0     0     0
  raidz1-0  ONLINE       0     0     0
    ada1    ONLINE       0     0     0
    ada2    ONLINE       0     0     0
    ada3    ONLINE       0     0     0
```

How is this possible? :q

Only after plugging in another drive, ZFS reported a problem.

For the record, I wanted to see if I could replace a drive without shutting down the server. Obviously that wouldn't work, because SATA doesn't support hotswap. But it's strange I got no errors when I disconnected a live SATA drive from a running server.


----------



## break19 (Nov 14, 2012)

That is likely because your computer didn't know the drive was disconnected.. ZFS would have put the system into a faulted state if you had attempted to write to the pool..


----------



## mariourk (Nov 14, 2012)

That makes sense. There was no reading or writing, or whatever going on on that zpool, at the time. If I'll try this again, I will edit a small textfile or something. See what happens


----------



## Sfynx (Nov 14, 2012)

A proper SATA AHCI controller has no problems with hotswap, when I yank a drive from our server the controller correctly reports that it lost a drive and ZFS responds accordingly (by marking the drive as REMOVED)


----------



## phoenix (Nov 15, 2012)

Sfynx said:
			
		

> A proper SATA AHCI controller has no problems with hotswap, when I yank a drive from our server the controller correctly reports that it lost a drive and ZFS responds accordingly (by marking the drive as REMOVED)



A *much* nicer process is to offline the drive first.  ZFS gets much less cranky when you do that.  So,

zpool offline <poolname> <diskname>
phyiscally remove the drive
insert new drive
configure new drive via gpart (label, partition, etc)
zpool replace <poolname> <diskname>


----------

