biolocal:Linux raid
From Wiki CEINGE
(Difference between revisions)
Revision as of 13:19, 19 June 2008 (edit) Gianluca (Talk | contribs) ← Previous diff |
Current revision (13:23, 19 June 2008) (edit) (undo) Gianluca (Talk | contribs) |
||
Line 54: | Line 54: | ||
</pre> | </pre> | ||
- | + | Prepare the new disk with a "Linux raid autodetect" partition and add it to the raid: | |
<pre> | <pre> | ||
mdadm --add /dev/md0 /dev/sdd1 | mdadm --add /dev/md0 /dev/sdd1 | ||
</pre> | </pre> |
Current revision
RAID Management
Verify raid status:
mdadm --detail /dev/md0
Examine disks:
mdadm -E /dev/sdd1
Stopping a raid disk:
mdadm -S /dev/md0
Assemble a already configured raid disk:
mdadm -A /dev/md0 /dev/sda1 /dev/sdb1 /dev/sdc1 mdadm -Af /dev/md0 /dev/sda1 /dev/sdb1 /dev/sdc1 (force)
RAID creation
Create new "Linux raid autodetect" partitions (type code fd in fdisk) on each disk:
fdisk /dev/sda
Create the array
mdadm --create /dev/md0 --level=5 --raid-devices=4 /dev/sda1 /dev/sdb1 /dev/sdc1 /dev/sdd1
Add the device list string into the file /etc/mdadm.conf:
DEVICE /dev/sda* /dev/sdb* /dev/sdc* /dev/sdd*
Automatically complete the configuration appending the raid device information:
mdadm --detail --scan >> /etc/mdadm.conf
Manage array disk replaces
Put the corrupted disk in failure status and remove it:
mdadm /dev/md4 -f /dev/sdd1 mdadm /dev/md4 -r /dev/sdd1
Prepare the new disk with a "Linux raid autodetect" partition and add it to the raid:
mdadm --add /dev/md0 /dev/sdd1