{"id":275,"date":"2014-10-01T13:52:48","date_gmt":"2014-10-01T17:52:48","guid":{"rendered":"http:\/\/www.mufljuz.com\/?p=275"},"modified":"2017-10-24T13:06:04","modified_gmt":"2017-10-24T17:06:04","slug":"rescue-gentoo-with-software-raid-1","status":"publish","type":"post","link":"https:\/\/www.mufljuz.com\/?p=275","title":{"rendered":"Rescue gentoo with software raid-1"},"content":{"rendered":"<p>Chroot to Gentoo env<\/p>\n<pre>\r\nlivecd ~ # modprobe raid1\r\nlivecd ~ # mdadm --detail --scan\r\nARRAY \/dev\/md\/3_0 metadata=0.90 UUID=5af462ee:8e535294:cb201669:f728008a\r\nARRAY \/dev\/md\/2_0 metadata=0.90 UUID=09338879:65611484:cb201669:f728008a\r\nARRAY \/dev\/md\/1_0 metadata=0.90 UUID=2fc18a05:fd33a57f:cb201669:f728008a\r\nlivecd ~ # mdadm --detail --scan > \/etc\/mdadm.conf\r\nlivecd ~ # ls \/dev\/md\r\nmd\/       md125     md126     md127     mdev.seq  \r\nlivecd ~ # ls \/dev\/md\r\nmd\/       md125     md126     md127     mdev.seq  \r\nlivecd ~ # ls \/dev\/md\/\r\n1_0  2_0  3_0  \r\nlivecd ~ # mount \/dev\/md\/3_0 \/mnt\/gentoo\/\r\nlivecd ~ # ls \/mnt\/gentoo\/\r\nbin  boot  dev  etc  home  lib  lib64  lost+found  media  mnt  opt  proc  root  run  sbin  sys  tmp  usr  var\r\nlivecd ~ # mount \/dev\/md\/1_0 \/mnt\/gentoo\/boot \r\nlivecd ~ # mount -t proc proc \/mnt\/gentoo\/proc\r\nlivecd ~ # mount --rbind \/dev \/mnt\/gentoo\/dev\r\nlivecd ~ # mount --rbind \/sys \/mnt\/gentoo\/sys\r\nlivecd ~ # cp -L \/etc\/resolv.conf \/mnt\/gentoo\/etc\/ \r\nlivecd \/ # chroot \/mnt\/gentoo \/bin\/bash                      \r\nlivecd ~ # source \/etc\/profile\r\n<\/pre>\n<p>Do kernel stuff<\/p>\n<pre>\r\ncd \/usr\/src\/linux\r\nmake && make modules_install\r\nmake install\r\n<\/pre>\n<p>Grub2 stuff: add additional parameters to kernel<br \/>\nnano -w \/etc\/default\/grub<br \/>\nGRUB_CMDLINE_LINUX_DEFAULT=&#8221;domdadm rootfstype=ext4&#8243;<\/p>\n<p>Initframes<\/p>\n<pre>\r\n# emerge genkernel\r\n# genkernel --install initramfs\r\n<\/pre>\n<p>To configure genkernel add your mdadm.conf file to your initrd with the &#8220;MDADM_CONFIG=&#8221; option in \/etc\/genkernel.conf<\/p>\n<pre>\r\nnano -w etc\/genkernel.conf\r\n\r\nMDADM_CONFIG=\"\/etc\/mdadm.conf\"\r\n<\/pre>\n<p>If you need specific support in the initramfs, such as lvm or raid, add in the appropriate options to genkernel. See genkernel &#8211;help for more information, or the next example which enables support for LVM and software raid (mdadm):<\/p>\n<pre>\r\n# genkernel --lvm --mdadm --install initramfs\r\n<\/pre>\n<p>grub2 setup<\/p>\n<pre>\r\ngrub2-mkconfig -o \/boot\/grub\/grub.cfg\r\n<\/pre>\n<p>check result in \/boot\/grub\/grub.cfg and compare raid device id with<\/p>\n<pre>\r\nblkid | grep \/dev\/md3\r\n<\/pre>\n<p>Reboot<\/p>\n<pre>\r\nlivecd linux-3.15.10-hardened-r1 # exit\r\nexit\r\nlivecd ~ # umount -l \/mnt\/gentoo\/dev{\/shm,\/pts,}\r\nlivecd ~ # umount -l \/mnt\/gentoo{\/proc,\/boot,\/sys,}\r\nlivecd ~ # reboot\r\n<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>Chroot to Gentoo env livecd ~ # modprobe raid1 livecd ~ # mdadm &#8211;detail &#8211;scan ARRAY \/dev\/md\/3_0 metadata=0.90 UUID=5af462ee:8e535294:cb201669:f728008a ARRAY \/dev\/md\/2_0 metadata=0.90 UUID=09338879:65611484:cb201669:f728008a ARRAY \/dev\/md\/1_0 metadata=0.90 UUID=2fc18a05:fd33a57f:cb201669:f728008a livecd ~ # mdadm &#8211;detail &#8211;scan > \/etc\/mdadm.conf livecd ~ # ls \/dev\/md md\/ md125 md126 md127 mdev.seq livecd ~ # ls \/dev\/md md\/ md125 md126 md127 mdev.seq [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[1],"tags":[],"_links":{"self":[{"href":"https:\/\/www.mufljuz.com\/index.php?rest_route=\/wp\/v2\/posts\/275"}],"collection":[{"href":"https:\/\/www.mufljuz.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.mufljuz.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.mufljuz.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.mufljuz.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=275"}],"version-history":[{"count":9,"href":"https:\/\/www.mufljuz.com\/index.php?rest_route=\/wp\/v2\/posts\/275\/revisions"}],"predecessor-version":[{"id":370,"href":"https:\/\/www.mufljuz.com\/index.php?rest_route=\/wp\/v2\/posts\/275\/revisions\/370"}],"wp:attachment":[{"href":"https:\/\/www.mufljuz.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=275"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.mufljuz.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=275"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.mufljuz.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=275"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}