{"id":210,"date":"2011-05-17T18:37:37","date_gmt":"2011-05-17T18:37:37","guid":{"rendered":"http:\/\/www.omniweb.com\/wordpress\/?p=210"},"modified":"2011-10-04T19:17:23","modified_gmt":"2011-10-04T19:17:23","slug":"centos-software-raid-grub-bug","status":"publish","type":"post","link":"https:\/\/www.omniweb.com\/wordpress\/?p=210","title":{"rendered":"CentOS Software RAID Grub bug"},"content":{"rendered":"<p>Was working with an old CentOS 5.2 software raid and trying to replace the 70GB drives with 500GB drives.  Had quite a bit of difficulty with grub not working when trying to boot on one drive or the other after repartitioning the drives.<\/p>\n<p><a href=\"https:\/\/bugzilla.redhat.com\/show_bug.cgi?id=160563#c17\">This comment<\/a> seems to have come to the rescue:<br \/>\n1) Connect both drives and verify that all drives are sync&#8217;d (i.e. &#8220;cat<br \/>\n\/proc\/mdstat&#8221;)<br \/>\n2) If not, add the missing drive (i.e. If \/dev\/sdb1 is missing, &#8220;mdadm \/dev\/md0<br \/>\n&#8211;add \/dev\/sdb1&#8221;)<br \/>\n3) Wait for drives to sync up.<br \/>\n4) grub <enter><br \/>\n5) grub> device (hd0) \/dev\/sda <enter><br \/>\n6) grub> root (hd0,0) <enter><br \/>\n7) grub> setup (hd0) <enter><br \/>\n8 ) grub> device (hd0) \/dev\/sdb <enter><br \/>\n9) grub> root (hd0,0) <enter><br \/>\n10) grub> setup (hd0) <enter><br \/>\n11) grub> quit <enter><\/p>\n<p>After that, I tested booting from one drive and then the other, both were able to boot on their own &#8211; OK!  On to growing the raid, after some fun with Knoppix Qparted to get the drives partitioned to use as much space as possible and keep swap at the end.<\/p>\n<p>Somewhere along the way I had to set the partition type with <a href=\"http:\/\/www.linuxhomenetworking.com\/wiki\/index.php\/Quick_HOWTO_:_Ch26_:_Linux_Software_RAID\">the instructions found on this page<\/a><br \/>\nfdisk \/dev\/sdb<br \/>\n> t<br \/>\n> 1<br \/>\n> L<br \/>\n> fd<br \/>\n(sets partition 1&#8217;s type to Linux raid autodetect.)<br \/>\nRepeat for partition 2 (ie replace &#8216;1&#8217; above with &#8216;2&#8217;)<\/p>\n<p>Once I was (finally) able to boot from the repartitioned drives, ran this to increase the raid size:<br \/>\nmdadm -G \/dev\/md0 &#8211;size max<br \/>\nwatch -d cat \/proc\/mdstat<\/p>\n<p>then after things finished syncing up, ran this to actually get that space available:<br \/>\nresize2fs \/dev\/md0<\/p>\n<p>Repeated steps 4 &#8211; 11 before rebooting to test that the raid can boot off either drive.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Was working with an old CentOS 5.2 software raid and trying to replace the 70GB drives with 500GB drives. Had quite a bit of difficulty with grub not working when trying to boot on one drive or the other after &hellip; <a href=\"https:\/\/www.omniweb.com\/wordpress\/?p=210\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[1],"tags":[],"_links":{"self":[{"href":"https:\/\/www.omniweb.com\/wordpress\/index.php?rest_route=\/wp\/v2\/posts\/210"}],"collection":[{"href":"https:\/\/www.omniweb.com\/wordpress\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.omniweb.com\/wordpress\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.omniweb.com\/wordpress\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.omniweb.com\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=210"}],"version-history":[{"count":9,"href":"https:\/\/www.omniweb.com\/wordpress\/index.php?rest_route=\/wp\/v2\/posts\/210\/revisions"}],"predecessor-version":[{"id":285,"href":"https:\/\/www.omniweb.com\/wordpress\/index.php?rest_route=\/wp\/v2\/posts\/210\/revisions\/285"}],"wp:attachment":[{"href":"https:\/\/www.omniweb.com\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=210"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.omniweb.com\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=210"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.omniweb.com\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=210"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}