Sonora Communications, Inc.

  • Increase font size
  • Default font size
  • Decrease font size

Linux Software RAID Notes

E-mail Print PDF

Resources

http://www.tldp.org/HOWTO/Software-RAID-HOWTO.html#toc5
http://www.linuxdevcenter.com/pub/a/linux/2002/12/05/RAID.html
http://linux-raid.osdl.org/index.php/RAID_setup

Related: LVM

http://www.tldp.org/HOWTO/LVM-HOWTO/
http://contribs.org/modules/phpwiki/index.php/lvm

SME 7

SME 7 installation on a single disk defaults to configuring a degraded RAID1 (mirrored) array, on two disks, RAID1, on three disks, RAID5.

A second disk added to a single disk SME server will not automatically create the mirror.

SME 7 has a new option in admin menu to "Manage disk redundancy". Here you can add a second hard disk to complete the mirror.

su admin 

SME 7 uses the raidmonitor package to alert the admin user of raid problems.

Useful RAID Commands

View partitions:

cat /proc/partitions 

View current status of all arrays:

cat /proc/mdstat 

View array configuration file:

cat /etc/mdadm.conf 

View array details:

mdadm --detail --scan
mdadm --detail /dev/mdx

Remove the problem partition from array:

mdadm /dev/mdx -r /dev/sdxy 

Add the partition to the array:

mdadm /dev/mdx -a /dev/sdxy

Reset the raidmonitor 'last known good configuration' after raid repairs are complete:

raidmonitor -iv

You may even need to run this command again after a reboot, if ALERT! messages resume.

Alert messages are sent to " This e-mail address is being protected from spambots. You need JavaScript enabled to view it ", which is an alias (Pseudonym) that can be redirected in the Server-Manager.

Reconstruction - Basic Steps - Same Disk or Partition

  • Check the array configuration
    • cat /proc/mdstat
  • Verify the details of the failed volume
    • mdadm --detail /dev/mdx
  • Remove the failed partition
    • mdadm --remove /dev/mdx /dev/sdxy
  • Add the same partition as a hot spare
    • mdadm --add /dev/mdx /dev/sdxy
  • Watch the automatic reconstruction begin
    • cat /proc/mdstat

Reconstruction - Basic Steps - Disk Replaced

  • Power down the system
  • Replace the failed disk
  • Power up the system once again.
  • Use "mdadm /dev/mdx -a /dev/sdxx" to re-insert the disk partition in the array
  • Watch the automatic reconstruction running

Disk Repair

This command will scan your disk and, optionally, mark off the bad blocks on it.

badblocks -vf /dev/hdX     # test only
badblocks -wvf /dev/hdX    # write test and remap bad blocks

Only run this on unmounted disks. It takes a LONG time to run.

Speed Up RAID1 Resync

Just echo large numbers into both min and max resync speed proc entries: /proc/sys/dev/raid/spped_limit_max and speed_limit_min

As root do:

echo 500000 > /proc/sys/dev/raid/speed_limit_max
echo 500000 > /proc/sys/dev/raid/speed_limit_min

The above will set both speed limits to 500MiB/s which ought to be more than your devices can do...

Remove Arrays

As root do:

  • Determine which array (md0, md1, etc..) using fdisk -l
  • Make sure the array to be deleted is unmounted using umount /dev/mdX
  • Query your arrays to find out what disks are contained using mdadm --detail /dev/mdX
  • Shut down the array using mdadm --stop /dev/mdX
  • Zero the superblock for each partition in the array using mdadm --zero-superblock /dev/sdXY
Last Updated on Monday, 09 November 2009 12:34  

Your external IP

You are connecting to this site from: 38.107.179.232

Secure Client Login

Email Address:

Password: