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 upgrade from ubuntu 11.04 to 11.10 during its beta stage, and everything was working great despite a couple error messages. But suddenly LightDM started acting up, when I would type my password to log in the screen would flash and bring me straight back to LightDM.

Then one day I booted to a message similar to "GNU grub version 1.99 ubuntu. Minimal BASH-like editing is supported. Type help for complete list."

I reasoned I messed things up, thus I took a live CD to simply copy all my files to an external hard drive so I could reinstall Ubuntu. But when I go to my root folder there is only boot/grub/etc.

I recall my home folder became encrypted by it's self prior to this error.

How can I get all my data back? Thats all I'm concerned about, not so much about reviving Ubuntu, I will simply reinstall it.


ubuntu@ubuntu:/$ sudo fdisk -l

Disk /dev/sda: 120.0 GB, 120034123776 bytes
255 heads, 63 sectors/track, 14593 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x000a1e49

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *           1       14465   116183040   83  Linux
/dev/sda2           14465       14594     1035265    5  Extended
/dev/sda5           14465       14594     1035264   82  Linux swap / Solaris

Disk /dev/sdb: 2021 MB, 2021654016 bytes
64 heads, 63 sectors/track, 979 cylinders
Units = cylinders of 4032 * 512 = 2064384 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00000000

   Device Boot      Start         End      Blocks   Id  System
/dev/sdb1   *           1         969     1953439+   c  W95 FAT32 (LBA)
share|improve this question
If I understand this correctly, you cannot get the data back, because it's encrypted? Meaning you can boot ubuntu live, but when you open the /home folder, the data is encrypted and you don't know how to decrypt it. Is this correct? – Richard Rodriguez Oct 26 '11 at 0:25
@RiMMER When I boot into a live CD, in the root of my hdd all that there is is a folder called boot. It goes like this: boot/grub/(a lot of sound files) – Dominic Jordan Hasford Oct 26 '11 at 0:44
Because root in live session is the root of the virtual live hdd, not your real hdd. Open nautilus, then open your real hdd and look into its root there. – Richard Rodriguez Oct 26 '11 at 0:45
@RiMMER yeah that's what I meant, when I go on my hdd it's only a boot/grub folder – Dominic Jordan Hasford Oct 26 '11 at 0:50
That seems like an interesting situation. Any chance you could boot up teamviewer and let me look at it? – Richard Rodriguez Oct 26 '11 at 0:51
up vote 3 down vote accepted

Backup Your Data before Trying Anything, this includes inserting the hard drive into a working pc and copying everything. Take no risks

Before trying any recovery methods try to get into a recovery console. Recovery Mode. Another option is Boot Repair Remember to backup. Accessing a root terminal or a recovery desktop session will be by far the easiest method.

These commands will work in recovery mode or in a live cd terminal

If home is missing it is likely not mounted. To mount it run these commands.

First find out which partition you need to mount

sudo fdisk -l

Fdisk output

This will list the available hard drive partitions on your computer. They will be in list /dev/sda1, /dev/sda2 etc. sda is for the first hard drive, sdb will be the second. If you hard drives are IDE it will list /dev/hda1, /dev/hda2 etc.

You will need to identify your home partition from this list, it should be easy using the size and filesystem type.

Now you can attempt to mount your partition with

sudo mount /dev/sda<Insert Your Partition Number Here> /mount/data

You have have to create the /mount/data directory. Navigate to the /mount/data directory and see if you can view your files.

If you cannot view your data it is encrypted and you will have to be use your encrypt paraphrase to decrypt it. Be warned - from the ecryptfs FAQ:

Q. I forgot my password/lost my key! What can I do to recover my data?

Nothing; you're screwed. (Apologies to Bruce Schneier).

If you have forgotten your passphrase, your only hope is that you chose a weak passphrase in the first place. There is an outside chance that you might be able to perform a successful dictionary attack to recover your passphrase. If you > manage to recover your passphrase that way, then you may as well have not been bothering to encrypt your data in the first place, since a malicious attacker could have done the exact same thing to recover your passphrase.

If you selected a strong passphrase or lost your key file, you are completely out of luck. Nobody can help you recover your data.

If you know your paraphrase you can save your data by first installing the ecruptfs utils

sudo apt-get install ecryptfs-utils

Then use the command to mount your data

mount -t ecryptfs -o key=passphrase:passphrase_passwd="<Your Paraphrase Here>" /mount/data /mount/decrypted

Again you may have to create the /mount/decrypted directory. If this succeeds and you entered the correct paraphrase your data will be readable in /mount/decrypted

share|improve this answer
I can't successfully create the /mount folder. Could you help me please? – Dominic Jordan Hasford Oct 26 '11 at 1:14
What exactly is the error? you may have to use sudo. – Ciaran Liedeman Oct 26 '11 at 1:28
OK so I created the directory, followed your instructions, but all it did was mount the /grub folder that was on my hdd there.If I check the properties of my HDD, it shows me that the 60GB of used disk space of my data is still there, yet I can't see it... In the root of my HDD all there is is a /boot folder. Thank you for your assistances by the way. – Dominic Jordan Hasford Oct 26 '11 at 2:17
Thank you Anarci for your help! It didn't do exactly as you described, but it worked. I went into my hard drives root where there was only a boot folder. Then I went to boot/grub and pressed ctrl+h to show the hidden files, and there was a folder called trash! In there, all my previous files were all about. I copied the important data and now I can finally try Ubuntu 11.10 and Gnome Shell. Thank you all for your help! – Dominic Jordan Hasford Oct 26 '11 at 4:06

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.