Solved

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

Posted on 2011-09-04
5
295 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

Master Your Team's Linux and Cloud Stack

Come see why top tech companies like Mailchimp and Media Temple use Linux Academy to build their employee training programs.

Question has a verified solution.

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

Using 'screen' for session sharing, The Simple Edition Step 1: user starts session with command: screen Step 2: other user (logged in with same user account) connects with command: screen -x Done. Both users are connected to the same CLI sessio…
The purpose of this article is to demonstrate how we can use conditional statements using Python.
Connecting to an Amazon Linux EC2 Instance from Windows Using PuTTY.
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.

840 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