Differences
This shows you the differences between two versions of the page.
Next revision | Previous revision | ||
linux:raid [2006/06/15 20:36] greebo created |
linux:raid [2009/07/06 01:30] (current) 193.164.137.52 |
||
---|---|---|---|
Line 1: | Line 1: | ||
- | http:// | + | ====== Working with software RAID ====== |
+ | |||
+ | see also: | ||
+ | * [[http:// | ||
+ | * [[http:// | ||
+ | * [[: | ||
+ | |||
+ | |||
+ | |||
+ | |||
+ | ===== Debian Woody + kernel 2.4 ===== | ||
+ | |||
+ | Good article (based on the one that has already been available on old [[http:// | ||
+ | |||
+ | ===== Debian Sarge ===== | ||
+ | |||
+ | TODO | ||
+ | |||
+ | |||
+ | ===== RAID5 ===== | ||
+ | **Creating a new one** | ||
+ | mdadm --create --verbose /dev/md0 --level=5 --raid-devices=3 /dev/sda1 /dev/sdb1 /dev/sdc1 | ||
+ | |||
+ | **Adding spare to RAID5** | ||
+ | mdadm --add /dev/md0 /dev/sdh1 | ||
+ | |||
+ | **Fixing / | ||
+ | echo " | ||
+ | mdadm --detail --scan >> / | ||
+ | |||
+ | |||
+ | ===== SW RAID recover ===== | ||
+ | **Copying the partition table from working HDD to new one** | ||
+ | |||
+ | | ||
+ | | ||
+ | |||
+ | **Adding partitions back to raid** | ||
+ | mdadm --add /dev/md0 /dev/sdb1 | ||
+ | mdadm --add /dev/md1 /dev/sdb2 | ||
+ | mdadm --add /dev/md2 /dev/sdb3 | ||
+ | mdadm --add /dev/md3 /dev/sdb4 | ||
+ | |||
+ | |||
+ | **How to know which disk to remove?** | ||
+ | |||
+ | The safest way (IMHO) to know which disk to remove is to write down the serial number of the disk, e.g. using smartctl, and then check the back side of each disk for the matching serial number. | ||
+ | |||
+ | | ||
+ | | ||
+ | | ||
+ | |||
+ | ===== Forcing md array parity check ===== | ||
+ | |||
+ | Force your md array to recheck parity from time to time, to assure data consistency. The following command will read every block on every disk in the md0 array: | ||
+ | |||
+ | echo check > / | ||
+ | |||
+ | ===== active (auto-read-only) ===== | ||
+ | |||
+ | md0 : active (auto-read-only) raid1 sda1[0] sdb1[1] | ||
+ | | ||
+ | |||
+ | to fix: | ||
+ | |||
+ | # mdadm --readwrite /dev/md0 | ||
+ | |||
+ | ===== Force the Linux kernel to re-read a partitiontable ===== | ||
+ | |||
+ | | ||
+ | <note warning> | ||
+ | |||
+ | ===== Boot system with GRUB from RAID1 ===== | ||
+ | see also: [[http:// | ||
+ | | ||
+ | |||
+ | GNU GRUB version 0.95 (640K lower / 3072K upper memory) | ||
+ | |||
+ | [ Minimal BASH-like line editing is supported. | ||
+ | lists possible command completions. | ||
+ | completions of a device/ | ||
+ | |||
+ | | ||
+ | Filesystem type is ext2fs, partition type 0xfd | ||
+ | |||
+ | | ||
+ | Checking if "/ | ||
+ | Checking if "/ | ||
+ | Checking if "/ | ||
+ | Running "embed / | ||
+ | | ||
+ | Running " | ||
+ | / | ||
+ | | ||
+ | |||
+ | | ||
+ | Filesystem type is ext2fs, partition type 0xfd | ||
+ | |||
+ | | ||
+ | Checking if "/ | ||
+ | Checking if "/ | ||
+ | Checking if "/ | ||
+ | Running "embed / | ||
+ | | ||
+ | | ||
+ | / | ||
+ | Done. | ||
+ | |||
+ | grub> quit |