Categories
Computers Linux Ubuntu Windows

Recovering deleted files with a Ubuntu CD

Continued from Recovering Windows files with a Ubuntu CD II: getting your files

Introduction
Usually when you delete a file from your computer, the file is still there—its space, however, is marked as available for use. Even if you reformat your hard drive and reinstall Windows (I had a friend who did this by accident, and I used Ubuntu to save her data), most of your data is probably still there.

Assuming you were able to boot the Ubuntu CD and it properly detected your internet connection, you can use a program called Photorec to recover your personal files.

If Ubuntu does not automatically detect your internet connection, and you have access to the internet on another computer, you can download the appropriate two installer files from here and here. Find a way (by USB key or iPod) to transfer them to the computer running the Ubuntu live session, and double-click libntfs10 to install it, and then double-click testdisk to install it.

This may be a bit confusing—the program we want to use is called photorec, but the program we want to install that allows us to use Photorec is called testdisk. Also, the program is called Photorec, but it recovers many types of files, not just photos.

Installing testdisk to use Photorec
First, we’re going to install the program we need in order to use Photorec.


Click on System > Administration > Synaptic Package Manager. This will open a software management program that will fetch and install software for us.


Click on Settings > Repositories.


Make sure all the checkboxes are checked (or ticked), except the CD-ROM source at the bottom. Then click Close.


Click Close again.


At the top-left corner of the Synaptic window, click Reload and wait for the new software package information to download.


Now that we’ve told the software manager to find all the software that’s available for installation, let’s install it. Click Search in the Synaptic window, in the search box type testdisk, and then click Search in the dialogue window.


testdisk should appear in the results. Right-click it and select Mark for installation.


In the Synaptic window, click Apply, and then confirm you want to apply changes by clicking Apply in the dialogue window as well.


Wait for the software to download and install.


Click Close


Quit the software manager.

Prepare backup location

You can use an external hard drive or even internal second hard drive for backup.

For an internal second hard drive, you can access it the same way you accessed the internal first hard drive (the one you’re trying to recover data from).

If the backup location is an external hard drive, you should be able to plug it in and have it automatically appear on the desktop as an icon.


Go to Applications > Accessories > Terminal


Type

df -h

in the command prompt window that appears. This will show you the path to the backup location. In this example, the backup location I’m using is 2.8 GB large, so I must make a note that it is available at /media/disk-2.

In Windows, new drives “mount” (or become available for use) as new letters (D:, E:, F:, G:, etc.). In Ubuntu, new drives mount as folders inside an all-encompassing directory. The top-level directory is slash (/). Inside that directory is subdirectory called /media, which has inside of it another subdirectory called disk-2. That’s where I want to send the recovered files to.

Recovering files with Photorec

Before you run Photorec, maximize the command terminal window. To run it, you need to run the command

sudo photorec

Don’t try to run the command photorec without sudo, as I tried to do earlier in the screenshot.


Photorec is a terminal program, so your mouse won’t work in it. You can navigate its menus with your arrow keys and then select your choices with the Enter key.

The media you are selecting is the drive you want to recover files from. Then click Enter to proceed to the next step.


Select the appropriate partition type. If in doubt, select Intel.


Select to search the whole disk.


Since this tutorial is aimed specifically at recovering Windows files, you’ll most likely choose Other for filesystem type.


This is where things get a little tricky. Photorec will assume you want to back up to a folder in Ubuntu’s /home/ubuntu directory, but you probably want to back up to an external drive (in this example, it’s /media/disk-2).


To go up a directory, go to the double-dot and press the right arrow key.


Do the same to go up yet another directory.


Select media and hit Enter.


Select the drive you want the recovered files to be saved to. In this case, it’s /media/disk-2.


Once you’ve selected the backup drive, type

Y

for Yes.


Wait for Photorec to scan for files. Depending on the size of your drive, this could take a really long time. The drive I scanned for this example is only 8.7 GB and took about 15 minutes to scan. If you have a 160 GB drive, well, you do the math.


When it’s done, you can select Quit.


Select Quit again.


Yes, select Quit a third time.


To exit the command terminal, type

exit

Checking the recovered files

If you look at the backup drive, you should see a bunch of folders full of recovered files.


Every folder will have a mix of different file types. Some files will be music files. Others will be Word documents. There will be pictures and text files. All sorts of stuff you may not even care about. The labels will be random, so even though you have your files back, it’ll be up to you to reorganize them and rename them appropriately.


To get out of the live CD, go to System > Quit.


Select the appropriate option, probably Restart.


Wait for the live session to fully end, and then press Enter to reboot after the CD ejects.


After you reboot into Windows, you should be able to access the recovered files.

Congratulations! You just saved yourself hundreds of dollars, learned something new, dabbled in Linux (Ubuntu specifically), and didn’t give up access to your computer for days or weeks.

You should, of course, always back up your files, but it’s also good to know there are free and easy ways to recover your data otherwise.

If you need any help with this process, please feel free to post a support thread in the Absolute Beginner subforum of the Ubuntu Forums.

Categories
Computers Linux Ubuntu

The writers who cried YOTLD

If you have followed tech news closely at all within the last ten years, you’ve probably heard the phrase year of the Linux desktop before. This is the year that Linux makes a breakthrough with home users, and suddenly Microsoft’s dominant market share comes toppling down. I believe people have been proclaiming various years as the year of the Linux desktop since as early as 1998 (possibly even earlier).

Sometimes the writers will say the current year will be the year of the Linux desktop. Sometimes they’ll be a little more conservative and say some year a few years from now will be the year of the Linux desktop. For example, if I were one of these writers, I would either write 2008 will be the year of the Linux desktop! or with the progress we’re saying right now in 2008, it’s likely that by 2011, we’ll see the year of the Linux desktop.

Did we see the year of the Linux desktop? Nope. That, at least, I think most of us Linux aficionados can agree on. But some naysayers go a step further. Through a leap in logic, they decide that the fact that none of these previous predictions have come true precludes the possibility of a future prediction coming true. In other words, the extrapolation goes something like this: Oh, come on. For years, people have been saying such-and-such year is the year of the Linux desktop, and it’s never come. It’s never going to come. Microsoft will always be on top. Just deal with it.

I would contend that we have no way of knowing whether that year will ever come or not. Just think of the fable “The boy who cried wolf.” In it, the boy tells the village that a wolf is coming. The village gets all up in a panic and then realizes the boy was lying. He cries wolf a second time, and a second time the village is in a panic and realizes the boy was lying again. The third time he cries wolf, there really is a wolf, but no one in the village believes him any more. That’s what’s happening with this whole YOTLD business. These writers who keep proclaiming that some year is the YOTLD are losing their credibility every time the year doesn’t come. But it also means that it’s possible the year might come, and no one will believe the writer who really does get it right.

So I guess it boils down to two things: 1. If you’re a writer who wants to proclaim that such-and-such year is the YOTLD, don’t even bother. Even if you’re right, no one will believe you anyway, as people have been saying that for years. 2. If you one of those people who thinks the YOTLD will never come, you have to come up with other reasons than “They’ve been saying that for years.” After all, I could say every year that I’m going to die that year, and I may be wrong most of the time, but one year I am going to be right. Whether I say it’s going to happen or not has no bearing on the actual outcome or occurrence.

I’m just beginning now to read Malcolm Gladwell’s The Tipping Point, which talks about the moment when there’s a huge sociological change (crime rates dropping, fashion trends being adopted, new technology going mainstream), and it’s made me change my mind on Linux adoption. I used to think the growth of consumer Linux would be gradual and stay gradual indefinitely, but there is a tipping point, and if we get to that point (maybe about 15%), there will be a huge flood of new users. I’m not going to speculate on what year that might be, but it clearly happened for cell phones (as Gladwell points out) in 1998, and it also happened for iPods in 2003, and Firefox in 2005. It won’t necessarily mean the end of Windows’ dominance on the home user’s computer, but it could mean a lot more third-party support for Linux—the kind that Macs currently enjoy.

Which year will be the YOTLD? No one knows. There very well still could be one, and it would probably be a year and not a decade.