Child pages
  • Multiple devices (md, software RAID)

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

md assembles multiple devices into a single virtual devivedevice.

The multiple devices are variously called "underlying devices" and "RAID devices" in the documentation.  On this WIKI page they are always "underlying devices".

...

Create the block devices to be used as underlying devices.  Typically these are HDD partitions but any block devices can be used.  In the following example, /dev/sdb1 /dev/sdc1 are used.

...

mdadm

...

--create

...

/dev/md0

...

--level=1

...

--raid-devices=2

...

/dev/sdb1

...

/dev/sdc1

...

The md device may now be used like any other block device except when:

...

If the md device provides the file system including /boot or is an LVM PV (physical volume) then /etc/mdadm/mdadm.conf and the initrd must be updated

/usr/share/mdadm/mkconf > /etc/mdadm/mdadm.conf
update-initramfs -u

Replacing an underlying device

...

Regardless of how the underlying device was created, it can now be added to the md device.  Assuming the underlying device is sdb1 and the md device is md0:

...

mdadm

...

--manage

...

--add

...

/dev/md0

...

/dev/sdb1

Remove an md device

Removing /dev/md1 as an example ...

...