A service of Daily Data, Inc.
Contact Form

User Tools

Site Tools


quickreference:mdadm

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Next revision
Previous revision
quickreference:mdadm [2018/10/27 23:16] – external edit 127.0.0.1quickreference:mdadm [2026/04/13 20:50] (current) rodolico
Line 29: Line 29:
 ==== Create RAID ===== ==== Create RAID =====
 <code bash> <code bash>
-mdadm --create /dev/md2 --raid-devices=3 --spare-devices=0 --level=5 --run /dev/sd[cde]1+mdadm --create /dev/md2 --assume-clean --raid-devices=3 --spare-devices=0 --level=5 --run /dev/sd[cde]1
 </code> </code>
 +
 +Note: --assume-clean is for SSD's which are **known** to be clean (no bad blocks). It will not do a resync on the underlying system, 'assuming they are clean', which will reduce the wear on the block devices. However, it is not recommended by the authors of mdadm (see man page)
  
 Note: see Setting GRUB on a drive if you are setting up a bootable RAID-1 Note: see Setting GRUB on a drive if you are setting up a bootable RAID-1
Line 209: Line 211:
 </code> </code>
 This stops the array as /dev/md127 and then reassembles it as /dev/md0. The reassembly looks for devices which have an existing minor number of 127, not 0 (-m127), and then updates the minors in the superblocks to the new number. I included the original members (sdb, sdc and sdd) as /dev/sd[bcd] This stops the array as /dev/md127 and then reassembles it as /dev/md0. The reassembly looks for devices which have an existing minor number of 127, not 0 (-m127), and then updates the minors in the superblocks to the new number. I included the original members (sdb, sdc and sdd) as /dev/sd[bcd]
 +
 +Note: If you have LVM2 running on top of your RAID set, you must do the following for each LV listed.
 +<code bash>
 +for lv in `ls /dev/vgname/`
 +do
 +   lvchange -an $lv
 +done
 +vgchange -an vgname
 +</code>
 +change vgname to the actual name of you volume group. You must do this before you can stop the md
  
 ==== Converting from one RAID level to another ===== ==== Converting from one RAID level to another =====
quickreference/mdadm.1540700161.txt.gz · Last modified: by 127.0.0.1