April 26, 2019

Using RAID in Linux - page 7

The Mysteries of RAID

  • August 1, 2002
  • By Alexander Prohorenko

Usually this is the best method to take for recovery.

  1. Restore system;
  2. Change "dead" disk;
  3. Starting system again;
  4. Typing
    raidhotadd /dev/mdX /dev/h(s)dY
    where X and Y - correspondingly, number of md-device and partition on the "new" disk;
  5. Waiting until array is automatically reconstructed.

"Hot" upgrades refer to the changing out of broken hard disk "on the fly", without stopping the server. This is a very useful ability, especially for servers where even a little downtime could means big trouble. This ability is often supported by expensive hardware controllers, but nothing prevents us from using it in software RAID.

But, if your RAID is IDE--forget about it, it's impossible. You can destroy your drive even with unstable electricity or just turning the machine on/off, because there is no such "bug trap" even in the interface. Beyond that, rescanning of IDE devices is absolutely necessary, and usually this can only be done with the BIOS of PC during booting.

With SCSI drives, it's a bit harder; but with special cable/disks/cutoff points and powerful controllers you canachieve a hot upgrade. But, before doing anything you should look through the hardware documentation from vendor, and check with the support team for the device if the docs aren't clear.

Finally, here are some very definite don'ts when working with RAID arrays:

  • Divide partitions included in a working array. Stop the array first. Otherwise it will be worse.
  • Execute fsck on some separated array partitions. You can easily asynchronize the array with many little and big problems and consequences. When you need to run fsck, first try to restore RAID with the utility ckraid with key --fix, and only then try fsck /dev/mdX, which will be more safe and efficient.

In general RAID is not that scary, if you look into it more deeply. Nevertheless, with all aspects of RAID, you need always remember simple precept: always back up your files!

Most Popular LinuxPlanet Stories