Yay, destruction!
June 27, 2007
Ever wonder what would happen if you took a running system, and suddenly removed everything from under its feet? I just did that. I wiped /dev/hda, while the system was running inside LVM logical volumes that were using that drive. And yes, it was intentional, I was wiping a disk before giving it back to someone.
The result, in the words of Jflesch, is a system that witnesses and comes to terms with its own death.
# ps ax
ps: /lib/libproc-3.2.7.so: unsupported version of Verdef record
ps: error while loading shared libraries: /lib/libproc-3.2.7.so:
unsupported version of Verneed record
# dd
Segmentation fault
# cat
bash: /bin/cat: cannot execute binary file
# man
Segmentation fault
# halt
bash: halt: command not found
# /sbin/halt
bash: /sbin/halt: Unknown error 990
# ls
ls: reading directory .Illegal instruction
# mount
Segmentation fault
#
I like how linux still half believes it can do anything, thanks to the disk cache pages in ram and the cached FS structures. I’m also a little surprised, as I’d have expected the VFS to kernel panic very quickly upon discovering that it had been obliterated. But linux refused to crash, despite userspace’s great unhappiness. That was kinda cool.