Background:
I boot my machine up to memory with a squashfs image that gets removed once it is loaded. I decided to try writing to /dev/mem to see what would happen mainly because I would like to ensure the system is wiped and nobody could recover my data. The main purpose of this is when selling my inventory.
The machine I am testing on has 2 internal 2.5-in SATA drives with devices @ /dev/sda and /dev/sdb. Normally, when I connect my external drive, it shows up as /dev/sdc.
Process:
1. dd if=/dev/zero of=/dev/mem
2. shred /dev/mem
Both of above commands complained about writing to /dev/mem. However, it did let me write a little bit and wonder if it caused other issues.
For instance, I tried booting up today and my EFI entries for Gentoo were gone, but FreeBSD booted through the drive EFI entry.
Why did the system not auto discover the ESPs on both drives and attempt to boot either or at least show them as options?
This morning, to recover, I stuck in a USB thumbdrive and was able to boot to that, but then, what makes that work and not my external disk or the internal one?
Final Process:
1. rm -rf --no-preserve-root /
2. find /
/etc, /home were all empty, but /usr/bin /usr/sbin still had files and the system was mostly usable.
EDIT:
I revised the above post to make it clearer.



