{"id":15805,"date":"2025-09-24T10:48:19","date_gmt":"2025-09-24T05:18:19","guid":{"rendered":"https:\/\/www.skynats.com\/?p=15805"},"modified":"2025-09-29T12:21:45","modified_gmt":"2025-09-29T06:51:45","slug":"how-to-create-a-raid-6-array-on-linux","status":"publish","type":"post","link":"https:\/\/www.skynats.com\/blog\/how-to-create-a-raid-6-array-on-linux\/","title":{"rendered":"How to Create a RAID 6 Array on Linux"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">When you&#8217;re managing critical data, redundancy is non-negotiable. RAID 6 Array on <a href=\"https:\/\/www.linux.org\/\" target=\"_blank\" rel=\"noopener\"><mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-secondary-color\">Linux<\/mark><\/a> is a powerful solution that offers fault tolerance and ample usable storage. The process of creating a RAID 6 array using mdadm on a Linux system is described below.<\/p>\n\n\n\n<h2 class=\"wp-block-heading has-small-font-size\" id=\"h-what-is-raid-6\"><strong>What is RAID 6?<\/strong><\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">RAID 6 (Redundant Array of Independent Disks, level 6) stripes data across multiple drives while also storing <strong>two parity blocks per stripe<\/strong>. This allows the array to survive <strong>two simultaneous disk failures <\/strong>&#8211; a significant improvement over RAID 5, which only tolerates one failure.<\/p>\n\n\n\n<h3 class=\"wp-block-heading has-small-font-size\"><strong>Key Benefits:<\/strong><\/h3>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>Double redundancy<\/strong>: Can handle two disk failures.<\/li>\n\n\n\n<li><strong>High capacity<\/strong>: More usable space than RAID 1 or RAID 10.<\/li>\n\n\n\n<li><strong>Distributed parity<\/strong>: Balanced write operations across all drives.<\/li>\n<\/ul>\n\n\n\n<h3 class=\"wp-block-heading has-small-font-size\"><strong>Keep in Mind:<\/strong><\/h3>\n\n\n\n<ul class=\"wp-block-list\">\n<li>You need <strong>a minimum of four drives<\/strong>.<\/li>\n\n\n\n<li>Two disks\u2019 worth of capacity is used for parity.<\/li>\n\n\n\n<li>Performance in degraded mode (when a disk fails) can be <strong>very poor<\/strong>.<\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading has-small-font-size\"><strong>Step 1: Identify Available Disks<\/strong><\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Use lsblk to identify which drives you want to include in your RAID array.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>lsblk<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Sample Output:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>NAME     SIZE FSTYPE   TYPE MOUNTPOINT\nsda      100G                     disk \nsdb      100G                     disk \nsdc      100G                     disk \nsdd      100G                     disk <\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">In this example, we&#8217;ll use <strong>\/dev\/sda, \/dev\/sdb, \/dev\/sdc, and \/dev\/sdd<\/strong> as RAID components.<\/p>\n\n\n\n<h2 class=\"wp-block-heading has-small-font-size\"><strong>Step 2: Hard drives partitioning<\/strong><\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Use the fdisk command (fdisk -l) to inspect hard disks.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Use the below command to start the first disk\u2019s partitioning. This will cause the fdisk menu to appear. If your disk name differs, replace it with your own.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>fdisk \/dev\/sda<\/code><\/pre>\n\n\n\n<ul class=\"wp-block-list\">\n<li>To start a new partition, type n.<\/li>\n\n\n\n<li>To designate this as the primary partition, enter p.<\/li>\n\n\n\n<li>Type the partition number, 1.<\/li>\n\n\n\n<li>To respond by default to the first and last sector prompts, simply hit the enter key.<\/li>\n\n\n\n<li>To choose the recently created partition, enter t.<\/li>\n\n\n\n<li>set up Linux RAID on the partition.<\/li>\n\n\n\n<li>To write all of these modifications to the disk, enter w.<\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\">For the remaining disks, we now have to follow exactly the same procedures. That would be disk \/dev\/sdb, \/dev\/sdc and \/dev\/sdd in our scenario.<\/p>\n\n\n\n<h2 class=\"wp-block-heading has-small-font-size\"><strong>Step 3: Create the RAID 6 Array<\/strong><\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Use the mdadm command to create the array:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo mdadm --create --verbose \/dev\/md0 --level=6 --raid-devices=4 \/dev\/sda \/dev\/sdb \/dev\/sdc \/dev\/sdd<\/code><\/pre>\n\n\n\n<ul class=\"wp-block-list\">\n<li>\/dev\/md0 is the new RAID device.<\/li>\n\n\n\n<li>&#8211;level=6 specifies RAID 6.<\/li>\n\n\n\n<li>&#8211;raid-devices=4 tells mdadm how many drives you\u2019re using.<\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading has-small-font-size\"><strong>Step 4: Monitor the Array Build<\/strong><\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">The array will begin syncing in the background. Check the progress with:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>cat \/proc\/mdstat<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Example Output:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>md0 : active raid6 sdd&#91;3] sdc&#91;2] sdb&#91;1] sda&#91;0]\n      209584128 blocks super 1.2 level 6, 512k chunk, algorithm 2 &#91;4\/4] &#91;UUUU]\n      &#91;&gt;....................]  resync =  0.6% (668572\/104792064) finish=10.3min speed=167143K\/sec<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">You can continue using the system while the array syncs.<\/p>\n\n\n\n<h2 class=\"wp-block-heading has-small-font-size\"><strong>Step 5: Format and Mount the RAID Array<\/strong><\/h2>\n\n\n\n<h3 class=\"wp-block-heading has-small-font-size\"><strong>Create the Filesystem:<\/strong><\/h3>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo mkfs.ext4 -F \/dev\/md0<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Create a Mount Point:<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo mkdir -p \/mnt\/md0<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Mount the RAID Array:<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo mount \/dev\/md0 \/mnt\/md0<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Check Disk Usage:<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>df -h<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Output Example:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>Filesystem      Size  Used Avail Use% Mounted on\n\/dev\/md0        197G   60M  187G   1% \/mnt\/md0<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">The array is now formatted, mounted, and ready for use.<\/p>\n\n\n\n<h2 class=\"wp-block-heading has-small-font-size\"><strong>Step 6: Save the Array Configuration<\/strong><\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">To ensure the array assembles on boot. Save Array Info to <strong>mdadm.conf<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo mdadm --detail --scan | sudo tee -a \/etc\/mdadm\/mdadm.conf<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Update Initramfs:<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo update-initramfs -u<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading has-small-font-size\"><strong>Step 7: Automount the RAID Array<\/strong><\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Add the mount configuration to <strong>\/etc\/fstab<\/strong>. This ensures the RAID 6 array mounts automatically at boot.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>echo '\/dev\/md0 \/mnt\/md0 ext4 defaults,nofail,discard 0 0' | sudo tee -a \/etc\/fstab<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading has-small-font-size\"><strong>Conclusion<\/strong><\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Successfully configured a RAID 6 array with Linux mdadm. You now have a fault-tolerant storage solution capable of surviving <strong>two disk failures<\/strong> with good performance and usable capacity. RAID 6 is ideal for environments where <strong>data integrity<\/strong> and <strong>uptime<\/strong> are critical. With proper monitoring and backups, it can be a solid foundation for your storage strategy.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">If you\u2019re planning to set up a RAID 6 Array on Linux but need expert guidance or a hassle-free deployment, our team is here to help. At Skynats, we specialize in comprehensive <a href=\"https:\/\/www.skynats.com\/linux-server-management\/\">Linux Server Management services<\/a>, ensuring your servers are configured for maximum reliability, performance, and data protection. Contact us today to get professional support for building and maintaining secure, optimized Linux environments.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>When you&#8217;re managing critical data, redundancy is non-negotiable. RAID 6 Array on Linux is a powerful solution that offers fault tolerance and ample usable storage. The process of creating a RAID 6 array using mdadm on a Linux system is described below. What is RAID 6? RAID 6 (Redundant Array of Independent Disks, level 6) [&hellip;]<\/p>\n","protected":false},"author":14,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[5],"tags":[1121],"class_list":["post-15805","post","type-post","status-publish","format-standard","hentry","category-blog","tag-raid-6-array-on-linux"],"_links":{"self":[{"href":"https:\/\/www.skynats.com\/blog\/wp-json\/wp\/v2\/posts\/15805","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.skynats.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.skynats.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.skynats.com\/blog\/wp-json\/wp\/v2\/users\/14"}],"replies":[{"embeddable":true,"href":"https:\/\/www.skynats.com\/blog\/wp-json\/wp\/v2\/comments?post=15805"}],"version-history":[{"count":2,"href":"https:\/\/www.skynats.com\/blog\/wp-json\/wp\/v2\/posts\/15805\/revisions"}],"predecessor-version":[{"id":15808,"href":"https:\/\/www.skynats.com\/blog\/wp-json\/wp\/v2\/posts\/15805\/revisions\/15808"}],"wp:attachment":[{"href":"https:\/\/www.skynats.com\/blog\/wp-json\/wp\/v2\/media?parent=15805"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.skynats.com\/blog\/wp-json\/wp\/v2\/categories?post=15805"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.skynats.com\/blog\/wp-json\/wp\/v2\/tags?post=15805"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}