Difference between revisions of "DegradedPool"
From OpenZFS on OS X
Line 1: | Line 1: | ||
In case you have a degraded pool due to corrupted data on one drive, zpool status will show something like this: | In case you have a degraded pool due to corrupted data on one drive, zpool status will show something like this: | ||
− | <syntaxhighlight lang="bash">sudo zpool status | + | <syntaxhighlight lang="bash">$ sudo zpool status</syntaxhighlight> |
− | + | ||
− | + | <syntaxhighlight lang="text"> | |
− | + | pool: tank | |
− | + | state: DEGRADED | |
− | + | status: One or more devices could not be used because the label is missing or | |
− | + | invalid. Sufficient replicas exist for the pool to continue | |
+ | functioning in a degraded state. | ||
+ | action: Replace the device using 'zpool replace'. | ||
see: http://zfsonlinux.org/msg/ZFS-8000-4J | see: http://zfsonlinux.org/msg/ZFS-8000-4J | ||
− | + | scan: none requested | |
+ | config: | ||
− | tank | + | NAME STATE READ WRITE CKSUM |
− | + | tank DEGRADED 0 0 0 | |
− | + | raidz1-0 DEGRADED 0 0 0 | |
− | + | disk2 ONLINE 0 0 0 | |
− | 2735026605872377559 | + | disk1 ONLINE 0 0 0 |
− | + | 2735026605872377559 FAULTED 0 0 0 was /dev/disk1 | |
+ | disk4 ONLINE 0 0 0 | ||
+ | |||
+ | errors: No known data errors | ||
</syntaxhighlight> | </syntaxhighlight> | ||
− | Now, look into | + | Now, look into Disk Utility and find the disk number of the disk which is missing. (In our case disk3). |
− | If you are certain that the corrupted data was not due to a bad disk, (for example if just the labels were messed up), we | + | If you are certain that the corrupted data was not due to a bad disk, (for example if just the labels were messed up), we can reuse the same disk. First, delete the partition table of that disk. |
− | + | ||
− | + | ||
<syntaxhighlight lang="bash"> | <syntaxhighlight lang="bash"> | ||
Line 28: | Line 32: | ||
</syntaxhighlight> | </syntaxhighlight> | ||
− | + | Replace the missing device in the pool with this disk. | |
− | Replace the | + | |
<syntaxhighlight lang="bash"> | <syntaxhighlight lang="bash"> | ||
− | sudo zpool replace tank 2735026605872377559 /dev/ | + | sudo zpool replace -f tank 2735026605872377559 /dev/disk3 |
</syntaxhighlight> | </syntaxhighlight> | ||
Revision as of 19:43, 1 April 2014
In case you have a degraded pool due to corrupted data on one drive, zpool status will show something like this:
$ sudo zpool status
pool: tank state: DEGRADED status: One or more devices could not be used because the label is missing or invalid. Sufficient replicas exist for the pool to continue functioning in a degraded state. action: Replace the device using 'zpool replace'. see: http://zfsonlinux.org/msg/ZFS-8000-4J scan: none requested config: NAME STATE READ WRITE CKSUM tank DEGRADED 0 0 0 raidz1-0 DEGRADED 0 0 0 disk2 ONLINE 0 0 0 disk1 ONLINE 0 0 0 2735026605872377559 FAULTED 0 0 0 was /dev/disk1 disk4 ONLINE 0 0 0 errors: No known data errors
Now, look into Disk Utility and find the disk number of the disk which is missing. (In our case disk3). If you are certain that the corrupted data was not due to a bad disk, (for example if just the labels were messed up), we can reuse the same disk. First, delete the partition table of that disk.
sudo gpt destroy disk3
Replace the missing device in the pool with this disk.
sudo zpool replace -f tank 2735026605872377559 /dev/disk3
The number you see is the one which you saw above at the position of the faulted drive in sudo zpool status.
The system now starts resilvering the drive. This takes a long time. With sudo zpool status you can see the progress.