RAID Creation

From Linux Raid Wiki
(Difference between revisions)
Jump to: navigation, search
m (page name typo)
(Don't link duplicate superblock page)
 
(7 intermediate revisions by 3 users not shown)
Line 1: Line 1:
 
MD devices are created using the <code>Create</code> mode of <code>mdadm</code>.
 
MD devices are created using the <code>Create</code> mode of <code>mdadm</code>.
  
You need to specify the raid device to create, the raid mode (raid0, raid1, raid5, raid6 etc) and the component devices.
+
As of lvm2 2.02.87 and linux 2.6.32, LVM can be used to create MD-RAID volumes (<tt>lvcreate --type=raidN --stripes=numstripes</tt>).  This offers a strong guarantee that the component devices won't be exposed.
 +
 
 +
With mdadm, you specify the raid device to create, the raid mode (raid0, raid1, raid10, raid5, raid6 etc) and the component devices.
 +
 
 +
For example:
 +
 
 +
mdadm --create --bitmap=internal --metadata=1.2 --level=1 --raid-devices=2 /dev/md1 /dev/sda /dev/sdb
  
 
You can also configure many aspects of your array:
 
You can also configure many aspects of your array:
 +
* [[RAID superblock formats|superblock format]]:  <tt>--metadata=1.2</tt> is recommended.  0.90 and 1.0 are at the end of the device and risk exposing desynced contents if the superblock is damaged.  1.1 doesn't leave the first sector available to install a bootloader.
 
* [[device name]]
 
* [[device name]]
 
* [[label|name or label]]
 
* [[label|name or label]]
 
* [[Introduction#The_RAID_levels|RAID-level]]
 
* [[Introduction#The_RAID_levels|RAID-level]]
* [[superblock]]
 
 
* [[chunk size]]
 
* [[chunk size]]
 
* [[rounding]]
 
* [[rounding]]
 
* [[layout]]
 
* [[layout]]
* [[bitmap]]
+
* [[Write-intent bitmap]]
 
* [[write-mostly]]
 
* [[write-mostly]]
 
* [[partitionable]]
 
* [[partitionable]]
  
 
One question that frequently comes up with linux raid is:
 
One question that frequently comes up with linux raid is:
"Why does linux raid do 'resync' when I create a clean array? Can I skip that?"
+
<blockquote>“Why does linux raid do 'resync' when I create a clean array? Can I skip that?”</blockquote>
 
+
 
The answer is usually "NO". For more details see [[Initial Array Creation]]
 
The answer is usually "NO". For more details see [[Initial Array Creation]]

Latest revision as of 09:38, 5 October 2013

MD devices are created using the Create mode of mdadm.

As of lvm2 2.02.87 and linux 2.6.32, LVM can be used to create MD-RAID volumes (lvcreate --type=raidN --stripes=numstripes). This offers a strong guarantee that the component devices won't be exposed.

With mdadm, you specify the raid device to create, the raid mode (raid0, raid1, raid10, raid5, raid6 etc) and the component devices.

For example:

mdadm --create --bitmap=internal --metadata=1.2 --level=1 --raid-devices=2 /dev/md1 /dev/sda /dev/sdb

You can also configure many aspects of your array:

One question that frequently comes up with linux raid is:

“Why does linux raid do 'resync' when I create a clean array? Can I skip that?”

The answer is usually "NO". For more details see Initial Array Creation

Personal tools