Differences
This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision | ||
mdadm [2016/04/29 12:17] steve |
mdadm [2016/04/29 12:32] steve |
||
---|---|---|---|
Line 98: | Line 98: | ||
RAID1 is for mirroring data across disks. If one drive fails, the data is still preserved. | RAID1 is for mirroring data across disks. If one drive fails, the data is still preserved. | ||
- | |||
- | Use fdisk to partition the new drives, and set them to type ''fd'' or ''Linux raid autodetect''. | ||
- | |||
- | <code> | ||
- | fdisk /dev/sdb | ||
- | fdisk /dev/sdc | ||
- | </code> | ||
Create the RAID1 array using the two harddrives: | Create the RAID1 array using the two harddrives: | ||
Line 164: | Line 157: | ||
When ''mdadm'' is started building / rebuilding an array, it will create ''/dev/mdX'' entries, and remove the block devices that are part of the RAID (/dev/sda1, /dev/sdb1, fex). After stopping mdadm, run partprobe to load the device nodes. It will restart mdadm, but stopping it the second time will leave the device blocks there. | When ''mdadm'' is started building / rebuilding an array, it will create ''/dev/mdX'' entries, and remove the block devices that are part of the RAID (/dev/sda1, /dev/sdb1, fex). After stopping mdadm, run partprobe to load the device nodes. It will restart mdadm, but stopping it the second time will leave the device blocks there. | ||
+ | |||
+ | === Examples === | ||
+ | |||
+ | From the man page. | ||
+ | |||
+ | Query the device to see if it's a RAID array, or part of one, etc.: | ||
+ | |||
+ | <code> | ||
+ | mdadm --query device | ||
+ | </code> | ||
+ | |||
+ | Scan the config file and assemble and start all arrays: | ||
+ | |||
+ | <code> | ||
+ | mdadm --assemble --scan | ||
+ | </code> | ||
+ | |||
+ | Shut down all arrays that can be shut down; not currently in use: | ||
+ | |||
+ | <code> | ||
+ | mdadm --stop --scan | ||
+ | </code> | ||
+ | |||
+ | Check devices that have RAID superblocks and print out results: | ||
+ | |||
+ | <code> | ||
+ | mdadm --examine --brief --scan --config=partitions | ||
+ | </code> |