Restoring a deleted system library file
This procedure to restore a deleted system library file requires system downtime. The system is booted and then the library is restored from a recent mksysb tape.
- Before your reboot, ensure the PROMPT field
in the bosinst.data file is set to
- Insert a recent mksysb tape into the tape drive.
The mksysb must contain the same OS and maintenance package or technology level as the installed system. If you restore a libc.a library from a mksysb that conflicts with the level on the installed system, you will not be able to issue commands.
- Reboot the machine.
- When the screen of icons appears, or when you hear a double beep, press the F1 key repeatedly until the System Management Services menu is displayed.
- Select Multiboot.
- Select Install From.
- Select the tape device that holds the mksysb and
then select Install. It can take several minutes before the next prompt appears.
- Define your current system as the system console by pressing the F1 key and press Enter.
- Select the number of your preferred language and press Enter.
- Select Start Maintenance Mode for System Recovery by typing 3 and press Enter.
- Select Access a Root Volume Group. A message displays explaining that you will not be able to return to the Installation menus without rebooting if you change the root volume group at this point.
- Type 0 and press Enter.
- Type the number of the appropriate volume group from the list and press Enter.
- Select Access this Volume Group by typing 2 and press Enter.
- Mount the / (root) and /usr file
systems by typing the following commands:
mount /dev/hd4 /mnt mount /dev/hd2 /mnt/usr cd /mnt
- To restore the symbolic link for the libc.a library,
if needed, type the following command:
ln -s /usr/ccs/lib/libc.a /mnt/usr/lib/libc.aAfter the command runs, do one of the following:
- If the command is successful, skip to step 20.
- If a message displays that the link already exists, continue with step 17.
- Set the block size of the tape drive
by issuing the following commands, where X is the
number of the appropriate tape drive.
tctl -f /dev/rmtX rewind tctl -f /dev/rmtX.1 fsf 1 restbyname -xvqf /dev/rmtX.1 ./tapeblksz cat tapeblkszIf the value from the cat tapeblksz command is not equal to 512, type the following commands, replacing Y with the value from the cat tapeblksz command:
ln -sf /mnt/usr/lib/methods /etc/methods /etc/methods/chgdevn -l rmtX -a block_size=YYou should receive a message that rmtX has been changed.
- Ensure the tape is at the correct location for restoring the library
by typing the following commands (where X is the
number of the appropriate tape drive):
tctl -f /dev/rmtX rewind tctl -f /dev/rmtX.1 fsf 3
- Restore the missing library using one of the following commands
(where X is the number of the appropriate tape drive):
- To restore the libc.a library only, type the following
restbyname -xvqf /dev/rmtX.1 ./usr/ccs/lib/libc.a
- To restore the /usr/ccs/lib directory, type the following
restbyname -xvqf /dev/rmtX.1 ./usr/ccs/lib
- To restore the /usr/ccs/bin directory, type the following
restbyname -xvqf /dev/rmtX.1 ./usr/ccs/bin
- To restore the libc.a library only, type the following command:
- Flush the data to disk by typing the following
cd /mnt/usr/sbin ./sync;./sync;./sync
- Unmount the /usr and / (root)
file systems by typing the following commands:
cd / umount /dev/hd2 umount /dev/hd4If either umount command fails, cycle power on this machine and begin this procedure again.
- Reboot the system by typing the following command:
After the system is rebooted, operating system commands should be available.