{"id":18550,"date":"2026-04-22T10:09:22","date_gmt":"2026-04-22T09:09:22","guid":{"rendered":"https:\/\/roglacup.com\/klaus62\/?p=18550"},"modified":"2026-04-22T10:09:25","modified_gmt":"2026-04-22T09:09:25","slug":"the-definitive-guide-to-mdraid-mdadm-and-linux-software-raidmedium","status":"publish","type":"post","link":"https:\/\/roglacup.com\/klaus62\/2026\/04\/22\/the-definitive-guide-to-mdraid-mdadm-and-linux-software-raidmedium\/","title":{"rendered":"The Definitive Guide to mdraid, mdadm, and Linux Software RAID|Medium"},"content":{"rendered":"\n<h2 class=\"wp-block-heading\" id=\"bd11\">What Is mdraid? Core Concepts<\/h2>\n\n\n\n<p id=\"39e2\"><strong>mdraid<\/strong>&nbsp;(often shortened to&nbsp;<em>MD RAID<\/em>&nbsp;or simply&nbsp;<em>md<\/em>) is the Linux kernel\u2019s built\u2011in software RAID framework. It aggregates multiple block devices (drives, partitions, loopbacks, NVMe namespaces, etc.) into a single logical block device (\/dev\/mdX) that can deliver improved performance, redundancy, capacity aggregation \u2014 or some combination \u2014 depending on the selected RAID level.<\/p>\n\n\n\n<p id=\"a5e8\">At its heart, mdraid:<\/p>\n\n\n\n<p id=\"1d4e\">\u00b7 Lives primarily in the Linux kernel as the&nbsp;<em>md<\/em>&nbsp;(Multiple Device) driver.<\/p>\n\n\n\n<p id=\"9e21\">\u00b7 Uses on\u2011disk superblock metadata to describe array membership and layout.<\/p>\n\n\n\n<p id=\"043c\">\u00b7 Exposes assembled arrays as standard block devices that can be partitioned, formatted, LVM\u2019ed, encrypted, or used directly by applications.<\/p>\n\n\n\n<p id=\"66d6\">In other words: mdraid is the engine; mdadm is the toolkit and dashboard.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"aceb\">How mdraid Fits in the Linux Storage Stack<\/h2>\n\n\n\n<p id=\"8bfb\">A simplified vertical stack (bottom \u2192 top):<\/p>\n\n\n\n<p>[Physical \/ Virtual Drives]<br> SATA \/ SAS \/ NVMe \/ iSCSI LUNs \/ VMDKs \/ Cloud Block Vols<br> \u2193<br> [mdraid Kernel Layer] \u2190 assembled via mdadm<br> RAID0 | RAID1 | RAID4\/5\/6 | RAID10 | RAID1E | linear | multipath | etc.<br> \u2193<br> [Optional Layers]<br> LUKS dm-crypt | LVM PV\/VG\/LV (incl. LVM-thin) | Filesystems (ext4, XFS, btrfs, ZFS-on-Linux as zvol consumer, etc.)<br> \u2193<br> [Applications \/ Containers \/ VMs]<\/p>\n\n\n\n<p id=\"3864\">Because md devices appear as regular block devices, you can build rich storage stacks: encrypt then RAID, RAID then encrypt, layer LVM for flexible volume management, or present md devices to virtualization hosts.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"721b\">mdadm vs mdraid: Terminology Clarified<\/h2>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/miro.medium.com\/v2\/resize:fit:1050\/1*Rnd6ZBBZCfxvwBLimgS9cQ.png\" alt=\"\"\/><\/figure>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\">\n<p id=\"9d28\"><strong>Remember:<\/strong>&nbsp;You manage arrays with mdadm; the arrays themselves are provided by the mdraid kernel layer.<\/p>\n<\/blockquote>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"d58c\">Supported RAID Levels &amp; Modes<\/h2>\n\n\n\n<p id=\"7013\">mdraid supports a broad set of personalities (RAID implementations). Availability may vary slightly by kernel version, but common ones include:<\/p>\n\n\n\n<p id=\"9459\">\u00b7&nbsp;<strong>linear<\/strong>&nbsp;\u2014 Concatenate devices end\u2011to\u2011end; no redundancy.<\/p>\n\n\n\n<p id=\"ad2a\">\u00b7&nbsp;<strong>RAID 0 (striping)<\/strong>&nbsp;\u2014 Performance &amp; aggregate capacity; zero redundancy.<\/p>\n\n\n\n<p id=\"f9fd\">\u00b7&nbsp;<strong>RAID 1 (mirroring)<\/strong>&nbsp;\u2014 Redundancy via copies; read parallelism.<\/p>\n\n\n\n<p id=\"f5fd\">\u00b7&nbsp;<strong>RAID 4<\/strong>&nbsp;\u2014 Dedicated parity disk; rarely used.<\/p>\n\n\n\n<p id=\"f634\">\u00b7&nbsp;<strong>RAID 5<\/strong>&nbsp;\u2014 Distributed parity across members; 1\u2011disk fault tolerance.<\/p>\n\n\n\n<p id=\"1470\">\u00b7&nbsp;<strong>RAID 6<\/strong>&nbsp;\u2014 Dual distributed parity; 2\u2011disk fault tolerance.<\/p>\n\n\n\n<p id=\"f54d\">\u00b7&nbsp;<strong>RAID 10<\/strong>&nbsp;\u2014 Striped mirrors (mdraid implements as an n\u2011way layout over mirrored sets; flexible). Good mix of speed + redundancy.<\/p>\n\n\n\n<p id=\"a195\">\u00b7&nbsp;<strong>RAID 1E \/ RAID 10 variants<\/strong>&nbsp;\u2014 Extended \/ asymmetric mirror\u2011stripe layouts for odd numbers of drives.<\/p>\n\n\n\n<p id=\"1f4a\">\u00b7&nbsp;<strong>Multipath<\/strong>&nbsp;\u2014 md can be used (less common today) to provide failover across multiple I\/O paths.<\/p>\n\n\n\n<p id=\"41fe\">\u00b7&nbsp;<strong>Faulty<\/strong>&nbsp;\u2014 Testing personality that injects failures.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"6704\">Key Architecture Elements<\/h2>\n\n\n\n<p id=\"131c\"><strong>Superblock Metadata<\/strong>&nbsp;\u2014 Small headers stored on member devices that describe array UUID, RAID level, layout, chunk size, role of each device, and state.<\/p>\n\n\n\n<p id=\"3304\"><strong>md Personalities<\/strong>&nbsp;\u2014 RAID level implementations registered with the kernel\u2019s md subsystem.<\/p>\n\n\n\n<p id=\"74ae\"><strong>Bitmaps<\/strong>&nbsp;\u2014 Optional on\u2011disk or in\u2011memory bitmaps track which stripes are dirty, dramatically shortening resync\/recovery after unclean shutdowns.<\/p>\n\n\n\n<p id=\"25f3\"><strong>Reshape Engine<\/strong>&nbsp;\u2014 Allows changing array geometry (add\/remove devices, change RAID level in some cases) online in many scenarios. Performance impact can be significant; plan maintenance windows.<\/p>\n\n\n\n<p id=\"06f3\"><strong>mdmon (External Metadata Monitor)<\/strong>&nbsp;\u2014 Required for some external metadata formats (e.g., IMSM\/Intel Matrix) to keep metadata in sync.<\/p>\n\n\n\n<p id=\"cf0b\"><strong>Sysfs Controls<\/strong>&nbsp;\u2014 Tunables under \/sys\/block\/mdX\/md\/ expose runtime parameters (stripe cache, sync speed limits, write\u2011mostly flags, etc.).<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"fdb1\">Common Use Cases<\/h2>\n\n\n\n<p id=\"85f2\">\u00b7 Homelab NAS or DIY storage server using commodity disks.<\/p>\n\n\n\n<p id=\"644c\">\u00b7 Bootable mirrors (RAID1) for root filesystem resiliency.<\/p>\n\n\n\n<p id=\"b5fe\">\u00b7 RAID10 for database or virtualization workloads needing strong random I\/O + redundancy.<\/p>\n\n\n\n<p id=\"144d\">\u00b7 RAID5\/6 for bulk capacity with parity protection (backup targets, media libraries \u2014 though see risk discussion below on rebuild windows and URE rates).<\/p>\n\n\n\n<p id=\"39a1\">\u00b7 Aggregating NVMe drives when hardware RAID isn\u2019t desired or available.<\/p>\n\n\n\n<p id=\"dc14\">\u00b7 Cloud or virtual environments where virtual disks need software\u2011defined redundancy across failure domains.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"a859\">Planning an mdraid Deployment<\/h2>\n\n\n\n<p id=\"271c\">Before typing mdadm \u2014 create, answer these:<\/p>\n\n\n\n<p id=\"5354\"><strong>1. Workload Profile<\/strong><br>Random vs sequential; read\u2011heavy vs write\u2011heavy; mixed DB + VM vs cold archive.<\/p>\n\n\n\n<p id=\"7d8a\"><strong>2. Redundancy vs Capacity<\/strong><br>How many failures must you tolerate? RAID1\/10 vs RAID5\/6 trade\u2011offs.<\/p>\n\n\n\n<p id=\"9ded\"><strong>3. Media Type<\/strong><br>HDD, SSD, NVMe, or mixed? Parity RAID on SSD behaves differently (write amplification, TRIM behavior, queue depth scaling).<\/p>\n\n\n\n<p id=\"97dd\"><strong>4. Growth Expectations<\/strong><br>Will you add drives later? Consider RAID10 or start with larger drive count in RAID6; know reshape implications.<\/p>\n\n\n\n<p id=\"b936\"><strong>5. Boot Requirements<\/strong><br>If booting from md, choose metadata format (0.90 or 1.0) that places superblock where firmware\/bootloader expects.<\/p>\n\n\n\n<p id=\"0809\"><strong>6. Monitoring &amp; Alerting Plan<\/strong><br>Email alerts, systemd timers, mdadm \u2014 monitor, integration with Prometheus\/node_exporter, etc.<\/p>\n\n\n\n<p id=\"29cb\"><strong>7. Backup Strategy<\/strong><br>RAID \u2260 backup. Always maintain off\u2011array copies of critical data.<\/p>\n\n\n\n<p>More &amp; posted from: <a href=\"https:\/\/medium.com\/@pltnvs\/the-definitive-guide-to-mdraid-mdadm-and-linux-software-raid-fbb561c21878\">https:\/\/medium.com\/@pltnvs\/the-definitive-guide-to-mdraid-mdadm-and-linux-software-raid-fbb561c21878<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>What Is mdraid? Core Concepts mdraid&nbsp;(often shortened to&nbsp;MD RAID&nbsp;or simply&nbsp;md) is the Linux kernel\u2019s built\u2011in software RAID framework. It aggregates multiple block devices (drives, partitions, loopbacks, NVMe namespaces, etc.) into a single logical block device (\/dev\/mdX) that can deliver improved performance, redundancy, capacity aggregation \u2014 or some combination \u2014 depending on the selected RAID level.&hellip;&nbsp;<a href=\"https:\/\/roglacup.com\/klaus62\/2026\/04\/22\/the-definitive-guide-to-mdraid-mdadm-and-linux-software-raidmedium\/\" class=\"\" rel=\"bookmark\">Read More &raquo;<span class=\"screen-reader-text\">The Definitive Guide to mdraid, mdadm, and Linux Software RAID|Medium<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":18551,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"neve_meta_sidebar":"","neve_meta_container":"","neve_meta_enable_content_width":"","neve_meta_content_width":0,"neve_meta_title_alignment":"","neve_meta_author_avatar":"","neve_post_elements_order":"","neve_meta_disable_header":"","neve_meta_disable_footer":"","neve_meta_disable_title":"","footnotes":""},"categories":[384,17],"tags":[],"class_list":["post-18550","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-computer-science","category-linux"],"amp_enabled":true,"_links":{"self":[{"href":"https:\/\/roglacup.com\/klaus62\/wp-json\/wp\/v2\/posts\/18550","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/roglacup.com\/klaus62\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/roglacup.com\/klaus62\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/roglacup.com\/klaus62\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/roglacup.com\/klaus62\/wp-json\/wp\/v2\/comments?post=18550"}],"version-history":[{"count":1,"href":"https:\/\/roglacup.com\/klaus62\/wp-json\/wp\/v2\/posts\/18550\/revisions"}],"predecessor-version":[{"id":18552,"href":"https:\/\/roglacup.com\/klaus62\/wp-json\/wp\/v2\/posts\/18550\/revisions\/18552"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/roglacup.com\/klaus62\/wp-json\/wp\/v2\/media\/18551"}],"wp:attachment":[{"href":"https:\/\/roglacup.com\/klaus62\/wp-json\/wp\/v2\/media?parent=18550"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/roglacup.com\/klaus62\/wp-json\/wp\/v2\/categories?post=18550"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/roglacup.com\/klaus62\/wp-json\/wp\/v2\/tags?post=18550"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}