{"id":767,"date":"2014-12-03T00:09:50","date_gmt":"2014-12-03T05:09:50","guid":{"rendered":"http:\/\/xfloyd.net\/blog\/?p=767"},"modified":"2014-12-13T10:10:30","modified_gmt":"2014-12-13T15:10:30","slug":"qnap-ts-212-how-to-rebuild-raid-manually-from-terminal","status":"publish","type":"post","link":"https:\/\/xfloyd.net\/blog\/?p=767","title":{"rendered":"QNAP TS-212 How to rebuild RAID manually from shell"},"content":{"rendered":"<p>Scenario = replace a disk in QNAP TS-212 with RAID 1 configuration active<\/p>\n<p>RAID rebuild should start automatically, but some times it could happen you got stuck with 1 Single Disk + 1 Mirroring Disk Volume:<\/p>\n<p>The workaround is this:<br \/>\n<!--more--><br \/>\nTelnet to NAS as Admin<\/p>\n<p>Check your current disk configuration for Disk #1 and Disk #2<\/p>\n<p><strong>fdisk -l \/dev\/sda <\/strong><\/p>\n<p><code>Disk \/dev\/sdb: 1000.2 GB, 1000204886016 bytes<br \/>\n255 heads, 63 sectors\/track, 121601 cylinders<br \/>\nUnits = cylinders of 16065 * 512 = 8225280 bytes<\/p>\n<p>Device Boot\u00a0Start\u00a0End\u00a0Blocks\u00a0Id\u00a0System<br \/>\n\/dev\/sdb1\u00a01\u00a066\u00a0530125\u00a083\u00a0Linux<br \/>\n\/dev\/sdb2\u00a067\u00a0132\u00a0530142\u00a083\u00a0Linux<br \/>\n\/dev\/sdb3\u00a0133\u00a0121538\u00a0975193693\u00a083\u00a0Linux<br \/>\n\/dev\/sdb4\u00a0121539\u00a0121600\u00a0498012\u00a083\u00a0Linux<\/code><\/p>\n<p><strong>fdisk -l \/dev\/sdb<\/strong><\/p>\n<p><code>Disk \/dev\/sda: 1000.2 GB, 1000204886016 bytes<br \/>\n255 heads, 63 sectors\/track, 121601 cylinders<br \/>\nUnits = cylinders of 16065 * 512 = 8225280 bytes<\/p>\n<p>Device Boot\u00a0Start\u00a0End\u00a0Blocks\u00a0Id\u00a0System<br \/>\n\/dev\/sda1\u00a01\u00a066\u00a0530125\u00a083\u00a0Linux<br \/>\n\/dev\/sda2\u00a067\u00a0132\u00a0530142\u00a083\u00a0Linux<br \/>\n\/dev\/sda3\u00a0133\u00a0121538\u00a0975193693\u00a083\u00a0Linux<br \/>\n\/dev\/sda4\u00a0121539\u00a0121600\u00a0498012\u00a083\u00a0Linux<\/p>\n<p>SDA is the first disk, SDB is the second disk<\/code><\/p>\n<p>Verify the current status of RAID with this command<\/p>\n<p><strong>mdadm &#8211;detail \/dev\/md0<\/strong><\/p>\n<p><code>\/dev\/md0:<br \/>\nVersion : 00.90.03<br \/>\nCreation Time : Thu Sep 22 21:50:34 2011<br \/>\nRaid Level : raid1<br \/>\nArray Size : 486817600 (464.27 GiB 498.50 GB)<br \/>\nUsed Dev Size : 486817600 (464.27 GiB 498.50 GB)<br \/>\nRaid Devices : 2<br \/>\nTotal Devices : 1<br \/>\nPreferred Minor : 0<br \/>\nPersistence : Superblock is persistent<\/p>\n<p>Intent Bitmap : Internal<\/p>\n<p>Update Time : Thu Jul 19 01:13:58 2012<br \/>\nState : active, degraded<br \/>\nActive Devices : 1<br \/>\nWorking Devices : 1<br \/>\nFailed Devices : 0<br \/>\nSpare Devices : 0<\/p>\n<p>UUID : 72cc06ac:570e3bf8:427adef1:e13f1b03<br \/>\nEvents : 0.1879365<\/p>\n<p>Number\u00a0Major\u00a0Minor\u00a0RaidDevice State<br \/>\n0\u00a00\u00a00\u00a00\u00a0removed<br \/>\n1\u00a08\u00a03\u00a01\u00a0active sync\u00a0\/dev\/sda3<\/code><\/p>\n<p>As you can see the \/dev\/sda3 is working, so disk #1 is OK, but disk #2 is missing from RAID<\/p>\n<p>Check if Disk #2 \/dev\/sdb is mounted (it should be)<\/p>\n<p><strong>mount <\/strong><\/p>\n<p><code>\/proc on \/proc type proc (rw)<br \/>\nnone on \/dev\/pts type devpts (rw,gid=5,mode=620)<br \/>\nsysfs on \/sys type sysfs (rw)<br \/>\ntmpfs on \/tmp type tmpfs (rw,size=32M)<br \/>\nnone on \/proc\/bus\/usb type usbfs (rw)<br \/>\n\/dev\/sda4 on \/mnt\/ext type ext3 (rw)<br \/>\n\/dev\/md9 on \/mnt\/HDA_ROOT type ext3 (rw)<br \/>\n\/dev\/md0 on \/share\/MD0_DATA type ext4 (rw,usrjquota=aquota.user,jqfmt=vfsv0,user_xattr,data=ordered,delalloc,noacl)<br \/>\ntmpfs on \/var\/syslog_maildir type tmpfs (rw,size=8M)<br \/>\n\/dev\/sdt1 on \/share\/external\/sdt1 type ufsd (rw,iocharset=utf8,dmask=0000,fmask=0111,force)<br \/>\ntmpfs on \/.eaccelerator.tmp type tmpfs (rw,size=32M)<br \/>\n\/dev\/sdb3 on \/share\/HDB_DATA type ext3 (rw,usrjquota=aquota.user,jqfmt=vfsv0,user_xattr,data=ordered,noacl)<\/code><\/p>\n<p>Dismount the \/dev\/sdb3 Disk #2 with this command<\/p>\n<p><strong>umount \/dev\/sdb3<\/strong><\/p>\n<p>Add Disk #2 into the RAID \/dev\/md0<\/p>\n<p><strong>mdadm &#8211;manage \/dev\/md0 &#8211;add \/dev\/sdb3<\/strong><\/p>\n<p><code>mdadm: added \/dev\/sdb3<\/code><\/p>\n<p>Check the RAID status and the rebuild should be started automatically<\/p>\n<p><strong>mdadm &#8211;detail \/dev\/md0<\/strong><\/p>\n<p><code>\/dev\/md0:<br \/>\nVersion : 00.90.03<br \/>\nCreation Time : Thu Sep 22 21:50:34 2011<br \/>\nRaid Level : raid1<br \/>\nArray Size : 486817600 (464.27 GiB 498.50 GB)<br \/>\nUsed Dev Size : 486817600 (464.27 GiB 498.50 GB)<br \/>\nRaid Devices : 2<br \/>\nTotal Devices : 2<br \/>\nPreferred Minor : 0<br \/>\nPersistence : Superblock is persistent<\/p>\n<p>Intent Bitmap : Internal<\/p>\n<p>Update Time : Thu Jul 19 01:30:27 2012<br \/>\nState : active, degraded, recovering<br \/>\nActive Devices : 1<br \/>\nWorking Devices : 2<br \/>\nFailed Devices : 0<br \/>\nSpare Devices : 1<\/p>\n<p>Rebuild Status : 0% complete<\/p>\n<p>UUID : 72cc06ac:570e3bf8:427adef1:e13f1b03<br \/>\nEvents : 0.1879848<\/p>\n<p>Number\u00a0Major\u00a0Minor\u00a0RaidDevice State<br \/>\n2\u00a08\u00a019\u00a00\u00a0spare rebuilding\u00a0\/dev\/sdb3<br \/>\n1\u00a08\u00a03\u00a01\u00a0active sync\u00a0\/dev\/sda3<\/code><\/p>\n<p>Check the NAS site for the rebuild % progress<\/p>\n<p>After the RAID rebuild complete, restart NAS to clean all previous mount point folder for sdb3<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Scenario = replace a disk in QNAP TS-212 with RAID 1 configuration active RAID rebuild should start automatically, but some times it could happen you got stuck with 1 Single Disk + 1 Mirroring Disk Volume: The workaround is this:<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"_links":{"self":[{"href":"https:\/\/xfloyd.net\/blog\/index.php?rest_route=\/wp\/v2\/posts\/767"}],"collection":[{"href":"https:\/\/xfloyd.net\/blog\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/xfloyd.net\/blog\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/xfloyd.net\/blog\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/xfloyd.net\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=767"}],"version-history":[{"count":8,"href":"https:\/\/xfloyd.net\/blog\/index.php?rest_route=\/wp\/v2\/posts\/767\/revisions"}],"predecessor-version":[{"id":787,"href":"https:\/\/xfloyd.net\/blog\/index.php?rest_route=\/wp\/v2\/posts\/767\/revisions\/787"}],"wp:attachment":[{"href":"https:\/\/xfloyd.net\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=767"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/xfloyd.net\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=767"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/xfloyd.net\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=767"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}