<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.williams-net.org/index.php?action=history&amp;feed=atom&amp;title=Linux_RAID_Array</id>
	<title>Linux RAID Array - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.williams-net.org/index.php?action=history&amp;feed=atom&amp;title=Linux_RAID_Array"/>
	<link rel="alternate" type="text/html" href="https://wiki.williams-net.org/index.php?title=Linux_RAID_Array&amp;action=history"/>
	<updated>2026-06-01T02:34:40Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.40.1</generator>
	<entry>
		<id>https://wiki.williams-net.org/index.php?title=Linux_RAID_Array&amp;diff=41&amp;oldid=prev</id>
		<title>DrEdWilliams: Created page with &quot;== Creating a new RAID array == If it isn&#039;t already installed, load the mdadm package:  yum -y install mdadm  Get the list of disks in the system and identify the ones that yo...&quot;</title>
		<link rel="alternate" type="text/html" href="https://wiki.williams-net.org/index.php?title=Linux_RAID_Array&amp;diff=41&amp;oldid=prev"/>
		<updated>2019-08-03T01:40:24Z</updated>

		<summary type="html">&lt;p&gt;Created page with &amp;quot;== Creating a new RAID array == If it isn&amp;#039;t already installed, load the mdadm package:  yum -y install mdadm  Get the list of disks in the system and identify the ones that yo...&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;== Creating a new RAID array ==&lt;br /&gt;
If it isn&amp;#039;t already installed, load the mdadm package:&lt;br /&gt;
 yum -y install mdadm&lt;br /&gt;
&lt;br /&gt;
Get the list of disks in the system and identify the ones that you want to include:&lt;br /&gt;
 fdisk -l | grep GB&lt;br /&gt;
&lt;br /&gt;
Identify if any arrays are already in place:&lt;br /&gt;
 cat /proc/mdstat&lt;br /&gt;
&lt;br /&gt;
Create the array -- generally, &amp;lt;mdevice&amp;gt; will start with /dev/md0&lt;br /&gt;
 mdadm --create &amp;lt;mdevice&amp;gt; --chunk=64K --level=5 --raid-devices=&amp;lt;count&amp;gt; &amp;lt;list of drive devices&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you get I/O errors, try chunk sizes in powers of 2 starting at 4K -- larger is better, but exactly divides the available space (i.e. you may waste space on each device that is less than a chunk).  The errors may not come when creating the array; creating the filesystem is where the errors could occur.&lt;br /&gt;
&lt;br /&gt;
 mdadm --create &amp;lt;mdevice&amp;gt; --chunk=&amp;lt;chunksize&amp;gt; --level=5 --raid-devices=&amp;lt;count&amp;gt; &amp;lt;list of drive devices&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Check the status of the array:&lt;br /&gt;
 cat /proc/mdstat&lt;br /&gt;
&lt;br /&gt;
If you&amp;#039;ll be mounting it directly, then create a filesystem on it:&lt;br /&gt;
 mkfs -t xfs &amp;lt;mdevice&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Replacing a failing disk ==&lt;br /&gt;
Identify the disks involved:&lt;br /&gt;
* /dev/sdY - new disk (or partition /dev/sdY1)&lt;br /&gt;
* /dev/sdX - old failing disk&lt;br /&gt;
&lt;br /&gt;
If replacing with a partition of a disk&lt;br /&gt;
 mdadm /dev/mdN --add /dev/sdY1 --replace /dev/sdX --with /dev/sdY1&lt;br /&gt;
&lt;br /&gt;
If replacing with a whole disk&lt;br /&gt;
 mdadm /dev/mdN --add /dev/sdY1 --replace /dev/sdX --with /dev/sdY&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Removing an MDADM Raid Array ==&lt;br /&gt;
&lt;br /&gt;
Find out your arrays (md0, md1, etc..) using&lt;br /&gt;
 sudo fdisk -l&lt;br /&gt;
&lt;br /&gt;
Query your arrays to find out what disks are contained using&lt;br /&gt;
 sudo mdadm --detail /dev/md0&lt;br /&gt;
&lt;br /&gt;
... using the appropriate /dev/md* device ...&lt;br /&gt;
&lt;br /&gt;
Unmount the array first, otherwise it fails with &amp;quot;device is busy&amp;quot;.&lt;br /&gt;
 sudo umount /dev/md0&lt;br /&gt;
&lt;br /&gt;
Shut down the array using&lt;br /&gt;
 sudo mdadm --stop /dev/md0&lt;br /&gt;
&lt;br /&gt;
And here&amp;#039;s the magic key:  zero the superblock FOR EACH drive so it doesn&amp;#039;t try to rebuild the array&lt;br /&gt;
 sudo mdadm --zero-superblock /dev/sdX&lt;br /&gt;
&lt;br /&gt;
Repeat for each drive in the array ...&lt;/div&gt;</summary>
		<author><name>DrEdWilliams</name></author>
	</entry>
</feed>