nas:build_a_linux_nas:create_a_software_raid_array
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
nas:build_a_linux_nas:create_a_software_raid_array [2021/09/25 16:11] – peter | nas:build_a_linux_nas:create_a_software_raid_array [2021/09/26 12:00] (current) – [Ensure the RAID Array is reassembled automatically each time the system boots] peter | ||
---|---|---|---|
Line 1: | Line 1: | ||
====== NAS - Build a Linux NAS - Create a Software RAID Array ====== | ====== NAS - Build a Linux NAS - Create a Software RAID Array ====== | ||
+ | |||
+ | ===== Check the disk partitions to be used in the RAID ===== | ||
+ | |||
+ | <code bash> | ||
+ | mdadm --examine / | ||
+ | |||
+ | or | ||
+ | |||
+ | mdadm --examine /dev/sdb1 /dev/sdc1 /dev/sdd1 | ||
+ | </ | ||
+ | |||
+ | returns: | ||
+ | |||
+ | <code bash> | ||
+ | mdadm: No md superblock detected on /dev/sdb1 | ||
+ | mdadm: No md superblock detected on /dev/sdc1 | ||
+ | mdadm: No md superblock detected on /dev/sdd1 | ||
+ | </ | ||
+ | |||
+ | <WRAP info> | ||
+ | **NOTE: | ||
+ | </ | ||
+ | |||
+ | ---- | ||
===== Create a Software RAID Array ===== | ===== Create a Software RAID Array ===== | ||
Line 8: | Line 32: | ||
or | or | ||
- | sudo mdadm --create --verbose /dev/md0 --level=5 --raid-devices=3 --spare-devices=1 / | + | sudo mdadm --create --verbose /dev/md0 --level=5 --raid-devices=3 --spare-devices=1 / |
</ | </ | ||
Line 16: | Line 40: | ||
* This device represents the RAID 5 of /dev/sdb1, /dev/sdc1 and /dev/sdd1. | * This device represents the RAID 5 of /dev/sdb1, /dev/sdc1 and /dev/sdd1. | ||
* Obviously other RAID types could be used instead. | * Obviously other RAID types could be used instead. | ||
+ | |||
+ | If the following message is seen: **Device or resource busy**, then reboot the OS. | ||
</ | </ | ||
Line 24: | Line 50: | ||
<code bash> | <code bash> | ||
sudo mdadm --detail --scan | sudo tee -a / | sudo mdadm --detail --scan | sudo tee -a / | ||
+ | |||
+ | or | ||
+ | |||
+ | sudo mdadm --detail --scan --verbose | sudo tee -a / | ||
</ | </ | ||
+ | returns: | ||
+ | |||
+ | <code bash> | ||
+ | ARRAY /dev/md/0 level=raid5 num-devices=3 metadata=1.2 spares=1 name=xenial: | ||
+ | devices=/ | ||
+ | </ | ||
<WRAP info> | <WRAP info> | ||
Line 36: | Line 72: | ||
---- | ---- | ||
- | ===== Check the RAID Status | + | ===== Check the RAID Details |
<code bash> | <code bash> | ||
Line 50: | Line 86: | ||
**NOTE: | **NOTE: | ||
</ | </ | ||
+ | |||
+ | |||
+ | ---- | ||
+ | |||
+ | ===== Check Raid Status ===== | ||
+ | |||
+ | <code bash> | ||
+ | cat / | ||
+ | </ | ||
+ | |||
+ | returns: | ||
+ | |||
+ | <code bash> | ||
+ | Personalities : [raid6] [raid5] [raid4] | ||
+ | md0 : active raid5 sdc1[4] sdd1[3](S) sdb1[1] sda1[0] | ||
+ | 1953520640 blocks super 1.2 level 5, 512k chunk, algorithm 2 [3/2] [UU_] | ||
+ | [> | ||
+ | </ | ||
nas/build_a_linux_nas/create_a_software_raid_array.1632586318.txt.gz · Last modified: 2021/09/25 16:11 by peter