DD, DU and DF – The Three Linux Commands You Should Commit to Memory
techtudor.blogspot.com
techtudor.blogspot.com
This will wipe your disk entirely and there is no recovery possible, though some sysadmins are of the opinion that you should repeat the above at least three times to be absolutely sure!"
The secure erase ATA command is probably a better bet, between bad block management and over-provisioning there is too many places data can survive an OS level purge.
But if you really want to be sure, take the disc out of the case and smash it with a hammer, pretty difficult to recover data after that.
<insert rant about uefi and tpm>
it took me a bit to discover that ubuntu's initramfs has cpu microcode prepended to it. if you try to cpio the initramfs directly it will only take out the microcode, spitting out something like "44 blocks extracted".
if you want to cut out only some part of a file, you can do something like:
dd if=./file.ext out=./cutout.ext bs=<blocksize> skip=n count=m
this will skim nblocksize bytes and then pull out mblocksize bytes.in the case of an initramfs, you would just want to skip the initial microcode blocks. for me, it was:
dd if=/boot/initramfs.<ext> out=/tmp/initramfs.gz bs=512 skip=56
for the records, it turns out that ubuntu packs a lot of stuff in its initramfs, and playing with initramfs is quite a funny activity