![data: loss on installation](https://linux22.com/image/828256/data%3A%20loss%20on%20installation.png)
I installed 12.04 some time ago. Prior to that I had been running Ubuntu 11? as a dual-boot system. I am still a novice with all this and I assumed (wrongly) that I would be able to do the same when I upgraded - I guess that I must have done something wrong during the install. The problem that I have is that I seem to have lost 2,000 or so photographs and I would like to get them back if possible. Any help would be gratefully received.
答案1
Have you re-installed Ubuntu 12.04 on the same partition as before? Then it should have asked before installing whether to overwrite all data - and remove it in the process. There should have been an option to upgrade (AFAIK) which should keep all data intact. I'm going to assume you have overwritten that partition.
If that is the case - you are essentially screwed. The photos are most likely lost. But maybe not entirely. So read on. If your case is different, please edit your post accordingly (for example, if your home directory is on a separate partition, the photos are most likely still there). The partition setup is the most important bit.
First: don't touch that Ubuntu installation until you have either recovered all you wanted or given up. Starting Ubuntu WILL make matters even worse.
I have once used a program called TestDisk which seemed to do the job (but AFAIK it didn't do what I wanted, but not at the fault of the program). There is a program by the same developer, called PhotoRec, which should be able to recover photos and other file types from a partition. You can run it from Windows. Starting Windows should not affect the Ubuntu partition (if you haven't done anything than the standard dual-boot install). It will ask for a partition and will search for photos on it. This will take a long time. Filenames and directory structure is most likely lost. And it may not be able to recover all images. But when you have only installed Ubuntu and not done too much other things with that installation, it is, in the best situation, able to recover most of the photos.
For the next time, it is (in my opinion) best to put the /home directory on a separate partition (as ext4) and maybe create an additional partition as ntfs that is shared between Windows and Ubuntu. This is the way I use partitions and it works very good with re-installations. Normal upgrading (via the Update Manager / Software Updater) will not erase any data this way. Re-installing Ubuntu on the same partiton as before only removes the OS, not the data (except for directories outside /home like /var/www). It is then only needed to enter the same partitions in the installation dialog so they are automatically mounted on system start (or they may be entered manually in /etc/fstab, but that's more advanced and probably off-topic).