{"id":20,"date":"2005-06-16T16:10:00","date_gmt":"2005-06-16T16:10:00","guid":{"rendered":"http:\/\/elegans.uky.edu\/blog\/?p=20"},"modified":"2005-06-16T16:10:00","modified_gmt":"2005-06-16T16:10:00","slug":"install-new-hard-drives-with-software-raid-1","status":"publish","type":"post","link":"https:\/\/jimlund.org\/blog\/?p=20","title":{"rendered":"Install new hard drives with Software RAID 1"},"content":{"rendered":"<p>This turned out to be pretty straightforward once I got the order of steps right. Don\u00e2\u20ac\u2122t make the filesystems before the mkraid, you will end up with \u00e2\u20ac\u0153bad superblock\u00e2\u20ac\u009d errors later.<\/p>\n<p>I added two 400Gb SATA hard drives in RAID1 to an existing system. I already had one pair of drives in RAID 1, the new drives form a new RAID array.<\/p>\n<p>1) Phyiscally add the drives.<\/p>\n<p>2) Run fdisk, make one partition on each drive.<br \/>\n<code>fdisk \/dev\/hdc<br \/>\nfdisk \/dev\/hdd<\/code><\/p>\n<p>3) Edit \/etc\/raidtab, add section for \/dev\/md1:<br \/>\n<code>raiddev \/dev\/md1<br \/>\nraid-level 1<br \/>\nnr-raid-disks 2<br \/>\nchunk-size 256<br \/>\npersistent-superblock 1<br \/>\nnr-spare-disks 0<br \/>\ndevice \/dev\/sdc1<br \/>\nraid-disk 0<br \/>\ndevice \/dev\/sdd1<br \/>\nraid-disk 1<\/code><\/p>\n<p>4) Make RAID, needed \u00e2\u20ac\u02dcforce\u00e2\u20ac\u2122 flag:<br \/>\n<code>mkraid -f \/dev\/md1<br \/>\nmkraid -R \/dev\/md1<\/code><\/p>\n<p>5) Make filesystems:<br \/>\n<code>mke2fs -j \/dev\/sdc1<br \/>\nmke2fs -j \/dev\/sdd1<\/code><\/p>\n<p>This takes 10 min or so.<\/p>\n<p>6) Add new filesystem to \/etc\/fstab for automounting:<br \/>\n<code>\/dev\/md1 \/home ext3 defaults 1 2<\/code><\/p>\n<p>And now the keychain drive gets pushed from sdc to sde:<br \/>\n\/<code>udev\/sde1 \/mnt\/key vfat owner,kudzu 0 0<\/code><\/p>\n<p>7) Mount new RAID:<br \/>\n<code>mkdir \/data<br \/>\nmount \/data<\/code><\/p>\n<p>Useful RAID commands:<br \/>\n<code>more \/proc\/mdstat<br \/>\nmdadm -D \/dev\/md1<\/code><\/p>\n<p>Useful guide:<br \/>\n<a href=\"http:\/\/www.tldp.org\/HOWTO\/Software-RAID-HOWTO-5.html\">Software-RAID-HOWTO<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>This turned out to be pretty straightforward once I got the order of steps right. Don\u00e2\u20ac\u2122t make the filesystems before the mkraid, you will end up with \u00e2\u20ac\u0153bad superblock\u00e2\u20ac\u009d errors later. I added two 400Gb SATA hard drives in RAID1 to an existing system. I already had one pair of drives in RAID 1, the [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[23],"tags":[],"class_list":["post-20","post","type-post","status-publish","format-standard","hentry","category-linux"],"_links":{"self":[{"href":"https:\/\/jimlund.org\/blog\/index.php?rest_route=\/wp\/v2\/posts\/20","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/jimlund.org\/blog\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/jimlund.org\/blog\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/jimlund.org\/blog\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/jimlund.org\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=20"}],"version-history":[{"count":0,"href":"https:\/\/jimlund.org\/blog\/index.php?rest_route=\/wp\/v2\/posts\/20\/revisions"}],"wp:attachment":[{"href":"https:\/\/jimlund.org\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=20"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/jimlund.org\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=20"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/jimlund.org\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=20"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}