Mdadm: Difference between revisions
No edit summary |
|||
(4 intermediate revisions by the same user not shown) | |||
Line 7: | Line 7: | ||
</syntaxhighlight> | </syntaxhighlight> | ||
===Create a raid array=== | ===Create a raid array=== | ||
See https://www. | See https://www.digitalocean.com/community/tutorials/how-to-create-raid-arrays-with-mdadm-on-ubuntu#creating-a-raid-1-array | ||
First use gdisk to create a linux raid partition (FD00) on all your disks. | First use gdisk to create a linux raid partition (FD00) on all your disks. | ||
Line 14: | Line 14: | ||
Then run the following to create /dev/md0. | Then run the following to create /dev/md0. | ||
<syntaxhighlight lang="bash"> | <syntaxhighlight lang="bash"> | ||
# Raid 1 example with 2 disks | |||
mdadm --create /dev/md0 --level=1 --raid-devices=2 /dev/sdb1 /dev/sdc1 | |||
# Raid 6 example with 4 disks | |||
mdadm --create /dev/md0 --level=6 --raid-devices=4 /dev/sda1 /dev/sdb1 /dev/sdc1 /dev/sdd1 | mdadm --create /dev/md0 --level=6 --raid-devices=4 /dev/sda1 /dev/sdb1 /dev/sdc1 /dev/sdd1 | ||
# Now you have a block device /dev/md0 on which you can add LUKS, LVM, or a filesystem. | # Now you have a block device /dev/md0 on which you can add LUKS, LVM, or a filesystem. | ||
# Check sync progress | |||
cat /proc/mdstat | |||
</syntaxhighlight> | </syntaxhighlight> | ||
Line 40: | Line 47: | ||
==Changing Raid Levels== | ==Changing Raid Levels== | ||
Note: I haven't tested this. | Note: I haven't tested this.<br/> | ||
This procedure is primarilly for expanding when you get a new disk. | |||
===Raid 1 to Raid 5=== | ===Raid 1 to Raid 5=== | ||
Line 46: | Line 54: | ||
===Raid 5 to Raid 6=== | ===Raid 5 to Raid 6=== | ||
==See Also== | |||
# [[LUKS]] |