|
|
The emergency recovery media consist of:
The emergecny recovery boot media and tapes are usually created right after you install your system, and do not need to be re-created unless you change your system configuration. Additional backups should be taken periodically, so that user and application data can be preserved.
The following topics describe:
To ensure that you always have a set of emergency recovery media and data backups, we strongly recommend that you:
If you install additional system or application software at a later time, create new emergency recovery boot media and tapes.
The length between backups is correlated to the amount of possible data loss. If you back up your system each day, you can only lose up to one day's data. If you only back up your system once a month, up to a month of data might be lost if your hardware fails.
The emergency recovery boot media contains a small, bootable image from which you can boot your system.
The emergency recovery tapes contain an image of critical filesystems.
By first booting your system with the emergency boot media and then restoring it from the emergency tapes, you restore all the system software and filesystems. that existed when you created the boot media.
Performing regular system backups ensures that data added to your system after the creation of the emergency recovery media can also be restored. Data created after the most recent backup may be lost if your hard disk fails.
The system owner can back up the entire system on a regular basis. Individual users without owner privileges can perform backups of their own directories.
To ensure that you back up not only data but also any extended file attributes (such as privileges and ACLs), use cpio.
See the cpio manual page for more information.
For instructions on creating an emergency recovery boot CD, see the emergency_disk(ADM) manual page. The following is an example of creating boot diskettes.
mymachine mymachine 22 June 2001 22 June 2001 Emergency Recovery Emergency Recovery Diskette 1 Diskette 2
If other users are listed, bring the system to single-user
mode with this command:
shutdown -y -g300 -i1
The -g300 flag in this command allows users 5 minutes (300 seconds) to close their files and log out. A broadcast message from root provides warnings that the system is coming down.
To determine which filesystems have enough space, enter:
/sbin/dfspace
For example, you might see:
/ : Disk space: 195.10 MB of 429.00 MB available (45.48%) /stand : Disk space: 5.82 MB of 9.99 MB available (58.28%) /home : Disk space: 238.86 MB of 479.00 MB available (49.87%) /tmp : Disk space: 7.98 MB of 8.00 MB available (99.85%) /var/tmp : Disk space: 9.99 MB of 8.99 MB available (90.00%)
In this example, only the root (/) and /home filesystems have enough space to be used in creating the emergency recovery media.
pathname is the filesystem you selected. diskette is the diskette drive where you will insert the diskette (either diskette1 or diskette2).
The following example creates an emergency recovery diskette on
the first diskette drive, using the /home filesystem as its
working directory:
/sbin/emergency_disk -d /home diskette1
Creating each emergency recovery disk takes about fifteen minutes.
Store the emergency recovery disks in a secure location.
After you create the emergency recovery diskettes, do one of the following:
Emergency recovery tapes allow you to restore your system and its data to the configuration stored on the media. To create emergency recovery tapes:
The number of tapes needed varies according to the size and configuration of your system.
If other users are listed, bring the system to single-user
mode with this command:
shutdown -y -g300 -i1
The -g300 flag in this command allows users 5 minutes (300 seconds) to close their files and log out. A broadcast message from root provides warnings that the system is coming down.
The -e option tells emergency_rec to back up the entire primary hard disk.
tape is the tape drive location of your inserted tape (ctape1 or ctape2).
tapesize is the size of the tape specified either as a number of 512-byte blocks or as a number with a suffix of k, M or G to indicate kilobytes, megabytes or gigabytes. For example, a tapesize of 512000 or 250M would indicate that the tape can hold 250MB of data. If the hard disk is larger than the capacity of a single tape, you are prompted to insert additional tapes as needed.
Wait for this command to finish processing and then go to Step 7.
Enter:
/sbin/emergency_rec tape
tape is the tape drive location of your inserted tape (ctape1 or ctape2).
The emergency_rec command (without the -e option) backs up:
To back up these filesystems and volumes, see ``After creating emergency recovery tapes''.
You are prompted to insert additional tapes as needed.
The following error messages may appear when you create emergency recovery tapes:
Cannot determine mountpoint for device <
device_name>
This message appears when a slice cannot be associated with a filesystem. This prevents the indicated slice from being backed up or restored.
Duplicate mountpoint <
mnt_pt> detected with device <
device_name>
This message appears when the determination of what filesystems the slices are associated with produces a duplicate. Common causes of this error include using old style device names (dev/dsk/1s1 instead of /dev/dsk/c0b0t1d0s1), or having entries commented out in /etc/vfstab. If you encounter this message, you must fix the problem before making the emergency recovery tape.
After you create the emergency recovery tapes, either:
Specifically, you need to back up:
The easiest way to do this is to make a full system backup. Then, you can begin a regular schedule of incremental backups. You must use the cpio(C) command to perform these backups if you want to retain privilege on the files you back up.
There are three phases to performing an emergency recovery with an encapsulated or mirrored root disk:
During the following process, use the vxprint(ADM) command to obtain information about the encapsulated root disk and the disk to which it is mirrored. In this example, an initial install was done with all additional filesystems created, and mirrored onto another disk. Your installation may differ, so you may have a different number of partitions on the root disk. This procedure is valid for recovering from a disaster where the primary and mirror disks both fail, and ODM was used only to encapsulate the root disk and mirror it. Information on any other ODM disks should be saved so that they may later be restored.
then edit /etc/conf/pack.d/vol/space.c, and change the two lines:
#define VOL_ROOTDEV_IS_VOLUME #define VOL_SWAPDEV_IS_VOLUMEto:
#undef VOL_ROOTDEV_IS_VOLUME #undef VOL_SWAPDEV_IS_VOLUME
then edit /etc/conf/init.d/kernel to move the ``swp1'' entry located just after the ``vol2'' entry to just below the ``vol1'' entry, and change the line from:
swp1::sysinit:/sbin/swap -a /dev/vx/dsk/swapvol > /dev/sysmsg 2>&1to:
swp1::sysinit:/sbin/swap -a /dev/swap > /dev/sysmsg 2>&1Change the initdefault entry from ``3'' to ``1'' to avoid having to quickly press the spacebar in Step 6.
then edit /etc/inittab in the same manner as you edited /etc/conf/init.d/kernel.
then edit /etc/vfstab, and make the following type of substitutions
on the non-commented lines:
Replace ``/dev/vx/[r]dsk/home'' with ``/dev/[r]dsk/c0b0t0d0s4''
Replace ``/dev/vx/[r]dsk/var'' with ``/dev/[r]dsk/c0b0t0d0sb''
Replace ``/dev/vx/[r]dsk/home2'' with ``/dev/[r]dsk/c0b0t0d0sc''
Replace ``/dev/vx/[r]dsk/tmp'' with ``/dev/[r]dsk/c0b0t0d0sd''
You should also comment out any other ODM-defined slices.
then edit /etc/swaptab, replacing ``/dev/vx/dsk/swapvol'' with ``/dev/swap''
where MAJOR and MINOR are the major and minor numbers displayed by the ls in the previous step.
If you changed the initdefault entry in Step 4, then you do not need to interrupt the reboot. If you did not change the initdefault entry, when you see the system logo appear, immediately press <Space> to enter the Bootstrap Command Processor. Enter the command initstate=1, followed by boot. This will cause the machine to boot into single-user mode.
For example:
vxplex att home home-02
vxplex att home2 home2-02
vxplex att rootvol rootvol-02
vxplex att standvol standvol-02
vxplex att swapvol swapvol-02
vxplex att tmp tmp-02
vxplex att var var-02
You should also remove the comments from other ODM-defined slices you previously commented out.
A message should be displayed indicating that the system is not sane.
Continue to the Emergency Recovery menu and perform the Restore Disk(s) process.
Edit the /tmp/vtoc file and change the line that is similar to this:
14 0xe 0x201 2048 2064384to:
14 0x0 0x0 0 0Then rewrite the VTOC:
Reboot using the init 6 command. When you see the system logo appear, immediately press <Space> to enter the Bootstrap Command Processor. Enter the command initstate=1, followed by ``boot''. This will cause the machine to boot into single-user mode. Ignore the vxconfigd errors.
If your system will not boot, your system software is corrupted beyond repair, or your hard disk has been reformatted or replaced, you can use your emergency recovery boot media, tapes, and incremental backups to restore your system.
Before attempting to restore the system, ensure that your motherboard, hard disks, memory, and peripherals are in good working order. Do so by running any hardware diagnostics included with your system by the manufacturer. While this recovery procedure restores all the system software, applications, and data on the recovery media to your hard disk, it does not ensure proper operation of the system hardware.
To recover the system:
The emergency recovery main menu provides options to start a limited command-line shell to restore data from emergency recovery tapes, to mount or unmount all filesystems (if data is accessible on the hard disk), and to reboot the system.
cat(C) | chroot(ADM) | cpio(C) | date(C) |
dd(ADM) | echo(C) | edvtoc(ADM) | fdisk(ADM) |
find(C) | fsck(ADM) | grep(C) | ksh(C) |
labelit(ADM) | ln(C) | ls(C) | mkdir(C) |
mkfs(C) | mount(ADM) | prtvtoc(ADM) | rm(C) |
stty(C) | vi(C) |
Use these commands to investigate and fix the problem. To exit the shell and return to the main menu, press <Esc>.
You may notice error messages similar to the following:
UX: initprivs: WARNING: File ``file'' fails validation: entry ignored UX: initprivs: WARNING: X entries ignored in ``/etc/security/tcb/privs''This is because the date stamp for the inode was changed during the restore process.
You can fix these errors after your system boots into multi-user mode,
by logging in as root and entering the following command:
/etc/security/tools/setpriv -x
For example, if you created backups using the cpio(C) command, use the same method to restore the archive.