rm /*
should delete very little. There is no -r
flag in there that would recursively delete anything, and without it directories will not be deleted (and even if directories were deleted, only empty ones can be deleted). This answer is predicated on the assumption that you did not run rm -rf /*
.
The only files in the root filesystem of consequence may be the symlinks to the kernel and initrd (although on one Ubuntu system I'm looking at, they don't exist) or a /lib64
symlink on 64-bit systems.
The problem may just be that the /lib64 -> /lib
symlink has been deleted. That's pretty nasty though, as just about every program will rely on that symlink:
$ ldd /bin/bash
...
/lib64/ld-linux-x86-64.so.2 (0x00007f8946ab7000)
That ld-linux
is the dynamic loader, and if it is not available, you cannot run any dynamic executables. This will make it extremely difficult to log in, and you may not be able to at all.
One saviour may be busybox
. Run this to check:
$ ldd /bin/busybox
not a dynamic executable
In this case, busybox should be runnable, but the question is how can you run it?
If you have access to the boot loader prompt, you may be able to boot with init=/bin/static-sh
, where static-sh is a symlink to busybox
(check that /bin/static-sh
exists - it does on my system, but it's not standard Ubuntu. This bug suggests that is is available.)
Once you have a root shell, you can re-create the /lib64
symlink. You may need to first remount the root filesystem as read/write. busybox should have these tools built in, which you can run as follows:
# busybox mount -o remount,rw /
# busybox ln -s /lib /lib64
# /bin/bash
bash#
If bash works, the problem should be fixed.
-r
argument torm
or really just did the command you show. Does your hosting provider provide any way to access the disk images outside of that particular machine?