Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I ran sudo rm -rf / to wipe out all data, for some reason the execution got interrupted. Now I am left with a shell that only has cd command!!! (ls, sudo, rm, etc got deleted!)

What should I do to continue the deletion????


share|improve this question
format the drive :) – sealz Aug 29 '13 at 18:36
Erm, how? (I no longer have the OS disk) – One Two Three Aug 29 '13 at 18:36
What dist are you using? There are ways to format a drive without a disk. Hook it up to another machine, etc. – sealz Aug 29 '13 at 18:37
ubuntu 13.0.4 (and half of the stuff has been gone due to the rm command. Now the ONLY command that is still there is cd) – One Two Three Aug 29 '13 at 18:37 – sealz Aug 29 '13 at 18:38
up vote 3 down vote accepted

Never, ever run rm / on a working system. What were you thinking? Of course you don't have anything left, the only things remaining are commands like cd that are not separate binaries but inbuilt commands of your shell (bash probably).

I assume you wanted to clear out the drive in order to install or reinstall an operating system. If so, just shutdown and install as you would normally. You will be asked to format the drive and I recommend you do so.

If you thought you were deleting something other than your main OS dirve (the equivallent of C: in Windows), I am afraid you were wrong and have completely borked your system. Whatever your original aim, you will need to reinstall.

For future reference it is never a good idea to wipe a drive that contains the OS you are currently running. Next time, if you want to completely clear out the partition that contains your OS, boot into a live CD or another OS and format it from there.

share|improve this answer
I wanted to wipe out the data completely – One Two Three Aug 29 '13 at 19:22
And I don't care if the OS got deleted. ... I just needed the data to be gone (so I can take the machine out of the building). – One Two Three Aug 29 '13 at 19:24
@OneTwoThree that's what formatting is for. In fact, it is a much better way of wiping than simple deletion which simply unlinks the file. Neither are 100% secure though, if that is what you want look into ways of overwriting every sector of the drive with random data. In any case, never do this to a running system. – terdon Aug 29 '13 at 19:25

Get Darik's Boot And Nuke, burn it to a CD, boot that CD and properly delete the contents of your drive.

You can also put DBAN on a USB drive if that makes it easier.

share|improve this answer

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .