{"id":7071,"date":"2017-10-11T18:30:13","date_gmt":"2017-10-11T10:30:13","guid":{"rendered":"http:\/\/rmohan.com\/?p=7071"},"modified":"2017-10-11T18:30:13","modified_gmt":"2017-10-11T10:30:13","slug":"raid-partition-how-to","status":"publish","type":"post","link":"https:\/\/mohan.sg\/?p=7071","title":{"rendered":"Raid Partition how to"},"content":{"rendered":"<p>RAID (Redundant Array of Inexpensive Disks)<\/p>\n<p>Create 3 partitions for implementing RAID using fdisk command.<\/p>\n<p>e.g. #fdisk \/dev\/hda<\/p>\n<p>Press n to create the 3 new partitions each of 100Mb in size.<\/p>\n<p>Press p to see the partition table.<\/p>\n<p>Press t to change the partition id of all the three partitions created by you to fd<\/p>\n<p>(linux raid auto).<\/p>\n<p>Press wq to save and exit from fdisk utility in linux.<\/p>\n<p>#partprobe<\/p>\n<p>Use fdisk -l to list the partition table.<\/p>\n<p>Creating RAID<\/p>\n<p># mdadm &#8211;create \/dev\/md0 &#8211;level=5 &#8211;raid-devices=3 \/dev\/hda6 \/dev\/hda7 \/dev\/<\/p>\n<p>hda8<\/p>\n<p>Press y to create the arrays.<\/p>\n<p>To see the details of raid use the following command: &#8211;<\/p>\n<p># cat \/proc\/mdstat<\/p>\n<p># mdadm &#8211;detail \/dev\/md0<\/p>\n<p>Creating the file system for your RAID devices<\/p>\n<p>#mkfs.ext3 \/dev\/md0<\/p>\n<p>Mounting the RAID partition<\/p>\n<p>#mkdir data<\/p>\n<p># mount \/dev\/md0 data<\/p>\n<p>#df -h \/root\/data (Command is used to see the space allocation).<\/p>\n<p>Crashing the raid devices<\/p>\n<p># mdadm &#8211;manage \/dev\/md0 &#8211;fail \/dev\/hda8<\/p>\n<p>Removing raid devices<\/p>\n<p># mdadm &#8211;manage \/dev\/md0 &#8211;remove \/dev\/hda8<\/p>\n<p>Adding raid devices<\/p>\n<p># mdadm &#8211;manage \/dev\/md0 &#8211;add \/dev\/hda8<\/p>\n<p>View failed and working raid devices<\/p>\n<p># cat \/proc\/mdstat<\/p>\n<p># mdadm &#8211;detail \/dev\/md0<\/p>\n<p># tail \/var\/log\/messages<\/p>\n<p>To remove the RAID follow these steps: &#8211;<\/p>\n<p>1) unmount the mounted directory where raid is mounted.<\/p>\n<p> e.g. umount data<\/p>\n<p>2) Stop the device<\/p>\n<p> e.g. mdadm &#8211;stop \/dev\/md0<\/p>\n<p>3) View the details of your raid level using following command: &#8211;<\/p>\n<p> #cat \/proc\/mdstat<\/p>\n<p> #mdadm &#8211;detail \/dev\/md0<\/p>\n","protected":false},"excerpt":{"rendered":"<p>RAID (Redundant Array of Inexpensive Disks)<\/p>\n<p>Create 3 partitions for implementing RAID using fdisk command.<\/p>\n<p>e.g. #fdisk \/dev\/hda<\/p>\n<p>Press n to create the 3 new partitions each of 100Mb in size.<\/p>\n<p>Press p to see the partition table.<\/p>\n<p>Press t to change the partition id of all the three partitions created by you to fd<\/p>\n<p> [&#8230;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[5],"tags":[],"_links":{"self":[{"href":"https:\/\/mohan.sg\/index.php?rest_route=\/wp\/v2\/posts\/7071"}],"collection":[{"href":"https:\/\/mohan.sg\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/mohan.sg\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/mohan.sg\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/mohan.sg\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=7071"}],"version-history":[{"count":1,"href":"https:\/\/mohan.sg\/index.php?rest_route=\/wp\/v2\/posts\/7071\/revisions"}],"predecessor-version":[{"id":7072,"href":"https:\/\/mohan.sg\/index.php?rest_route=\/wp\/v2\/posts\/7071\/revisions\/7072"}],"wp:attachment":[{"href":"https:\/\/mohan.sg\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=7071"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/mohan.sg\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=7071"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/mohan.sg\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=7071"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}