mdadm Linux Software RAID QuickStart Guide

 

Create New RAID 1 Array:

First setup your partitions (make sure they are exactly the same size)
In my example I have sda3 and sdb3 which are 500GB in size.

mdadm --create /dev/md2 --level=1 --raid-devices=2 /dev/sda3 /dev/sdb3
mdadm: array /dev/md2 started.

Check Status Of The Array

*Note I already have other arrays md0 and md1.

You can see below that md2 is syncing at a speed of about 91MB per sec.

cat /proc/mdstat


Personalities : [raid1]
md2 : active raid1 sdb3[1] sda3[0]
      488287552 blocks [2/2] [UU]
      [>....................]  resync =  0.5% (2460992/488287552) finish=88.8min speed=91147K/sec
     
md1 : active raid1 sda2[0] sdb2[1]
      29302464 blocks [2/2] [UU]
     
md0 : active raid1 sdb1[1] sda1[0]
      58604992 blocks [2/2] [UU]
     
unused devices: <none>

Check the basic details of an array:



mdadm /dev/md0
/dev/md0: 55.89GiB raid1 2 devices, 0 spares. Use mdadm --detail for more detail.
/dev/md0: No md super block found, not an md component.


More Detail

mdadm --detail /dev/md0

/dev/md0:
        Version : 0.90
  Creation Time : Tue Aug 31 22:37:52 2010
     Raid Level : raid1
     Array Size : 58604992 (55.89 GiB 60.01 GB)
  Used Dev Size : 58604992 (55.89 GiB 60.01 GB)
   Raid Devices : 2
  Total Devices : 2
Preferred Minor : 0
    Persistence : Superblock is persistent

    Update Time : Wed Sep  1 18:39:53 2010
          State : active
 Active Devices : 2
Working Devices : 2
 Failed Devices : 0
  Spare Devices : 0

           UUID : 7b4e9a42:823c7ee5:0d6ee1b8:30df68a8
         Events : 0.7

    Number   Major   Minor   RaidDevice State
       0       8        1        0      active sync   /dev/sda1
       1       8       17        1      active sync   /dev/sdb1

Update /etc/mdadm.conf File



mdadm --brief --detail /dev/md0

ARRAY /dev/md0 level=raid1 num-devices=2 metadata=0.90 UUID=7b4e9a42:823c7ee5:0d6ee1b8:30df68a8

To edit the /etc/mdadm.conf file directly just run the command like this make sure to use the ">>" or you will wipe out any existing array info.

mdadm --brief --detail /dev/md0 >> /etc/mdadm.conf

 


Tags:

mdadm, linux, software, raid, quickstart, array, partitions, sda, sdb, gb, dev, md, devices, arrays, syncing, mb, proc, mdstat, personalities, active, uu, resync, min, unused, gib, spares, component, creation, tue, aug, preferred, persistence, superblock, persistent, update, wed, sep, uuid, ee, df, raiddevice, sync, etc, conf, num, metadata, edit, quot, existing, info,

Latest Articles

  • How To Add Windows 7 8 10 11 to GRUB Boot List Dual Booting
  • How to configure OpenDKIM on Linux with Postfix and setup bind zonefile
  • Debian Ubuntu 10/11/12 Linux how to get tftpd-hpa server setup tutorial
  • efibootmgr: option requires an argument -- 'd' efibootmgr version 15 grub-install.real: error: efibootmgr failed to register the boot entry: Operation not permitted.
  • Apache Error Won't start SSL Cert Issue Solution Unable to configure verify locations for client authentication SSL Library Error: 151441510 error:0906D066:PEM routines:PEM_read_bio:bad end line SSL Library Error: 185090057 error:0B084009:x509 certif
  • Linux Debian Mint Ubuntu Bridge br0 gets random IP
  • redis requirements
  • How to kill a docker swarm
  • docker swarm silly issues
  • isc-dhcp-server dhcpd how to get longer lease
  • nvidia cannot resume from sleep Comm: nvidia-sleep.sh Tainted: Linux Ubuntu Mint Debian
  • zfs and LUKS how to recover in Linux
  • [error] (28)No space left on device: Cannot create SSLMutex Apache Solution Linux CentOS Ubuntu Debian Mint
  • Save money on bandwidth by disabling reflective rpc queries in Linux CentOS RHEL Ubuntu Debian
  • How to access a disk with bad superblock Linux Ubuntu Debian Redhat CentOS ext3 ext4
  • ImageMagick error convert solution - convert-im6.q16: cache resources exhausted
  • PTY allocation request failed on channel 0 solution
  • docker error not supported as upperdir failed to start daemon: error initializing graphdriver: driver not supported
  • Migrated Linux Ubuntu Mint not starting services due to broken /var/run and dbus - Failed to connect to bus: No such file or directory solution
  • qemu-system-x86_64: Initialization of device ide-hd failed: Failed to get