I am working on AIX 6.1 and inadvertently renamed /usr/lib/libc.a
to usr/lib/libc.a_
Just as I renamed I realized my stupid mistake. Almost all of the commands mv
, cp
, ftp
etc ( except cd
) have stopped working.
How shall I rename by libc.a
back. Without it, the system hardly functions sanely :(
Most of the binaries depend/use on the
libc
library. To find out, you can useldd /path/to/binary
It seems that you need to boot another image or live CD. Then, you can mount the relevant partition (/usr
if it is separated or/
) and rename the file.Just posting this in case someone else searches for this issue.
Since at least AIX 5.3 IBM has provided the recovery shell
recsh
just for this issue.Check IBM Documentation.
Example of use:
recsh; cp -p libc.a.new /usr/lib/libc.a; exit
I guess
ln
is out of question, too?Or Perl?
or
Try
while read -r x; do echo $x >> libc.a; done < libc.a_
(This assumes a Bourne style shell).If it fails and you are lucky enough that
ed
orsed
are statically linked try:sed libc.a_ > libc.a
or
also
dd if=libc.a_ of=libc.a
Boot from rescue disk, mount filesystem, do rename.