Solved

How can I recover files from a corrupt Linux (Ubuntu) install?

Posted on 2011-09-04
5
282 Views
Last Modified: 2012-12-29
Hi,
I have a 10.x Ubuntu partition, and when I tried to upgrade to the newest version, the install became corrupt - it will still boot into Ubuntu but the Desktop doesn't load and it does not seem like I can do anything.  So I wanted to recover some files that were on that partition.  I tried booting from an Ubuntu CD, and was able to see the partition, but I can't get to my /home directory as I don't have permissions since I'm obviously not logged in as that user.  Is there any way I can get access to the files in the /home/<user>/ directory?  I suppose this is part of the good Linux security model, but right now it's making my life difficult ;)
Thanks!
0
Comment
Question by:scott4381
5 Comments
 
LVL 2

Accepted Solution

by:
xeltek earned 117 total points
ID: 36482243
Please provide more detailed message.
paste the log here, so we can help you more efficiently.
As far as I know it is impossible or very difficult to recover files that were already removed in linux/ext file system.

If the files are still there, and you want them to be copied somewhere else, following the steps to back up your files.
1. boot into ubuntu cd
2. open a terminal / console
3. get root right $sudo su (get root right)
   -- I am not sure about the actual password, but you need to acquire the root privilege.
   -- you can try 'ubuntu' as password.
4. create mount point #mkdir /tmp/usb
5. mount the partition #mount /dev/partition /tmp/usb
6. change directory to the folder #cd /tmp/usb/home/....
7. do what ever you what, to backup the files.
0
 
LVL 1

Author Comment

by:scott4381
ID: 36482340
Thanks, xeltek.  The files are still there, I just can't login to the Ubuntu installation to get to them.  Using your "sudo su" suggestion worked to get to the directory, but it seems that Ubuntu encrypted the files in that directory, so I believe I am out of luck anyway!   The README.txt file in that directory states "THIS DIRECTORY HAS BEEN UNMOUNTED TO PROTECT YOUR DATA.", and the only other file showing is "Access-Your-Private-Data.desktop".  If anyone has any suggestions on this, please let me know!  I found this helpful article but unfortunately I can't get the encryption key as I can't login to the original Ubuntu install!
http://www.theirishpenguin.com/2010/09/26/accessing-your-encrypted-home-directory-in-ubuntu/
0
 
LVL 88

Assisted Solution

by:rindi
rindi earned 117 total points
ID: 36482593
Below is a Link on Ubuntu and encrypted file-systems. As far as I could see there is also some info on how to access the data provided the keys are still OK and you know the passphrases. Also, when you install Ubuntu, it asks you whether you want to use encryption or not, if you don't need it you can say no there....:

https://help.ubuntu.com/community/EncryptedPrivateDirectory
0
 
LVL 4

Assisted Solution

by:undersky
undersky earned 116 total points
ID: 36482660
you can do this 2 different way

1. Into LiveCD:

1. sudo chroot ./u'r old partition
2. sudo su *username*
3. ecryptfs-mount-private
4. cd

(without parametres cd change directory on u'r own)

Second way same, but without chroot.. btw more longer, so use first xD
0
 
LVL 1

Author Closing Comment

by:scott4381
ID: 38729944
In the end nothing allowed me access to the files, however, these comments were quite helpful in understanding the Linux file system and commands.  Thanks all!
0

Featured Post

Microsoft Certification Exam 74-409

Veeam® is happy to provide the Microsoft community with a study guide prepared by MVP and MCT, Orin Thomas. This guide will take you through each of the exam objectives, helping you to prepare for and pass the examination.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

If you have a server on collocation with the super-fast CPU, that doesn't mean that you get it running at full power. Here is a preamble. When doing inventory of Linux servers, that I'm administering, I've found that some of them are running on l…
I. Introduction There's an interesting discussion going on now in an Experts Exchange Group — Attachments with no extension (http://www.experts-exchange.com/discussions/210281/Attachments-with-no-extension.html). This reminded me of questions tha…
Learn several ways to interact with files and get file information from the bash shell. ls lists the contents of a directory: Using the -a flag displays hidden files: Using the -l flag formats the output in a long list: The file command gives us mor…
Connecting to an Amazon Linux EC2 Instance from Windows Using PuTTY.

772 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question