{"id":123,"date":"2012-12-21T14:30:22","date_gmt":"2012-12-21T20:30:22","guid":{"rendered":"http:\/\/lucasmanual.com\/blog\/?p=123"},"modified":"2012-12-21T14:30:22","modified_gmt":"2012-12-21T20:30:22","slug":"mdadm-raid5-how-to-replace-failed-drive-gpt-partition","status":"publish","type":"post","link":"https:\/\/lucasmanual.com\/blog\/mdadm-raid5-how-to-replace-failed-drive-gpt-partition\/","title":{"rendered":"mdadm Raid5 &#8211; How to replace failed drive GPT partition"},"content":{"rendered":"<p><strong>Install gdisk. On debian squeeze you need to add main backports <\/strong><br \/>\n<code>vi \/etc\/apt\/source.list<br \/>\n<strong>#Add below<\/strong><br \/>\ndeb http:\/\/backports.debian.org\/debian-backports squeeze-backports main contrib non-free<br \/>\n<\/code><br \/>\n<strong>Install gdisk <\/strong><br \/>\n<code>aptitude install gdisk<br \/>\n<\/code><br \/>\nDrive sdb1 failed? Show details of partition md0<br \/>\n<code>mdadm --detail \/dev\/md0<\/code><\/p>\n<p><code>cat \/proc\/mdstat<br \/>\nPersonalities : [raid6] [raid5] [raid4]<br \/>\nmd0 : active raid5 sdc1[1] sdd1[2]<br \/>\n      3907028864 blocks level 5, 64k chunk, algorithm 2 [3\/2] [_UU]<\/p>\n<p><\/code><br \/>\nDrive sdb1 is already removed. but if you need to remove it manually you can: <\/p>\n<p><code>mdadm \/dev\/mmdadm \/dev\/md0 -r \/dev\/sdb1<br \/>\n<\/code><br \/>\n<strong>    SHUT DOWN IF YOU NEED TO REPALCE DRIVE. MAKE SURE NEW DRIVE IS STILL sdb.<\/strong><br \/>\n<strong>Look how disk is structured and what partition type it has <\/strong><br \/>\n<code>sgdisk -p  \/dev\/sdb<br \/>\nDisk \/dev\/sdb: 3907029168 sectors, 1.8 TiB<br \/>\nLogical sector size: 512 bytes<br \/>\nDisk identifier (GUID): 0ED13F81-6EEA-4E12-9F27-DD806CF1F09C<br \/>\nPartition table holds up to 128 entries<br \/>\nFirst usable sector is 34, last usable sector is 3907029134<br \/>\nPartitions will be aligned on 8-sector boundaries<br \/>\nTotal free space is 0 sectors (0 bytes)<\/p>\n<p>Number  Start (sector)    End (sector)  Size       Code  Name<br \/>\n   1              34      3907029134   1.8 TiB     FD00<br \/>\n<\/code><br \/>\n<strong>Now copy partition A structure into partition B <\/strong><\/p>\n<p><strong>#sgdisk -R=\/dev\/TO_THIS_DISK \/dev\/FROM_THIS_DISK<\/strong><br \/>\n<code>sgdisk -R=\/dev\/sdb \/dev\/sda<br \/>\n<strong>#Give new GUID since above options clones the disk including GUID<\/strong><br \/>\nsgdisk -G \/dev\/sdb<\/code><\/p>\n<p><strong>Now readd the drive to md0 <\/strong><br \/>\n<code><br \/>\nmdadm \/dev\/md0 -a \/dev\/sdb1<br \/>\n<\/code><br \/>\n<strong>Check the status <\/strong><br \/>\n<code><br \/>\ncat \/proc\/mdstat<br \/>\nPersonalities : [raid6] [raid5] [raid4]<br \/>\nmd0 : active raid5 sdb1[3] sda1[1] sdc1[2]<br \/>\n      3907028864 blocks level 5, 64k chunk, algorithm 2 [3\/2] [_UU]<br \/>\n      [>....................]  recovery =  0.0% (124204\/1953514432) finish=786.3min speed=41401K\/sec<\/code><br \/>\n<strong>Done. Check back in few hours to see if it finished.<\/strong><br \/>\nKeywords: fdisk,sdisk, sgdisk, gdisk,parted,gpt, mbr,raid5,mdadm,linux,debian,<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Install gdisk. On debian squeeze you need to add main backports vi \/etc\/apt\/source.list #Add below deb http:\/\/backports.debian.org\/debian-backports squeeze-backports main contrib non-free Install gdisk aptitude install gdisk Drive sdb1 failed? Show details of partition md0 mdadm &#8211;detail \/dev\/md0 cat \/proc\/mdstat Personalities : [raid6] [raid5] [raid4] md0 : active raid5 sdc1[1] sdd1[2] 3907028864 blocks level 5, 64k&hellip; <a class=\"more-link\" href=\"https:\/\/lucasmanual.com\/blog\/mdadm-raid5-how-to-replace-failed-drive-gpt-partition\/\">Continue reading <span class=\"screen-reader-text\">mdadm Raid5 &#8211; How to replace failed drive GPT partition<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[6,3,4],"tags":[],"class_list":["post-123","post","type-post","status-publish","format-standard","hentry","category-corporate","category-debian","category-linux","entry"],"_links":{"self":[{"href":"https:\/\/lucasmanual.com\/blog\/wp-json\/wp\/v2\/posts\/123","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/lucasmanual.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/lucasmanual.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/lucasmanual.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/lucasmanual.com\/blog\/wp-json\/wp\/v2\/comments?post=123"}],"version-history":[{"count":9,"href":"https:\/\/lucasmanual.com\/blog\/wp-json\/wp\/v2\/posts\/123\/revisions"}],"predecessor-version":[{"id":657,"href":"https:\/\/lucasmanual.com\/blog\/wp-json\/wp\/v2\/posts\/123\/revisions\/657"}],"wp:attachment":[{"href":"https:\/\/lucasmanual.com\/blog\/wp-json\/wp\/v2\/media?parent=123"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/lucasmanual.com\/blog\/wp-json\/wp\/v2\/categories?post=123"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/lucasmanual.com\/blog\/wp-json\/wp\/v2\/tags?post=123"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}