Jump to content United States-English
HP.com Home Products and Services Support and Drivers Solutions How to Buy
» Contact HP
More options
HP.com home
HP XC System Software : Administration Guide > Chapter 21 Servicing the HP XC System

Software RAID Disk Replacement

» 

Technical documentation

Complete book in PDF
» Feedback
Content starts here

 » Table of Contents

 » Glossary

 » Index

Replacing a RAID disk requires that you mark the partitions faulty, remove the partitions, remove the disk itself, and perform maintenance on the boot block.

Replacing a RAID Disk

Before you can replace a failed disk in a software RAID set, you must first mark each RAID partition as faulty and remove it.

Use the mdadm command with the -f option to mark the partition faulty, and use the -r option to remove it.

Two SATA disk drives, /dev/sda and /dev/sdb are shown in this example.

Follow these steps to replace the RAID disk:

  1. Examine the array.

    You can use the cat /proc/mdstat command or use the mdadm command to return useful information, as shown here:

    # cat /proc/mdstat
    Personalities : [raid0] [raid1]
    md2 : active raid0 sdb2[1] sda2[0]
          35128704 blocks 64k chunks
    
    md3 : active raid0 sdb3[1] sda3[0]
          22833664 blocks 64k chunks
    
    md1 : active raid1 sdb1[1] sda1[0]
          292608 blocks [2/2] [UU]
    
    unused devices: <none>
    
    # mdadm --examine /dev/sdb1
    /dev/sdb1:
              Magic : a82b4dfc
            Version : 00.90.00
               UUID : eead90a0:35c0bf46:0619b26b:2d745a4d
      Creation Time : date and time
         Raid Level : raid1
        Device Size : 292608 (285.75 MiB 299.63 MB)
       Raid Devices : 2
      Total Devices : 2
    Preferred Minor : 1
    
        Update Time : date and time
              State : clean
     Active Devices : 2
    Working Devices : 2
     Failed Devices : 0
      Spare Devices : 0
           Checksum : 2bb - expected 15abed0f
             Events : 0.10
    
    
          Number   Major   Minor   RaidDevice State
    this     1       8       17        1      active sync   /dev/sdb1
       0     0       8        1        0      active sync   /dev/sda1
       1     1       8       17        1      active sync   /dev/sdb1
  2. Determine what caused the error.

    NOTE: On the HP XC system, if a single partition fails, you must replace the whole disk with an identical one.
  3. Use the mdadm command to fail (that is, to mark as faulty) all the RAID partitions on the disk. The disk in this example has three partitions. Use the following commands to fail each partition:

    # mdadm /dev/md1 -f /dev/sdb1
    # mdadm /dev/md2 -f /dev/sdb2
    # mdadm /dev/md3 -f /dev/sdb3
  4. Use the mdadm command to remove each partition from the RAID array:

    # mdadm /dev/md1 -r /dev/sdb1
    # mdadm /dev/md2 -r /dev/sdb2
    # mdadm /dev/md3 -r /dev/sdb3
  5. Physically remove the old disk according to the manufacturer's instructions.

  6. Physically install the new disk according to the manufacturer's instructions.

  7. Partition the new disk.

  8. Add the new partitions back to their arrays:

    # mdadm /dev/md1 -a /dev/sdb1
    # mdadm /dev/md2 -a /dev/sdb2
    # mdadm /dev/md3 -a /dev/sdb3

    The new partition begins synchronizing with the existing corresponding partition automatically.

  9. Use the following two commands to update the mdadm configuration file, /etc/mdadm.conf, which the mdadm command uses to manage the RAID arrays. This file also enables you to generate a prototype file for the RAID array with the following command. Substitute the appropriate disk drive device name for your installation. For example, for an ITE drive, use /dev/hd*[0–9] in place of the disk parameter; for a SATA drive, use /dev/sd[a-i]* in place of the disk parameter.

    # echo 'DEVICE disk' > /etc/mdadm.conf
    # mdadm -detail -scan >> /etc/mdadm.conf
    NOTE: Examine such a prototype file carefully to ensure that it is correct before using it.
  10. Watch the array update progress with the following command:

    # cat /proc/mdstat 

Commands for single array can be combined, for example:

# mdadm /dev/md1 -f /dev/hda1 -r /dev/hda1

The fdisk(8), sfdisk(8), and parted(8) manpages provide information on examining a disk and partitioning a new disk.

For more information about Software RAID implemented on the HP XC system, see Chapter 18.

Writing a Boot Block to the RAID Disk

To ensure that the disk can be booted, and because the whole disk was replaced, you must write a boot block to the new disk. The method to use varies by the platform.

For CP6000 Systems

Follow these steps for CP6000 systems:

  1. Use the systemconfigurator command as follows:

    # /usr/bin/systemconfigurator -runboot -stdin <<EOF
    [BOOT]
    BOOTDEV = disk1
    BOOTDEV2 = disk2
    EOF
    NOTE: Be sure to use the appropriate disk drive device name for the disk1 and disk2 parameters. For example, for IDE disks, the values could be /dev/hda and /dev/hdb, respectively.
  2. Adjust the boot order:

    # /tmp/post-install/50all.bootorder.pl
    NOTE: If this file was deleted from the client, you can find it on the head node in /var/lib/systemimager/post-install/50all.bootorder.pl file.

For CP4000 Systems

You need to update the boot order using the GRand Unified Bootloader, also known as grub.

Enter a command like the following. If you do not use IDE disks /dev/hda and /dev/hdb for your boot disk, you need to adjust this command.

# grub --no-floppy --no-curses <<EOF
root(hd0,0)
setup(hd0)
device(hd0)/dev/hdb
root(hd0,0)
setup(hd0)
EOF

In this example, the first instance of root and setup apply to the first disk; /dev/hda and the second instance of root and setup apply to the second disk, /dev/hdb.

Printable version
Privacy statement Using this site means you accept its terms Feedback to webmaster
© 2003 Hewlett-Packard Development Company, L.P.