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