Difference between revisions of "DegradedPool"

From OpenZFS on OS X
Jump to: navigation, search
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>
pool: tank
+
 
    id: 4167705491194610230
+
<syntaxhighlight lang="text">
  state: DEGRADED
+
  pool: tank
status: One or more devices contains corrupted data.
+
state: DEGRADED
action: The pool can be imported despite missing or damaged devicesThe
+
status: One or more devices could not be used because the label is missing or
         fault tolerance of the pool may be compromised if imported.
+
        invalidSufficient 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
config:
+
  scan: none requested
 +
config:
 
   
 
   
         tank                                     DEGRADED
+
        NAME                    STATE    READ WRITE CKSUM
           fs                                        DEGRADED
+
         tank                     DEGRADED     0    0    0
             disk1s2                            ONLINE
+
           raidz1-0              DEGRADED     0    0    0
             disk2s2                            ONLINE
+
             disk2                ONLINE       0    0    0
             2735026605872377559   FAULTED  corrupted data
+
             disk1                ONLINE       0    0    0
             disk4s2                            ONLINE
+
             2735026605872377559 FAULTED     0    0    0 was /dev/disk1
 +
             disk4                ONLINE       0    0    0
 +
 +
errors: No known data errors
 
</syntaxhighlight>
 
</syntaxhighlight>
  
Now, look into DiskUtility and find the disk number of the disk which is missing. (In our case disk3).
+
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 would like to delete the partition table of that disk and afterwards format the drive.
+
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.
 
+
If the disk is faulty, take a new disk and skip this step, going directly to the format.
+
  
 
<syntaxhighlight lang="bash">
 
<syntaxhighlight lang="bash">
Line 28: Line 32:
 
</syntaxhighlight>
 
</syntaxhighlight>
  
Now, format in DiskUtility as one partition, using GUID partition table, as hfs+ and look up the new disk partition id in the lower part of the DiskUtility-window. (in our case disk3s2)
+
Replace the missing device in the pool with this disk.
Replace the now missing drive in the pool with the newly formatted disk:
+
  
 
<syntaxhighlight lang="bash">
 
<syntaxhighlight lang="bash">
sudo zpool replace tank 2735026605872377559 /dev/disk3s2
+
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.