Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

So this morning I turned on my laptop, and everything seemed to be going fine until I logged in. All my settings were gone, back to the default desktop, default programs and everything. I did an 'ls' on my home directory, and it was just a bunch of "ECRYPTFS" files. I have home directory encryption turned on, so I figured the decryption of my home directory failed for some reason.

Anyway, just to be careful, I booted into a live session on a usb drive, and used ecryptfs-mount-private to decrypt my home folder. That seemed to work fine. It looked like everything was there until I tried to cd into my music folder. Nothing there.

Anyway, I checked my disk usage, and it's the same as it was last night, so my (somewhat massive) music collection is definitely still there.

Then I did an ls on my home folder. This is what I saw:

http://i.imgur.com/lcqq3.png

It appears that all of the default folders that Ubuntu creates are duplicated within the same folder. I didn't know that was even possible.

When I cd into Music, it's empty, but there's another Music folder there, and I have no idea how to get to it. I'm not even sure my files are in there, because du -sh reports that both copies of the music folder are just 4.0k

However, if my music collection were actually gone, I should have a lot more free disk space.

Anyway, I have no idea what to do. It's not critical that I get anything back (all my important files are backed up on Dropbox, and it looks like most everything survived), but it would be nice to have my Music collection.

Anyway, help is much appreciated. Thanks!

share|improve this question
    
This may help: bugs.launchpad.net/ecryptfs/+bug/623708 –  arrange Sep 22 '11 at 18:20
    
Interesting. It looks like someone managed to recover the files in the duplicated folders. I'll post a write-up if I can get it to work. Thanks! Glad to know I'm not alone. –  Dane Larsen Sep 22 '11 at 18:28
add comment

1 Answer

I have had exactly the same thing. Twice. No idea why.

Thankfully, you can delete the duplicate files / folders. You can prove to yourself that they're all there by doing ls -a in your home directory from the command line.

When you boot up, and are at the login screen, press Ctrl+Alt+F1. Login at the command prompt.

Here's a little script in ruby that should fix the issue (you may need to do sudo apt-get install ruby first to install, then run the following file from your home directory):

      #!/usr/bin/env ruby
      all = `ls -a`.split("\n")
      some = all.uniq
      some.each { |a| idx = all.index(a); all[idx] = nil }
      all.compact.each { |dup| `mv "#{dup}" "duplicate00_#{dup}"`}

(Note: I haven't tested this. It should be reasonably safe though so long as you have no other filenames starting duplicate00. No guarantees though!) This will find all the duplicate filenames and rename the newer ones duplicate00_filename. You can then view the folders in Nautilus, move any files you wish to save, and then delete them safely. If it happens again, run the script but change the destination filename to duplicate01.. etc.

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.