"Rick Rolling" Your Hard Drive

Written by Mark Sanborn: May 29, 2008

If you remember back to my article about dd you will remember that it is a very powerful utility for writing to hard drives. In this post we are going to use it to “rick roll” the hard drive. I will show you two different “rick rolling” methods as well as describe what a “rick roll” is.

What is Rick Rolling?

From Wikipedia:

Rickrolling is a prank and Internet meme involving the music video for the 1987 Rick Astley song “Never Gonna Give You Up”. The meme is a classic bait and switch: a person provides a Web link they claim is relevant to the topic at hand, but the link actually takes the user to the Astley video.

In our sense of the meaning we are going to make our “deleted” data on our hard drives appear as if it was the Rick Astley video. Anyone attempting to retrieve removed data will be surprised to find a weird guy video of a guy singing a catchy tune from the 80s.

Why rick roll your hard drive?

Well, there are multiple reasons to rick roll the drive. These reasons range anywhere from, because its funny, to actually serve a legitimate reason. If you have been paying attention to the news lately you will remember that a US court ruled that border agents can search your laptop, or any other electronic device, when you’re entering the country. No, this doesn’t mean they want you to take it out of the bag and run it through the metal detector. The courts have ruled that the laptop’s contents can be downloaded and stored.

You should know by now that when you hit the delete button you are not actually removing any data. Hard drives don’t have any mechanism to actually remove or destroy deleted contents. They only know how to allocate space. If you delete a large block of data on a hard drive the hard drive will remain in pretty much the exact state it was in before you deleted the block. The only difference is that the hard drive knows now that it has permission to write over top of the data in that block. Of course if you don’t write any data for a long time that data will be there indefinitely.

Thus, removed/deleted data can be seen by anyone that has access to your computer!

So what are we to do? Lets Rick Roll it!

Rick rolling the empty space

There are two ways to rick roll your hard drive. The first is rick rolling the empty space. You will want to choose this option if you want to keep what you have on your hard drive but destroy any data that you have deleted.

Effectively what we are going to do here is write over any unused blocks of data with a lovely Rick Astley video. Any data that was once recoverable will be gone and the lucky person that has the job of looking at your data will get “rick rolled”.

In order to write over the empty space of your hard drive with Rick Astley you will need to actually go and download the video from Youtube.

If you are using a Linux/FreeBSD machine you can use wget.

If you are using Windows you should probably just use one of those free online youtube downloading sites.

We are going to use a lovely utility called, dd. It usually comes with all Linux distros and FreeBSD. Windows users will have to download it. This utility is great at reading and writing data, securely wiping files, duplicating CDs, and Making Backup Images of your Hard Drives, but it doesn’t have a way to loop an input file. For this reason we need to create a small script that will do the looping for us.

First create a text file with your favorite editor:

vim rickrollscript.sh

Copy and paste the following code in the text file:

#!/bin/bash x=1 while [ $x = 1 ] do dd if=rickroll.flv >> deleteMeLater.tmp done

In order for a shell script to run, it must be executable:

chmod +x rickrollscript.sh

Now all you have to do is run it. This script can be ran from a regular user account:

sh rickrollscript.sh

Depending on the size and speed of the hard drive it may take a little while to fill it up. You will know when it is done when you are greeted with something like this:

dd: stdout: No space left on device

When you notice this message you can hit ctrl + c to end the loop.

What this script has done is created a file that is as large as the empty space on your hard drive and filled it with the Rick Astley video. To tell our hard drive that we want that space back we simply delete the file that says, deleteMeLater.tmp. Once this is done you will have all your hard drive space back again but this time the underlying data is that of the great Rick Astley instead of the data you have deleted in the past.

Rick rolling the entire drive (destroying all data)

nbsp; If you wish to destroy ALL the data on the drive you will need to boot into a live CD or boot up from a hard drive other than the one you are rick rolling.

First run this command. Making sure to replace hda with the hard drive you want to roll:

dd if=/dev/urandom of=/dev/hda

Then repeat the steps you would use in rolling the empty hard drive space.

Conclusion

Rick rolling the hard drive is an interesting way to destroying removed data but probably not the easiest method. For example if you wanted a quick way of destroying the empty space you could use:

dd if=/dev/urandom of=deleteMe.tmp bs=100000000 count=1000000000

This will overwrite all the empty space with random data. Although this method is a little bit easier and a little more secure, it is not as fun.

Need to print shipping labels on your site?

Checkout my product RocketShipIt for simple easy-to-use developer tools for UPS™ FedEx™ USPS™ and more.

Share: