To reinstall the system and recover the Veritas Volume Manager configuration, the following steps are required:
vxinstall
command.
See "Recovering the Veritas Volume Manager configuration" on page 39..
rootvol
, swapvol
, usr
, and other system volumes).
To prevent the loss of data on disks not involved in the reinstallation, involve only the root disk in the reinstallation procedure.
Several of the automatic options for installation access disks other than the root disk without requiring confirmation from the administrator. Disconnect all other disks containing volumes from the system prior to reinstalling the operating system.
Disconnecting the other disks ensures that they are unaffected by the reinstallation. For example, if the operating system was originally installed with a home
file system on the second disk, it can still be recoverable. Removing the second disk ensures that the home file system remains intact.
Once any failed or failing disks have been replaced and disks not involved with the reinstallation have been detached, reinstall the operating system as described in your operating system documentation. Install the operating system prior to installing VxVM.
Ensure that no disks other than the root disk are accessed in any way while the operating system installation is in progress. If anything is written on a disk other than the root disk, the Veritas Volume Manager configuration on that disk may be destroyed.
Note During reinstallation, you can change the system's host name (or host ID). It is recommended that you keep the existing host name, as this is assumed by the procedures in the following sections.
To reinstall Veritas Volume Manager
vxlicinst
command to install the Veritas Volume Manager license key.
Once the Veritas Volume Manager packages have been loaded, and you have installed the license for VxVM, recover the Veritas Volume Manager configuration.
To recover the Veritas Volume Manager configuration
/etc/vx/reconfig.d/state.d/install-db
.
# rm -rf /etc/vx/reconfig.d/state.d/install-db
vxconfigd
, in disabled mode using the following command:
vxconfigd
using the following command:
The configuration preserved on the disks not involved with the reinstallation has now been recovered. However, because the root disk has been reinstalled, it does not appear to VxVM as a VM disk. The configuration of the preserved disks does not include the root disk as part of the VxVM configuration.
If the root disk of your system and any other disks involved in the reinstallation were not under VxVM control at the time of failure and reinstallation, then the reconfiguration is complete at this point.
If the root disk (or another disk) was involved with the reinstallation, any volumes or mirrors on that disk (or other disks no longer attached to the system) are now inaccessible. If a volume had only one plex contained on a disk that was reinstalled, removed, or replaced, then the data in that volume is lost and must be restored from backup.
After reinstalling VxVM, you must clean up the system configuration.
To clean up the system configuration
Establish which VM disks have been removed or reinstalled using the following command:
This command displays a list of system disk devices and the status of these devices. For example, for a reinstalled system with three disks and a reinstalled root disk, the output of the vxdisk
list
command is similar to this:
hdisk1 simple - - online invalid
hdisk2 simple mydg01 mydg online
hdisk3 simple mydg02 mydg online
hdisk4 simple mydg03 mydg online
The display shows that the reinstalled root device, hdisk1
, is not associated with a VM disk and is marked with a status of online
invalid
. The disks mydg01
, mydg02
and mydg03
were not involved in the reinstallation, and are recognized by VxVM and associated with their devices (hdisk2
, hdisk3
and hdisk4
).
If other disks (with volumes or mirrors on them) had been removed or replaced during reinstallation, those disks would also have a disk device listed in an online invalid
state and a VM disk listed as not associated with a device.
# vxprint -sF "%vname" -e'sd_disk = "
disk"'
where disk is the name of a disk with a failed
status. Be sure to enclose the disk name in quotes in the command. Otherwise, the command returns an error message. The vxprint
command returns a list of volumes that have mirrors on the failed disk. Repeat this command for every disk with a failed
status.
where volume is the name of the volume to be examined. The vxprint
command displays the status of the volume, its plexes, and the portions of disks that make up those plexes.
For example, a volume named v01
with only one plex resides on the reinstalled disk named mydg01
. The vxprint -th v01
command produces the following output:
V NAME USETYPE KSTATE STATE LENGTH READPOL PREFPLEX
PL NAME VOLUME KSTATE STATE LENGTH LAYOUT NCOL/WID MODE
SD NAME PLEX DISK DISKOFFS LENGTH [COL/]OFF DEVICE MODE
v v01 fsgen DISABLED ACTIVE 24000 SELECT -
pl v01-01 v01 DISABLED NODEVICE 24000 CONCAT - RW
sd mydg01-06 v0101 mydg01 245759 24000 0 hdisk2 ENA
The only plex of the volume is shown in the line beginning with pl
. The STATE
field for the plex named v01-01
is NODEVICE
. The plex has space on a disk that has been replaced, removed, or reinstalled. The plex is no longer valid and must be removed.
v01-01
was the only plex of the volume, the volume contents are irrecoverable except by restoring the volume from a backup. The volume must also be removed. If a backup copy of the volume exists, you can restore the volume later. Keep a record of the volume name and its length, as you will need it for the backup procedure.
Remove irrecoverable volumes (such as v01)
using the following command:
v02
has one striped plex striped across three disks, one of which is the reinstalled disk mydg01
. The vxprint
-th
v02
command produces the following output:
V NAME USETYPE KSTATE STATE LENGTH READPOL PREFPLEX
PL NAME VOLUME KSTATE STATE LENGTH LAYOUT NCOL/WID MODE
SD NAME PLEX DISK DISKOFFS LENGTH [COL/]OFF DEVICE MODE
v v02 fsgen DISABLED ACTIVE 30720 SELECT v02-01
pl v02-01 v02 DISABLED NODEVICE 30720 STRIPE 3/128 RW
sd mydg02-02 v02-01 mydg01 424144 10240 0/0 hdisk3 ENA
sd mydg01-05 v02-01 mydg01 620544 10240 1/0 hdisk2 DIS
sd mydg03-01 v02-01 mydg03 620544 10240 2/0 hdisk4 ENA
The display shows three disks, across which the plex v02-01
is striped (the lines starting with sd
represent the stripes). One of the stripe areas is located on a failed disk. This disk is no longer valid, so the plex named v02-01
has a state of NODEVICE
. Since this is the only plex of the volume, the volume is invalid and must be removed. If a copy of v02
exists on the backup media, it can be restored later. Keep a record of the volume name and length of any volume you intend to restore from backup.
Remove invalid volumes (such as v02
) using the following command:
The output of the vxprint
-th
command for a volume with one plex on a failed disk (mydg01
) and another plex on a valid disk (mydg02
) is similar to the following:
V NAME USETYPE KSTATE STATE LENGTH READPOL PREFPLEX
PL NAME VOLUME KSTATE STATE LENGTH LAYOUT NCOL/WID MODE
SD NAME PLEX DISK DISKOFFS LENGTH [COL/]OFF DEVICE MODE
v v03 fsgen DISABLED ACTIVE 0720 SELECT -
pl v03-01 v03 DISABLED ACTIVE 30720 CONCAT - RW
sd mydg02-01 v03-01 mydg01 620544 30720 0 hdisk3 ENA
pl v03-02 v03 DISABLED NODEVICE 30720 CONCAT - RW
sd mydg01-04 v03-02 mydg03 262144 30720 0 hdisk2 DIS
This volume has two plexes, v03-01
and v03-02
. The first plex (v03-01
) does not use any space on the invalid disk, so it can still be used. The second plex (v03-02
) uses space on invalid disk mydg01
and has a state of NODEVICE. Plex v03-02
must be removed. However, the volume still has one valid plex containing valid data. If the volume needs to be mirrored, another plex can be added later. Note the name of the volume to create another plex later.
To remove an invalid plex, use the vxplex
command to dissociate and then remove the plex from the volume. For example, to dissociate and remove the plex v03-02
, use the following command:
vxdisk
list
command) must be removed from the configuration.
To remove the disk, use the vxdg
command. To remove the failed disk mydg01
, use the following command:
If the vxdg
command returns an error message, invalid mirrors exist.
Repeat step 1 through step 6 until all invalid volumes and mirrors are removed.
vxassist
command or the graphical user interface.
For example, to recreate the volumes v01
and v02
, use the following command:
Once the volumes are created, they can be restored from backup using normal backup/restore procedures.
v03
, use the following command:
Once you have restored the volumes and plexes lost during reinstallation, recovery is complete and your system is configured as it was prior to the failure.
vxrelocd
(this also starts the vxnotify
process).
To determine if hot-relocation has been started, use the following command to search for its entry in the process table: