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.

  1. Before your reboot, ensure the PROMPT field in the bosinst.data file is set to yes.
  2. 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.
  3. Reboot the machine.
  4. 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.
  5. Select Multiboot.
  6. Select Install From.
  7. Select the tape device that holds the mksysb and then select Install.
    It can take several minutes before the next prompt appears.
  8. Define your current system as the system console by pressing the F1 key and press Enter.
  9. Select the number of your preferred language and press Enter.
  10. Select Start Maintenance Mode for System Recovery by typing 3 and press Enter.
  11. 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.
  12. Type 0 and press Enter.
  13. Type the number of the appropriate volume group from the list and press Enter.
  14. Select Access this Volume Group by typing 2 and press Enter.
  15. Mount the / (root) and /usr file systems by typing the following commands:
    mount /dev/hd4 /mnt
    mount /dev/hd2 /mnt/usr
    cd /mnt
  16. 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.a
    After 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.
  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 tapeblksz
    If 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=Y
    You should receive a message that rmtX has been changed.
  18. 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
  19. 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 command:
      restbyname -xvqf /dev/rmtX.1 ./usr/ccs/lib/libc.a
    • To restore the /usr/ccs/lib directory, type the following command:
      restbyname -xvqf /dev/rmtX.1 ./usr/ccs/lib
    • To restore the /usr/ccs/bin directory, type the following command:
      restbyname -xvqf /dev/rmtX.1 ./usr/ccs/bin
  20. Flush the data to disk by typing the following commands:
    cd /mnt/usr/sbin
    ./sync;./sync;./sync
  21. Unmount the /usr and / (root) file systems by typing the following commands:
    cd /
    umount /dev/hd2
    umount /dev/hd4
    If either umount command fails, cycle power on this machine and begin this procedure again.
  22. Reboot the system by typing the following command:
    reboot

After the system is rebooted, operating system commands should be available.