Tech

Guides
 

Linux software RAID with mdadm

By Staff, Special to ZDNet Asia
Friday, April 15, 2005 06:42 PM
Software RAID on Linux is a snap, thanks to the mdadm tool that comes with most modern Linux distributions. Software RAID, particularly RAID1, is an inexpensive way to create instant backups and protect your systems against data loss in the event that one drive fails.

To create a RAID device, execute the following command:

# mdadm --create --verbose /dev/md0 --level=1 --raid-devices=2 \
/dev/hda1 /dev/hdc1


There are two ways to obtain information about the RAID array. You can query the device with mdadm, which provides detailed information on a particular device, or you can get an overview of the entire RAID system by looking at /proc/mdstat directly. For example:

# cat /proc/mdstat
Personalities : [raid1]
read_ahead 1024 sectors
md0 : active raid1 hda1[0] hdc1[1]
56261376 blocks [2/2] [UU]


Here you can see that the personality is RAID1, the device /dev/md0 is active, and both disks are active (noted by [UU]). To obtain more detailed information about this device, use the following command:

# mdadm --detail /dev/md0

This will print out a variety of information about the device, including when it was created, its size, and the time it was last updated.

If you want to change drives, you can remove a device from the array. This command will prevent the partition /dev/hdc1 from appearing in the /dev/md0 array:

# mdadm /dev/md0 -r /dev/hdc1

You can also add the device back into the array. Here's how:

# mdadm /dev/md0 -a /dev/hdc1

While RAID management can be extremely complex, simple drive mirroring (like this RAID1 setup) is fairly easy. In addition, it offers a more flexible and cost-effective backup solution than expensive tape or removable media solutions.



WORTHWHILE?

0

0 votes
Blog

Talkback 0 comments

There are currently no comments for this post.


Guest user

Guest user

Level: 
Joined: —
Already a member? Log in »



 

Loading...

Whitepapers/Case Studies

Downloads



Tech Jobs Now!

Tags

  1. bank
  2. business strategies & functions
  3. china
  4. cio
  5. environment
  6. financial
  7. hardware
  8. india
  9. industry
  10. information technology
  11. infrastructure / architecture management
  12. it outsourcing
  13. job
  14. leadership
  15. outsourcing
  16. revenue
  17. security
  18. software
  19. web
  20. web 2.0