Link to home
Start Free TrialLog in
Avatar of daryn
daryn

asked on

Moved the /lib directory on centos linux.. "bad ELF interpreter"... Nothing works.. any ideas anyone???

Afternoon all,

I have a moderately large problem on a remote server that I haven't got easy physical access to.

Due to working while moderately stressed and under pressure, I embaressingly made an utterly stupid and unforgiveable mistake.

I, for reasons best left unsaid, on a linux server, ran, more or less, the following commands:

cd /
mkdir archive
mv * archive/

This, of course, has resulted in every directory in the / directory being moved to /archive.

feel free to laugh now.. :)

I now have the enviable task of getting every directory in /archive back into / via the one remote shell that I have left open to me (can't open any more obviously).

examples of attempts:

[root@krynn bin]# ls
bash: /bin/ls: No such file or directory
[root@krynn bin]# /archive/bin/ls
bash: ./ls: /lib/ld-linux.so.2: bad ELF interpreter: No such file or directory

The same response is given for the commands mv, ln, chroot, cp.

I now place my sanity in your hands.. short of arriving physically at the server with a rescue disk and moving the directories back, is there any method that you can possibly think of to get those directories back  where they should be via the ssh session I have left open?

Thanks very much

Idiot.
ASKER CERTIFIED SOLUTION
Avatar of ravenpl
ravenpl
Flag of Poland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of daryn
daryn

ASKER

the second option saved my life, friend.

all is back and working now.

I am utterly in your debt. I had an inkling it might be something like that but I had no idea of the environment variable to use, nor to quote the " /archive/lib/ld-linux.so.2 ". Why did the second line work where the first did not, obviously due to the inclusion of the ld-linux.so.2?
ld-linux.so.2 is the linux loader for dynamic executables.
LD_LIBRARY_PATH says where the loader should search for next shared libraries(apart from defaults like /lib /usr/lib)
Avatar of daryn

ASKER

thanks very much