Restoring a Deleted libc.a System Library
Contents
About this document
Recovering a deleted symbolic link in /usr/lib
Recovering a deleted /usr/ccs/lib/libc.a system library
file
This procedure documents how to recover the libc.a system library
if the link in /usr/lib or file in /usr/ccs/lib has been
accidentally removed. This document applies to AIX Versions 4.x.
If the symbolic link from /usr/lib/libc.a to /usr/ccs/lib/libc.a
has been removed and a system shell prompt exists, the following steps can
be used to recover the symbolic link.
- Set the environment variable LIBPATH to point to the
/usr/ccs/lib directory. Enter:
LIBPATH=/usr/ccs/lib:/usr/lib
export LIBPATH
- You should be able to execute system commands at this point. Run
the following command to re-link /usr/lib/libc.a to
/usr/ccs/lib/libc.a.
ln -s /usr/ccs/lib/libc.a /usr/lib/libc.a
- Unset the LIBPATH environment variable. At this point, commands
should run as before. Enter:
unset LIBPATH
If you don't have a shell accessible to execute this command, follow the
instructions in the next section.
To recover from a deleted /usr/ccs/lib/libc.a system file, the system
must be booted off of external media, since no commands can run
in the machine's current state.
The machine should be booted from a CD-ROM or NON_AUTOINSTALL mksysb
tape of the same operating system level as the system. See the document "Booting
in Service Mode" if there are any questions about booting your particular
machine into Service mode. Access the rootvg volume
group without mounting the file systems. Use a recent mksysb of the
system to retrieve the libc.a file. Afterward, proceed through the
following steps.
- Execute the following sequence of commands.
mount /dev/hd4 /mnt
mount /dev/hd2 /mnt/usr
cd /mnt
- If the symbolic link from /usr/lib/libc.a to /usr/ccs/lib/libc.a
needs to be restored, run the following command and skip to
step 5.
ln -s /usr/ccs/lib/libc.a /mnt/usr/lib/libc.a
- Insert the mksysb tape in the tape drive and issue the following
commands.
Replace X with the appropriate number for the tape drive device.
First you will need to set the block size of the tape drive. By default,
the device driver in Maintenance mode will be set to a block size 512.
- tctl -f /dev/rmtX rewind
- tctl -f /dev/rmtX.Y fsf 1
- restbyname -xvqf /dev/rmtX.Y ./tapeblksz
- cat tapeblksz
- If the value from step d is not equal to 512, execute:
/etc/methods
/chggen -l rmtX -a block_size=[value from d]
- tctl -f /dev/rmtX rewind
- tctl -f /dev/rmtX.1 fsf 3
- Now use the restbyname command to restore the missing file.
Replace X with the appropriate number for the tape drive device.
- Execute tctl -f /dev/rmtX rewind
- Execute tctl -f /dev/rmtX.1 fsf 3
- IF YOU NEED TO RESTORE /usr/ccs/lib/libc.a, execute:
restbyname -xvqf/dev/rmtX.Y ./usr/ccs/lib/libc.a
- IF YOU NEED TO RESTORE THE /usr/ccs/lib DIRECTORY,
execute:
restbyname -xvqf/dev/rmtX.Y ./usr/ccs/lib
- IF YOU NEED TO RESTORE THE /usr/ccs/bin DIRECTORY,
execute:
restbyname -xvqf/dev/rmtX.Y ./usr/ccs/bin
- Flush the data to disk. Enter:
cd /mnt/usr/sbin
./sync;./sync;./sync
- Unmount the /usr file system. Enter:
cd /
umount /dev/hd2
If that commands fails, turn the key to Normal mode, if applicable,
and reboot.
- Unmount the / (root) file system. Enter:
umount /dev/hd4
If that commands fails, turn the key to Normal mode, if applicable,
and reboot.
- Boot the system in Normal mode. Turn the key to Normal position,
if applicable, and power cycle the machine.
[ Doc Ref: 91132263813142 Publish Date: Feb. 05, 2001 4FAX Ref: 2158 ]