Difference between revisions of "Mdadm"

From Linuxintro
imported>ThorstenStaerk
(Created page with " mdadm --create --verbose /dev/md0 --level=0 --raid-devices=2 /dev/sdh /dev/sdi")
 
imported>ThorstenStaerk
 
(11 intermediate revisions by 3 users not shown)
Line 1: Line 1:
 +
mdadm is a tool to create and manage software RAID. It allows you to
 +
* '''create''' a (new) software raid array. Think of two USB hard drives that you just bought and that you want to use in a RAID 1 configuration.
 +
* '''assemble''' an (existing) array. Think of two USB hard drives that you have in your shelve and that you have already made to a RAID array using the ''create'' command. When you re-attach them to your computer, you need to tell the computer how the disks belong together (RAID 0 or RAID 1 for example). That is what the assemble command is for.
 +
 +
= Create =
 
  mdadm --create --verbose /dev/md0 --level=0 --raid-devices=2 /dev/sdh /dev/sdi
 
  mdadm --create --verbose /dev/md0 --level=0 --raid-devices=2 /dev/sdh /dev/sdi
 +
 +
= Assemble =
 +
# mdadm --assemble --scan
 +
mdadm: /dev/md/0 has been started with 2 drives.
 +
 +
= Store configuration =
 +
You can store your mdadm configuration like this:
 +
mdadm --detail --scan >/etc/mdadm.conf
 +
 +
= Monitor =
 +
Monitor your raid's status with the command
 +
cat /proc/mdstat
 +
 +
= See also =
 +
* [http://linux.die.net/man/8/mdadm mdadm's man page]
 +
* http://www.ducea.com/2009/03/08/mdadm-cheat-sheet/
 +
 +
{{stub}}

Latest revision as of 09:42, 22 April 2014

mdadm is a tool to create and manage software RAID. It allows you to

  • create a (new) software raid array. Think of two USB hard drives that you just bought and that you want to use in a RAID 1 configuration.
  • assemble an (existing) array. Think of two USB hard drives that you have in your shelve and that you have already made to a RAID array using the create command. When you re-attach them to your computer, you need to tell the computer how the disks belong together (RAID 0 or RAID 1 for example). That is what the assemble command is for.

Create

mdadm --create --verbose /dev/md0 --level=0 --raid-devices=2 /dev/sdh /dev/sdi

Assemble

# mdadm --assemble --scan
mdadm: /dev/md/0 has been started with 2 drives.

Store configuration

You can store your mdadm configuration like this:

mdadm --detail --scan >/etc/mdadm.conf 

Monitor

Monitor your raid's status with the command

cat /proc/mdstat

See also


This article is a stub and needs improvement. You can help here :)