How to wipe a drive with a message

This will work for Mac or Linux.

When a disk drive is formatted, the data on the disk is not actually erased; rather a new file system is added. A file system is a layer, an abstraction, a way to organise the 1’s and 0’s on the disk so that an operating system can make sense of the arrangement.

For example, and this system I just totally made up – one type of file system might say: read data in 64-bit chunks starting and bit (memory) position 1024, and every first 4 bits of each 64 bits is reserved for some signal. Suppose you do that and copy some data on the drive with this organisation. Then you change the files system to something else that has 128-bit chunks and 8 bits reserved at the start of each block, then your data becomes unreadable even though you haven’t changed it.

That’s formatting. It looks like you’re wiping the disk, but you’re not actually.

So what is wiping? Wiping would involve actually writing something over the data. Typically, that would be writing 0’s all over the drive in every position. Another way is to write random 0’s and 1’s. Another is to do random 0’s and 1’s, and then repeat the whole thing over and over again to reduce the risk of a sophisticated attacker accessing the old state of those 0’s and 1’s and extracting your old data.

I’m not interested in that right now and it’s not the topic of this piece. I’m interested in writing non-random data to the drive, for fun. It is also educational.

I’ll show you how to write any message you want with this example:

Craig Wright is a liar and a fraud

Step 1 – Find the dev name of your disk

It’s crucial not to mess this up or you could wipe the wrong disk.

Type this command in the terminal:

lsblk