[GTALUG] How much do you know about how linux executes binaries?

Lennart Sorensen lsorense at csclub.uwaterloo.ca
Wed Dec 11 12:27:38 EST 2019


Someone at work just made a slight mistake:

root at ECA:~# cd /var
root at ECA:/var# mv core.* /*   [clearly that trailing * was not meant to be there]
[bunch of errors about target already existing]
root at ECA:/var# ls
-bash: /bin/ls: No such file or directory
root at ECA:/var#

So what do you do now?

I was able to fix it in about 5 minutes without using anything other
than what was on the running system?  Interesting little problem.

The original state of the system was:

root at ECA:/var# ls -l /
drwxr-xr-x    2 root     root          4096 Dec  9 11:47 bin
drwxr-xr-x    2 root     root          4096 Dec  6 11:16 boot
drwxr-xr-x   10 root     root          2340 Dec  6 11:18 dev
drwxr-xr-x   46 root     root          4096 Dec  9 11:48 etc
drwxr-xr-x    6 root     root          4096 Dec  5 12:09 home
lrwxrwxrwx    1 root     root            10 Dec  5 12:09 init -> /sbin/init
drwxr-xr-x    4 root     root          4096 Dec  5 12:09 lib
drwxr-xr-x    5 root     root          4096 Dec  5 12:09 lib64
drwx------    2 root     root          4096 Dec  5 12:09 lost+found
drwxr-xr-x    2 root     root          4096 Nov 19 10:07 media
drwxr-xr-x    4 root     root          4096 Dec  5 12:09 mnt
drwxrwxrwx    6 root     root          4096 Dec  5 12:24 opt
drwxr-xr-x    3 root     root          4096 Dec  5 12:09 persistdata
drwxr-xr-x    5 root     root          4096 May 25  2018 persistent
dr-xr-xr-x  473 root     root             0 Dec  6 11:17 proc
drwxr-xr-x    5 root     root          4096 Dec  9 11:38 root
drwxr-xr-x   12 root     root           780 Dec  6 11:18 run
drwxr-xr-x    2 root     root          4096 Dec  9 11:47 sbin
dr-xr-xr-x   11 root     root             0 Dec  6 11:17 sys
drwxrwxrwt    8 root     root           400 Dec 11 12:14 tmp
drwxr-xr-x   12 root     root          4096 Dec  5 12:09 usr
drwxr-xr-x   15 root     root          4096 Dec  5 12:15 var

-- 
Len Sorensen


More information about the talk mailing list