Rescuing Linux: Difference between revisions
No edit summary |
|||
| Line 40: | Line 40: | ||
==access sans password== | ==access sans password== | ||
==all my binaries are gone== | |||
The situation can arise that one has an active process context (we'll assume a shell) on a machine where the standard POSIX binaries are unavailable. This can happen due to e.g. a network error, a disk error, memory error, wayward <tt>rm -rf /</tt>, misadventures in package management. What can be done in such a case? | |||
===display a file without cat=== | |||
The bash shell's <tt>echo</tt> or <tt>printf</tt> builtin can be used: | |||
<pre> | |||
[freebird](0) $ dmesg | |||
-bash: /usr/bin/dmesg: Input/output error | |||
[freebird](126) $ printf "%s" "$(</proc/kmsg)" | |||
..... | |||
[freebird](0) $ echo "$(</proc/kmsg)" | |||
..... | |||
[freebird](0) $ | |||
</pre> | |||
==External links== | ==External links== | ||
* Debian wiki page for [https://wiki.debian.org/initramfs initramfs] | * Debian wiki page for [https://wiki.debian.org/initramfs initramfs] | ||
* Kernel documentation for [https://www.kernel.org/doc/html/latest/filesystems/ramfs-rootfs-initramfs.html Ramfs, Rootfs, and Initramfs] | * Kernel documentation for [https://www.kernel.org/doc/html/latest/filesystems/ramfs-rootfs-initramfs.html Ramfs, Rootfs, and Initramfs] | ||