• No results found

Replacing a failed root disk

To replace a failed root disk

1

Use thevxplexcommand to remove the plex records that were on the failed disk:

# vxplex -g bootdg -o rm dis rootvol-01 swapvol-01

This example removes the plexesrootvol-01, andswapvol-01that are

configured on the mirror disk. You may need to modify the list of plexes according to your system configuration.

2

Shut down the system, and then power it down.

3

Replace the failed disk with a disk of the same or larger capacity.

4

Power up the system, and boot it from Linux installation CD number 1.

5

On a Red Hat system, run the following command at the boot prompt to put the system in rescue mode:

boot: linux rescue

On a SUSE system, choose the Rescue option from the menu.

Log in asroot, select your language and keyboard, and choose to skip finding

your installation.

6

Use thefdiskcommand to ensure that the root mirror disk (sdb) and the

replacement root disk (sda) have the same geometry: # fdisk -l /dev/sdb

# fdisk -l /dev/sda

See thefdisk(8) manual page.

Recovering from boot disk failure VxVM boot disk recovery 50

7

If the replacement disk already contains a VxVM private region, use thefdisk

command to change the partition type for the private region partition to a value other than7f.

# fdisk /dev/sda

8

Make a temporary mount point,/vxvm, and mount therootpartition on it:

# mkdir /vxvm

# mount -t ext3 /dev/sdb1 /vxvm

In this example, the mirror of therootpartition is/dev/sdb1, and theroot

file system type isext3. You may need to modify this command according to

your system configuration. For example, therootfile system may be

configured as areiserfsfile system.

9

If the disk has a separatebootpartition, mount this on/vxvm/boot: # mount -t ext3 /dev/sdb2 /vxvm/boot

In this example, the mirror of thebootpartition is/dev/sdb2, and theboot

file system type isext3. You may need to modify this command according to

your system configuration.

51 Recovering from boot disk failure

10

Install the master boot record (MBR) on the replacement disk (in this example,

sda).

For the GRUB boot loader:

Create a backup copy of the GRUB configuration file

(/vxvm/boot/grub/menu.lstor/vxvm/etc/grub.confas appropriate), for

example:

# cp /vxvm/etc/grub.conf /vxvm/etc/grub.conf.b4repldisk

Run thesynccommand: # sync

In the configuration file, change all occurrences ofsdatosdb, except for the boot=statement.

In the configuration file, change all occurrences ofhd0tohd1. After saving your changes to the configuration file, run the following commands to install the boot loader:

# /vxvm/sbin/grub grub> root (hd1,1) grub> setup (hd0) grub> quit

For the LILO boot loader:

Create a backup copy of the LILO configuration file, for example:

# cp /vxvm/etc/lilo.conf /vxvm/etc/lilo.conf.b4repldisk

Run thesynccommand: # sync

In the configuration file, change all occurrences ofsdatosdb, except for the boot=statement.

In the configuration file, add aroot=statement to the boot entries where this

is missing. This statement specifies the device that is to be mounted as root, for example,/dev/sdb1. The following example is for thevxvm_rootentry:

image=/boot/vmlinuz-2.4.21-4.ELsmp label=vxvm_root

initrd=/boot/VxVM_initrd.img root=/dev/sdb1

Recovering from boot disk failure VxVM boot disk recovery 52

After saving your changes to the configuration file, run the following command to install the boot loader:

# /vxvm/sbin/lilo -r /vxvm

11

Unmount the partitions, runsync, and then exit the rescue shell: # cd /

# umount /vxvm/boot # umount /vxvm # sync

# exit

12

Shut down and power cycle the system. Enter the system’s BIOS settings mode (this is usually achieved by pressing a key such asEsc,F2orF12on the

console keyboard). Verify in the BIOS settings that the system is set to boot from the new root disk (in this example,sdb). Otherwise the system may not

be bootable.

13

Reboot the system, selectingvxvm_rootat the GRUB or LILO boot prompt as

appropriate.

53 Recovering from boot disk failure

14

Run the following command to mirror the volumes from the root mirror disk onto the replacement disk:

# /etc/vx/bin/vxrootmir sda rootdisk

This example assumes that the disk media name of the replacement root disk issda. You may need to modify this name according to your system configuration.

15

Restore the contents of the boot loader configuration file, and recreate the original MBR on the root disk (in this example,sda).

For the GRUB boot loader:

Restore the original boot loader configuration file:

# mv /etc/grub.conf.b4repldisk /etc/grub.conf

Run thesynccommand: # sync

Run the following commands to recreate the boot loader:

# /sbin/grub

grub> root (hd0,1)

grub> setup --stage2=/boot/grub/stage2 (hd0) grub> quit

For the LILO boot loader:

Restore the original boot loader configuration file:

# mv /etc/lilo.conf.b4repldisk /etc/lilo.conf

Run thesynccommand:

# sync

Run the following command to recreate the boot loader:

# /sbin/lilo

Related documents