15 ms·
Is there any hope to save the system during a system reboot? I guess I would need to recreate the kernel binary from RAM memory.
by dsamarin 7y ago
Is there any hope to save the system during a system reboot? I guess I would need to recreate the kernel binary from RAM memory.
- s-macke 7y agoIn this emulator the kernel is not stored in the filesystem. It is downloaded separately and put into memory. But usually the kernel is at a fixed location in physical memory. So you might be able to receive the kernel image from /dev/mem. But, as far as I know the init routines memory is freed after boot. So I guess crucial information is lost forever.
- Doxin 7y agoAh but couldn't you, once you've gotten your essential tools back to a working state, get the missing kernel bits from the internet before you reboot? It'd be an interesting challenge. Get a linux vm, sudo rm -rf everything, and then see if you can get the system back to more or less the original state.
- cipherboy 7y agoWouldn't the easier path be to rewrite the filesystem table to undo the deletions? You'd need to be very careful to only write necessary tools into memory, but since deleting files typically only changes the filesystem table and doesn't remove the contents of the sectors, you might be able to get enough of a working system to reinstall what is left. I'd reach for photorec since I'm lazy, but you'd need to bootstrap it with glibc and a few other dependencies. Not sure how you'd mount the ramdisk though... just hexdump, less, and dd would be minimally sufficient, though much, much harder.
- s-macke 7y agoFor this emulator the filesystem is a RAM filesystem and fully managed in Javascript (virtio/9p filesystem as a device). No chance to recover.
- s-macke 7y agoYou are free to try it. I think it is possible. The shell has enough built in functions such as echo. One decade ago I read some blog article describing a possible way. First step is to set an alias 'alias ls="echo *"'.