If the /home
is also completely empty when viewing in the original Linux OS you might want to look at this article (The "Recover lost partition"-part). It could be you have overwritten you partition table of /dev/sda
(loosing sda2
etc...). You can run mentioned TestDisk utility to analyse if the partition is salvageable. In your case you should use sda
instead of the sdb
they used.
Instruction to recover from an overwritten partition table can be found here. I copied the relevant bits below:
How to recover partitions and data using Linux - Tutorial
Recover lost partition
There could be many reasons why your partitions no longer show up. For example, you may accidentally create a new partition table on the wrong hard disk. This might happen when setting up a multi-boot setup.
To be able to show you a real-life would-be disaster scenario, I will simulate the loss of partition. Our test box will be Fedora 16 Verne, with KDE. We will try our little disaster game a secondary disk, /dev/sdb, which is used for data, although this kind of problem could also happen on system partitions. In that case, you will have to use a live CD to try to recover your box.
We will destroy the partition table for /dev/sdb, by creating a new one in GParted. We will ignore the fact there already is one on the disk. This way, we will vanish the partitions, making them invisible to the system. To a casual user, it will look as if the data is forever lost. All right, here's how it's supposed to be, on a healthy system:
So we destroy the partition table. Now, we will use TestDisk, an awesome forensics tool developed by cgsecurity.org. I have listed this program many times before in a variety of articles, but we've never really used it in anger. Today, we will explore its capabilities, as well as learn how to use it.
TestDisk runs as a text wizard inside the shell. It's an interactive tool that will ask you a few questions to try to salvage your data. The first question is to decide whether you wish to keep the log for future examination. If you're doing forensics, then you probably want to do this.
We will begin with the analysis. We do not know what the situation is, or how bad it is. Since you probably do not know the exact disk geometry by heart, using the analysis, notice the proper English spelling, is your best bet in figuring out the existence and location of previous partitions.
The next step is to choose which device we want to work with. In our case, /dev/sdb.
Now, choose the partition table type. For most people, it will be Intel/PC.
And we begin the analysis:
We are lucky. TestDisk was able to find the partition. Even though the old partition table was destroyed, it was just a pointer to the start and end addresses of the actual data, so to speak. The disk surface was not harmed, and therefore, our data should be there.
Now, we need to write the partition information to disk. It is also possible to change the partition characteristics, like type and flags.
And it's worked! Boom, we're back in business. Now, this means we have a sane partition table and our partitions can be used, but this does not mean some of the data has not been permanently overwritten or destroyed forever. We will further explore this second part of the partition and data recovery below. For now, things are looking good.
/home
used to be in a logical partition. Do you know if your system happens to have a second HD (which doesn't show up now) or are you sure the logical partition was on/dev/sda
? What happens if you detach the USB-disk and reboot? (is/home
still "lost"?)/home
still completely empty? According tocat /etc/passwd
should there be any subdirectories (that are not there anymore, like/home/username
)?