{"id":1216,"date":"2014-08-19T17:08:00","date_gmt":"2014-08-19T22:08:00","guid":{"rendered":"http:\/\/it.thelibrarie.com\/weblog\/?p=1216"},"modified":"2014-08-19T17:08:00","modified_gmt":"2014-08-19T22:08:00","slug":"zfs-zpool-replace-failed-drive","status":"publish","type":"post","link":"https:\/\/it.thelibrarie.com\/weblog\/2014\/08\/zfs-zpool-replace-failed-drive\/","title":{"rendered":"ZFS Zpool Replace Failed Drive"},"content":{"rendered":"<p>So I am using ZFS on my Nas4Free installation (v5000 zfs) and I had a failed drive.  Background: 20x 3TB SATA mirror and then striped in the same pool, 2x 3TB hotspares (not sure if these work &#8211; maybe more information later), and a raid card level ZIL of 120GB SSDs.<\/p>\n<p>One of the drives in the mirror failed out.  Had a technician replace the drive, but forgot to offline it before the drive was replaced.  Since this was my first time with a pure ZFS environment (usually I had the raid controller do the heavy lifting and ZFS was just sitting there), I detached the drive.  Caused all sorts of issues.<\/p>\n<p>so then I had:<\/p>\n<blockquote><p>#zpool status -v<br \/>\n        NAME        STATE     READ WRITE CKSUM<br \/>\n        zfs         ONLINE       0     0     0<br \/>\n          mirror-0  ONLINE       0     0     0<br \/>\n            da3     ONLINE       0     0     0<br \/>\n            da4     ONLINE       0     0     0<br \/>\n          mirror-1  ONLINE       0     0     0<br \/>\n            da5     ONLINE       0     0     0<br \/>\n            da6     ONLINE       0     0     0<br \/>\n          mirror-2  ONLINE       0     0     0<br \/>\n            da7     ONLINE       0     0     0<br \/>\n            da8     ONLINE       0     0     0<br \/>\n          mirror-3  ONLINE       0     0     0<br \/>\n            da9     ONLINE       0     0     0<br \/>\n            da10    ONLINE       0     0     0<br \/>\n          mirror-4  ONLINE       0     0     0<br \/>\n            da11    ONLINE       0     0     0<br \/>\n            da12    ONLINE       0     0     0<br \/>\n          da14      ONLINE       0     0     0<br \/>\n          mirror-6  ONLINE       0     0     0<br \/>\n            da15    ONLINE       0     0     0<br \/>\n            da16    ONLINE       0     0     0<br \/>\n          mirror-7  ONLINE       0     0     0<br \/>\n            da17    ONLINE       0     0     0<br \/>\n            da18    ONLINE       0     0     0<br \/>\n          mirror-8  ONLINE       0     0     0<br \/>\n            da19    ONLINE       0     0     0<br \/>\n            da20    ONLINE       0     0     0<br \/>\n        logs<br \/>\n          da1p1     ONLINE       0     0     0<br \/>\n        spares<br \/>\n          da21      AVAIL<br \/>\n          da22      AVAIL\n<\/p><\/blockquote>\n<p>We can see mirror-5 was just a single stripe disk.  Awesome.<\/p>\n<p>After adding in the drive and formatting via the GUI for ZFS, I then ran:<br \/>\n<code>zpool attach zfs \/dev\/da14 \/dev\/da13<\/code><br \/>\n<code>zpool attach YOURPOOLNAME \/dev\/YOURDEVICETHATSWORKING \/dev\/YOURNEWDEVICE<\/code><\/p>\n<blockquote><p> # zpool status<br \/>\n  pool: zfs<br \/>\n state: ONLINE<br \/>\nstatus: One or more devices is currently being resilvered.  The pool will<br \/>\n        continue to function, possibly in a degraded state.<br \/>\naction: Wait for the resilver to complete.<br \/>\n  scan: resilver in progress since Tue Aug 19 13:51:48 2014<br \/>\n        3.23G scanned out of 1.41T at 276M\/s, 1h29m to go<br \/>\n        322M resilvered, 0.22% done<\/p><\/blockquote>\n<p>It actually finished in 40 minutes with no errors.  Resilvering is a type of scrub, so a scrub cannot be running at the same time.<\/p>\n<p>Then, just to be sure, I ran the scrub to verify data integrity:<br \/>\n<code>zpool scrub zfs<\/code><br \/>\n<code>zpool scrub YOURPOOLNAME<\/code><\/p>\n<p>To Stop a scrub<br \/>\n<code>zpool scrub -s YOURPOOLNAME<\/code><\/p>\n<p>Verify status with (this checks all known data to be valid):<br \/>\n<code>zpool status -v<\/code><\/p>\n<blockquote><p># zpool status<br \/>\n  pool: zfs<br \/>\n state: ONLINE<br \/>\n  scan: scrub in progress since Tue Aug 19 17:06:45 2014<br \/>\n        22.8G scanned out of 1.41T at 614M\/s, 0h39m to go<br \/>\n        0 repaired, 1.57% done\n<\/p><\/blockquote>\n","protected":false},"excerpt":{"rendered":"<p>So I am using ZFS on my Nas4Free installation (v5000 zfs) and I had a failed drive. Background: 20x 3TB SATA mirror and then striped in the same pool, 2x 3TB hotspares (not sure if these work &#8211; maybe more information later), and a raid card level ZIL of 120GB SSDs. One of the drives &hellip; <a href=\"https:\/\/it.thelibrarie.com\/weblog\/2014\/08\/zfs-zpool-replace-failed-drive\/\" class=\"more-link\">Continue reading <span class=\"screen-reader-text\">ZFS Zpool Replace Failed Drive<\/span> <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[7],"tags":[],"class_list":["post-1216","post","type-post","status-publish","format-standard","hentry","category-linux"],"_links":{"self":[{"href":"https:\/\/it.thelibrarie.com\/weblog\/wp-json\/wp\/v2\/posts\/1216","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/it.thelibrarie.com\/weblog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/it.thelibrarie.com\/weblog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/it.thelibrarie.com\/weblog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/it.thelibrarie.com\/weblog\/wp-json\/wp\/v2\/comments?post=1216"}],"version-history":[{"count":1,"href":"https:\/\/it.thelibrarie.com\/weblog\/wp-json\/wp\/v2\/posts\/1216\/revisions"}],"predecessor-version":[{"id":1217,"href":"https:\/\/it.thelibrarie.com\/weblog\/wp-json\/wp\/v2\/posts\/1216\/revisions\/1217"}],"wp:attachment":[{"href":"https:\/\/it.thelibrarie.com\/weblog\/wp-json\/wp\/v2\/media?parent=1216"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/it.thelibrarie.com\/weblog\/wp-json\/wp\/v2\/categories?post=1216"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/it.thelibrarie.com\/weblog\/wp-json\/wp\/v2\/tags?post=1216"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}