Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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????

Thanks

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
    
ubuntu.com/download/desktop –  sealz Aug 29 '13 at 18:38
show 3 more comments

2 Answers

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
add comment

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
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.