Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free.

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 followed this tutorial to disable encryption. At that time my D-drive ( a partition ) was mounted. Then according to tutorial I ran sudo rm -rf command it deleted all my mounted drive data also. How can I recover all my data? I have just copied my important files to that drive from ubuntu before deleting my home folder.

I have ubuntu 14.04 installed alongside windows in my d-drive.

[EDIT] Now as D-drive is cleared (and ubuntu was installed on that drive) i am getting boot error as file: boot\BCD and can't boot even in windows. Now i dont need my D-drive data just boot to windows

share|improve this question
you can't recover it, it's all gone. – Alvar May 19 '14 at 18:00
Well it's the truth. Also don't run random commands that you don't understand... – Alvar May 19 '14 at 18:02
there was 150 GB data in that drive please tell me some way – Shadaf May 19 '14 at 18:03
Probably all lost; your last hope is using something like the tools explained here…; otherwise, this:… --- but the problem is that doing rm -rf is a much more distructive action then a simple format of the disk. Sorry. Another option, if the disk is in some MS-format (VFAT, NTFS) is to try some recovery program from Windows (off topic here) – Rmano May 19 '14 at 19:32

It may be possibe but it is a massive pain in the rear: An article from Stack Exchange


sudo rm -rf /

tells the machine to remove any and all files and directories down stream of the root of the drive.

rm -rf ~/

would have only removed your home directory and all files in it.

For better or worse, *nix like operating systems (Ubuntu being one) assume that if you are in the terminal and you elevate to root privilages (sudo), that you know the risks. ALWAYS beware sudo commands and be even more careful about running as root (su or #). If you are not sure what a sudo command does, research it first.

Wish I could be more help. Good luck recovering your files.

share|improve this answer

Your Answer


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.