?
Solved

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

Posted on 2011-09-04
5
Medium Priority
?
317 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
5 Comments
 
LVL 2

Accepted Solution

by:
xeltek earned 468 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 468 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 464 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

A new era in Cloud training has arrived.

A day that will go down in Cloud history.. But are you ready for it? Will you accept this Cloud challenge?

Question has a verified solution.

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

Linux users are sometimes dumbfounded by the severe lack of documentation on a topic. Sometimes, the documentation is copious, but other times, you end up with some obscure "it varies depending on your distribution" over and over when searching for …
In part one, we reviewed the prerequisites required for installing SQL Server vNext. In this part we will explore how to install Microsoft's SQL Server on Ubuntu 16.04.
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.
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.
Suggested Courses
Course of the Month8 days, 6 hours left to enroll

766 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