Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

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

Posted on 2011-09-04
5
Medium Priority
?
326 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

Looking for the Wi-Fi vendor that's right for you?

We know how difficult it can be to evaluate Wi-Fi vendors, so we created this helpful Wi-Fi Buyer's Guide to help you find the Wi-Fi vendor that's right for your business! Download the guide and get started on our checklist today!

Question has a verified solution.

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

Introduction We as admins face situation where we need to redirect websites to another. This may be required as a part of an upgrade keeping the old URL but website should be served from new URL. This document would brief you on different ways ca…
​Being a Managed Services Provider (MSP) has presented you  with challenges in the past— and by meeting those challenges you’ve reaped the rewards of success.  In 2014, challenges and rewards remain; but as the Internet and business environment evol…
Connecting to an Amazon Linux EC2 Instance from Windows Using PuTTY.
How to Install VMware Tools in Red Hat Enterprise Linux 6.4 (RHEL 6.4) Step-by-Step Tutorial
Suggested Courses
Course of the Month10 days, 18 hours left to enroll

618 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