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.
      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.
      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 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 OSLEVEL as the system. 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 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
      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.
       cd /mnt/usr/sbin
       ./sync;./sync;./sync
    - Unmount the /usr file system:
       cd /
       umount /dev/hd2
       If that commands fails, turn the key to Normal mode, if applicable,
       and reboot.
   
 -  Unmount the / file system:
       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.
 
  
Restoring a Deleted libc.a System Library: libc.a.fix.4x.krn ITEM: FAX
Dated: 99/01/08~00:00 Category: krn
This HTML file was generated 99/06/24~12:42:08
Comments or suggestions?
Contact us