Results 1 to 7 of 7

Thread: Data loss after 12.04 installation

  1. #1
    Join Date
    Jun 2013
    Beans
    2

    Data loss after 12.04 installation

    I'm not a great expert in Ubuntu but here's my predicament: A few weeks ago my old version of Ubuntu (can't remember which version) with encrypted home folder informed me that it was officially no longer supported and I should upgrade. I started the process which failed half way (stalled indefinitely). After resetting all I could get was a blinking mouse cursor. So I downloaded 12.04 LTS, and installed from CD. When prompted I chose the option that stated something along the lines of "Install 12.04 over previous version of Ubuntu" and NOT "Wipe the system and do a fresh installation". After installation and reboot my home directory was that of a fresh install! All my documents and tons of code gone! I am currently running TestDisk from my windows partition but it's not looking promising.

    My ubuntu partition was not one I frequented as of late and all I know is my password. Thankfully I still have the latest compiled jar files of my java projects which as a last resort I could decompile, fix up and go back to much older backups to re-insert comments (quite complicated code). If I could just have my working projects direcory back (~/home/NetbeansProjects) I would be happy.

    Can anyone please help?

  2. #2
    Join Date
    Nov 2009
    Location
    Segur De Calafell, Spain
    Beans
    11,694
    Distro
    Ubuntu 12.04 Precise Pangolin

    Re: Data loss after 12.04 installation

    Unfortunately, the "install over previous version" is almost the same as "wipe the disk" when you have only ubuntu. The difference is if you have another OS, the wipe option will wipe all, and the install over will only wipe your old ubuntu and install over it.

    First see what testdisk comes up with. It's very good recovering deleted partitions.

    As an idea for the future, you might think about having separate /home partition, and/or another data partition where you keep all your important data, and when you want to move to a new release you simply do a clean install reusing the same /home partition and all data partitions. That keeps your personal data safe from the clean install. You might need to tweak few options, but in general that's not too difficult compared to the safety you get doing clean installs compared to upgrades which often give issues.
    You can even export the list of packages/programs on the old install, and import it into the new one which should install all newer versions if available.
    Darko.
    -----------------------------------------------------------------------
    Ubuntu 12.04 LTS 64bit & Windows 7 Ultimate 64bit

  3. #3
    Join Date
    Mar 2010
    Location
    India
    Beans
    8,175
    Distro
    Ubuntu 12.04 Precise Pangolin

    Re: Data loss after 12.04 installation

    Quote Originally Posted by lablouw View Post
    When prompted I chose the option that stated something along the lines of "Install 12.04 over previous version of Ubuntu" and NOT "Wipe the system and do a fresh installation".
    Unfortunately, the process of installing over an existing installation involves 'deletion' of existing system files/folders on the target partition even if you don't choose to format it (as is confirmed when you choose "something else" for manual partitioning and choose not to format the existing partition).

    This is done to avoid conflicts with existing setup/configuration.

    Sorry to be the bearer of the bad news, but any data recovery program will now only recover what is not already overwritten (deleted, but not overwritten).

    To recover what IS still recoverable, just run photorec (or 'extundelete' command, but I haven't yet tried it, so can't say how promising it is).


    EDIT:
    Darkod beat me to it ! :/
    Amazing it took me 10 minutes to write the post. Guess I was too busy enjoying the rain while writing it..
    Last edited by varunendra; June 17th, 2013 at 12:43 PM.
    Varun
    Help others by marking threads as [SOLVED], if they are. (See how)
    Wireless Script | Use Code Tags
    Am I not replying you? Perhaps this is why.

  4. #4
    Join Date
    Jun 2013
    Beans
    2

    Re: Data loss after 12.04 installation

    Thanks for the advice guys, I'll keep going at it and will have a look at the extundelete command too. Does the fact that the old home folder was encrypted have any bearing on the recovery software being able to recover (if the files still exist)? Or would it return garbage for anything that was in that folder?

    Thanks again.

  5. #5
    Join Date
    Mar 2010
    Location
    India
    Beans
    8,175
    Distro
    Ubuntu 12.04 Precise Pangolin

    Re: Data loss after 12.04 installation

    Quote Originally Posted by lablouw View Post
    Does the fact that the old home folder was encrypted have any bearing on the recovery software being able to recover (if the files still exist)? Or would it return garbage for anything that was in that folder?
    Oh my...!
    File(s) recovered from previous Home folder would be garbage unless there is a way to decrypt them after recovery. Seems possible but I'm not much aware of encryption-decryption operations, so can't offer much help on that.

    Also, since the default setting of PhotoRec is to drop any files that 'seem corrupt' to it, it may not recover those files at all (unless it has the ability to recognize encrypted file headers). In that case, it may help to mount the partition in the same encrypted environment, then re-run photorec. The word 'chroot' comes to mind, but to be honest, I have absolutely no idea what I'm talking about here. Only thing I know is that encryption IS a problem.

    Another thing I know is that you can change the settings of photorec to NOT drop corrupt files. It may be helpful if it drops the encrypted file(s) thinking they are corrupt, but will also return a pile of actually corrupt/broken files.

    I hope someone experienced with encryption/decryption may offer some real help here. If someone has any ideas, please jump in !
    Varun
    Help others by marking threads as [SOLVED], if they are. (See how)
    Wireless Script | Use Code Tags
    Am I not replying you? Perhaps this is why.

  6. #6
    Join Date
    Nov 2009
    Location
    Segur De Calafell, Spain
    Beans
    11,694
    Distro
    Ubuntu 12.04 Precise Pangolin

    Re: Data loss after 12.04 installation

    I would try testdisk first, you seem to have started with it. The reason being that testdisk recovers partitions (partition tables), not files one by one. With little luck, you can get back the table structure, and once your "old" partitions are back try to decrypt with the password that you know.

    Some files will be corrupted, but most should be there since a default ubuntu install is barely 4GB. It can't overwrite too much.

    I wouldn't use photorec first, because it tries file by file, as long as you have a testdisk option on the table.
    Darko.
    -----------------------------------------------------------------------
    Ubuntu 12.04 LTS 64bit & Windows 7 Ultimate 64bit

  7. #7
    Join Date
    Mar 2010
    Location
    India
    Beans
    8,175
    Distro
    Ubuntu 12.04 Precise Pangolin

    Re: Data loss after 12.04 installation

    Quote Originally Posted by darkod View Post
    I would try testdisk first, you seem to have started with it. The reason being that testdisk recovers partitions (partition tables), not files one by one. With little luck, you can get back the table structure, and once your "old" partitions are back try to decrypt with the password that you know.
    Makes a lot more sense if the partition was formatted. I'm not sure about that. I thought only the existing files get deleted, not that the partition is formatted.

    So yeah, if the partition was formatted, there is a good chance to be able to recover the old partition table, and thus the old partition with old files (even if some are corrupt) on it. If that happens, then there is a well documented method to recover encrypted files.

    Thanks for the pointer darkod.
    Varun
    Help others by marking threads as [SOLVED], if they are. (See how)
    Wireless Script | Use Code Tags
    Am I not replying you? Perhaps this is why.

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •