Saturday, January 01, 2011

Setup Mac OS X in VirtualBox

Amplify’d from lifehacker.com

How to Run Mac OS X in VirtualBox on Windows





How to Run Mac OS X in VirtualBox on WindowsIf you're on Windows, need to use OS X, but don't want to buy or build a new computer, reader Bobby Patton shows us how to run Snow Leopard in a virtual machine on Windows with just a few tweaks.

How to Run Mac OS X in VirtualBox on WindowsWe've shown you how to install Snow Leopard in VMWare, but if you haven't purchased VMWare, you can now do it using previously mentioned, free program VirtualBox. Apart from VirtualBox, you'll also need an OSX86 ISO. The group Hazard has put out a good patched Snow Leopard installer that should do fine (just search for it on Google). Of course, if you feel bad about downloading the ISO of Snow Leopard, you could always go buy a copy to feel a bit better, karmically.


After you have them both, install Virtualbox. Open up Virtualbox and click on New at the top left.


At the Create New Virtual Machine window, click Next.


How to Run Mac OS X in VirtualBox on Windows


At this window type OSX as the name and it will automatically change the system and version. The next window will let you choose your RAM amount:


How to Run Mac OS X in VirtualBox on Windows


If you can spare it, crank it up as far as you can go, but 1024MB should be sufficient.


How to Run Mac OS X in VirtualBox on Windows


This is where you'll make your hard disk. 20GB should be enough so what it comes down to is dynamic or static. Dynamic will expand on use and Static will be a fixed 20GB no matter how much data is actually in it. Dynamic is better for not taking up your hard drive but static should give you better performance. I normally use dynamic. Click next unless you want to change it from dynamic or if you want to increase the disk size or file location.


How to Run Mac OS X in VirtualBox on Windows


It will show a summary of your settings. Click Finish, then click Settings at the top. At this window click on System in the left pane and uncheck Enable EFI.


How to Run Mac OS X in VirtualBox on Windows


Now click on the Storage button on the left. From there click on Empty under the OSX.vdi, then click the folder with the green arrow on the right (next to "CD/DVD Device").


How to Run Mac OS X in VirtualBox on Windows


At this window click the Add button at the top. Then find and add the OSX86 ISO you downloaded earlier. Then highlight it and click Select at the bottom. Then click OK, and hit the Start button on the left side of the main VirtualBox window.


How to Run Mac OS X in VirtualBox on Windows


As it starts up, click inside the window and hit F8. Then at the boot: prompt type –v so you can see what exactly went wrong if something does go wrong. All the services will run and eventually you should come to the language screen. Choose your language then click next. If you are unable to move your mouse around then hit Right-Ctrl + I. Click Continue and Agree. Next, start up Disk Utility by going to Utilities in the menu bar.


How to Run Mac OS X in VirtualBox on Windows


At this screen highlight 20GB VBOX HARDDISK. Then click the Erase tab, name it what you want in the name box and click the Erase button on the bottom right of the window. It shouldn't take long. Then click Disk Utility in your menu bar and quit it. Now you're back at the installer. Highlight the drive that is now showing up and click Continue.


How to Run Mac OS X in VirtualBox on Windows


The next window is important. Click the Customize button on the bottom left.


AMD Users check:

Any Updates included at the top.

Drop down Kernels and choose Legacy kernel.

AMD option below System support.


Intel Users check:

Any Updates included at the top.

Drop down bootloaders and check the newest Chameleon.

Drop down Kernels and choose Legacy kernel.

Then click Done and hit the Install button. To speed up the process you can click Skip when the disc check pops up.


How to Run Mac OS X in VirtualBox on Windows


As soon as it says "installation finished" and starts counting down to restart, press the right Ctrl key. Click on Devices at the top of the VirtualBox window, hit CD/DVD Devices and click Unmount CD/DVD Device. Then go to Machine > Reset and click Reset at the prompt. Next you'll see the Chameleon loader and then OS X will begin to boot.


How to Run Mac OS X in VirtualBox on Windows


After it boots you will see the setup screens for OS X! You're good to go. The only hiccup I've found is that it can only be virtualized with one core. It could be the OSX disc I was using or it might not be. And I have yet to find the right kext that will allow audio to work and the resolution is limited also. But other than that you'll have a fully functioning OSX virtualized!


Update: I'd like to post some answers to the resolution and audio. I should have looked around before posting this but I just didn't have the time. So anyways heres what you can do:


To fix the resolution issue, open Finder and go to the OS X drive on the left. Open the folder called Extras. Right Click on the file com.Apple.Boot.plist and open it with TextEdit. Under the first insert this:


Graphics Mode

1280x1024x32


or another compatible resolution. Select "Save As" at the top and save it to the desktop, unchecking the check under Unicode and then save it as com.apple.boot.plist. After that drag and drop it into the extras folder and overwrite the original file, entering your password when prompted.


Instructions for the sound issue can be found here.


Don't install system updates. If you want updates you'll have to install another iso distribution with the updates on it. If you install the updates directly from apple it messes with the custom kexts and chameleon. Just a forewarning.


And for those of you getting boot issues try choosing a different version of Chameleon or a different kernel. Sometimes that seems to help. And If your getting one of the USB errors then try disabling USB in the VirtualBox settings and see if that helps.


Ok, for anyone who is getting that really annoying hanging on the spash screen or who is using -v and getting the hanging on the final line of the disk check, then here is the solution.

Problem occurs because the VM needs to use VT (Virtualisation Technology). This must be enabled on the BIOS.

1.) Reboot machine
2.) Enter Bios and look for performance/processor settings
3.) Make sure VT is enabled
4.) IMPORTANT: make sure Trusted Execution is disabled (this is unsupported and you get that annoying box come up everytime you start the VM.)
5.) Save/Exit
6.) When you start the VM now, you should not see the error box and the ISO will boot.

Thanks,

Ben
Read more at lifehacker.com
 

Essential Free Mac Applications

Amplify’d from lifehacker.com

Most Popular Free Mac Downloads of 2010





Most Popular Free Mac Downloads of 2010Unless you built yourself a Hackintosh, Macs can be get pretty expensive. Fortunately, some of the best Mac software costs you absolutely nothing. Here's a look at the most popular, free Mac downloads for 2010.

VLC 1.1 Brings Hardware Acceleration and Lighter Operation to Media Playing


Most Popular Free Mac Downloads of 2010

VLC's been around for awhile, playing basically any media file you can throw at it, but things got especially good on the Mac with version 1.1. This update brought hardware video acceleration, support for the the open WebM video standard, and making it extra fast. If you're not up-to-date on your VLC knowledge, you can go through our full VLC coverage, spanning more than just a Mac to give you VLC playback support on other Apple devices like the iPhone, iPod touch, and iPad.

VirtualBox 3.2 Beta Virtualizes Mac OS X (On Macs)


Most Popular Free Mac Downloads of 2010

VirtualBox is a free solution for putting a virtual Mac on Mac. Why might you want to do this? If you want to test a thing or two on a Mac without putting your own system at risk, a virtual machine is an excellent solution. It's also extremely useful for Hackintoshers who want to test specific settings. Whatever reason you have for needing a virtual Mac in a Mac, VirtualBox is a great, free solution.

Kylo Is a Big-Screen, TV-Optimized Web Browser


Most Popular Free Mac Downloads of 2010

Maybe you've got a Mac mini hooked up to your TV and you want to use it for more than just playing videos. Kylo makes web browsing a lot easier with its TV-optimized user interface. Everything is a bit bigger than you'd actually like it on your laptop or desktop, but those big buttons and couch-friendly features make browsing a lot easier in the living room.

MakeMKV Rips DVDs and Blu-Rays with Just Two Clicks


Most Popular Free Mac Downloads of 2010

There is still no official Blu-ray support on the Mac, which is extremely frustrating for some. Nonetheless, if you're intent on ripping your Blu-rays to high quality MKV files, MakeMKV will do the trick. It's very straightforward and surprisingly quick. It's also pretty much your only option—if you need to rip Blu-rays—so be very glad it exists.

MediaRover Is Push Sync for Your iTunes Libraries


Most Popular Free Mac Downloads of 2010

While I wouldn't call MediaRover the holy grail of iTunes sync, it is free and pretty great. Media Rover lets you take multiple machines (both Macs and PCs) and sync your music between them all. It only works on your local network and needs a network-attached storage device or central Mac to act as your iTunes hub, but if all of that works for you then MediaRover will too.

HyperDock Brings Window Previews, Other Dock Enhancements to OS X


Most Popular Free Mac Downloads of 2010

Apple likes to criticize Microsoft for copying user interface elements from OS X, but lately Microsoft's come up with a few gems of their own. One of the more popular user interface features in Windows 7 is Aero Peek, letting you hover over a minimized application and quickly get a preview of the open windows. If you'd like to have a little Aero Peek on your Mac, HyperDock can provide. In addition to peeking at your docked application's windows, it also provides a number of window management features as well.

Perian Makes Nearly Every Video Playable in QuickTime


Most Popular Free Mac Downloads of 2010

If VLC were a plug-in for QuickTime it would be Perian. While Perian isn't quite as versatile as VLC, if you prefer the minimalist, attractive interface that QuickTime Player provides you'll really appreciate Perian. All you have to do is install it and suddenly QuickTime will support a slew of new video formats. Even if you're like me and use VLC primarily, it's worth installing Perian anyhow for QuickLook support or for the occasional moment when you do use QuickTime Player instead.

CloudApp Instantly Shares Any File, Is My New Favorite Timesaver


Most Popular Free Mac Downloads of 2010

I have an obsession with menubar apps, since they're so tiny and offer some of the best, simple functionality. CloudApp exemplifies what's great about about great menubar apps, letting you quickly drag a file to the menubar and share it with anyone. It reduces file sharing to a single step and provides a great online interface for uploaded files.

Read more at lifehacker.com
 

Boost BitTorrent Speeds and Increase Privacy

Amplify’d from lifehacker.com

How to Boost Your BitTorrent Speed and Privacy





How to Boost Your BitTorrent Speed and PrivacyBitTorrent's been around for a whopping ten years, but it continues to evolve and remains one of the best file-sharing tools available. If you really want to make your downloads soar—and keep Big Brother out of your business—this guide's for you.

We showed you how to get started sharing and downloading files with BitTorrent a few years ago, and most of that still applies, but if you're looking to up your BitTorrent skills, things have changed a lot since then.


In fact, some of you may find BitTorrent a bit old school for your tastes. Sure, the ISPs are cracking down and throttling peer-to-peer users, and you have other great file-sharing alternatives like Usenet, but that doesn't mean BitTorrent doesn't still have a place in your routine. It's pretty easy to ward off prying eyes with today's BitTorrent clients, and while Usenet is certainly great, BitTorrent is still more widespread. As such, it tends to have a better selection on certain things, and is at the very least a good fallback method for when you don't find what you're looking for elsewhere. After all, there's no reason you have to be loyal to only one file-sharing protocol.


This intermediate guide to BitTorrent is designed to help you do three things: jack up your speeds (without consuming your bandwidth) and keep unwanted snoopers from seeing what you're doing. We've divided them up into three sections:



For the purposes of this guide, we're focusing on two BitTorrent clients: uTorrent for Windows and Transmission for Mac OS X. That doesn't mean you can't use other clients like Vuze (or KTorrent and Transmission for Linux, if you are of the Linux persuasion), but there are just too many clients out there for us to give specific instructions for each. uTorrent and Transmission are some of the most popular clients out there, and they're our favorite here at Lifehacker, so where appropriate, we'll give you specific instructions for each client. Note that uTorrent for Mac is not nearly as mature as uTorrent for Windows, and may not have some of these features—so, in this particular case, when we reference uTorrent, we mean uTorrent for Windows.


Keep Your BitTorrent Speed and Privacy at the Max with a Few Simple Settings


BitTorrent clients have come a long way in the past few years, and where it used to be much more difficult to hide your BitTorrent activity, it's now a matter of checking the right boxes. Here are a few settings every BitTorrent user should have enabled.


Randomize and Forward Your Router Ports


If you're connected to your internet through a router, it's likely that many of your ports are closed, meaning your speeds will be much slower than you'd like. You'll need to let your router know which ones you want open for BitTorrent traffic, which is known as port forwarding. Furthermore, many ISPs or organizations (say, if your neighborhood or leasing company provides your internet) will block popular BitTorrent ports, so you'll want to switch up the port you use every once in a while to keep them guessing.


How to Boost Your BitTorrent Speed and Privacy


Both of these are extremely simple in uTorrent and Transmission. In uTorrent, just to go Options > Preferences and hit the connection tab. Make sure all four boxes under the "Listening Port" section are checked—Enable UPnP Port Mapping, Enable NAT-PMP Port Mapping, Randomize Port Each Start, and Add Windows Firewall Exception.


How to Boost Your BitTorrent Speed and Privacy


In Transmission, open up the app's preferences and head to the Network pane. Check both the Randomize Port on Launch and Automatically Map Port boxes. If you see that the light next to the port's number goes from red to green, then you've successfully opened your current port to BitTorrent traffic, and you should notice a good increase in speed.


Note that for best results, you'll want to make sure your router is UPnP capable and has UPnP enabled. Most routers are UPnP ready, but if you find that you're having trouble, you may need to look at your router's manual and settings page to enable its use.


Encrypt Your BitTorrent Traffic


Nowadays, many internet service providers will throttle your bandwidth, prevent you from seeding, or do any other number of annoying things to try and stop you from torrenting. Apart from randomizing your ports, another thing you can do to try and keep them out is encrypt your traffic. It won't necessarily work on every client, but I've found that it nearly doubled my download speeds, so it's certainly worth a shot.


How to Boost Your BitTorrent Speed and Privacy


In uTorrent, go back to the preferences and hit up the BitTorrent section in the left sidebar. Under Protocol Encryption, open the dropdown menu labeled Outgoing. You have three options: Disabled, Enabled, and Forced. Try Enabled for awhile, but if you don't see a good speed increase, using the Forced setting might give you better results. Also note the Allow Incoming Legacy Connections checkbox—If you have a specific torrent that doesn't have a lot of people seeding, you might want to check this box temporarily, though I try to keep it unchecked whenever I can. This ensures that any peers you connect to will use encryption and that your ISP will be less likely to throttle you.


How to Boost Your BitTorrent Speed and Privacy


In Transmission, head over to the Peers pane of the app's preferences and check the Encryption section. Definitely check the "Prefer Encrypted Peers" box, and I'd highly recommend checking the "Ignore Unencrypted Peers" box, though again, if you are noticing that there aren't a lot of peers connecting for a specific torrent, try unchecking it to see if that helps your speeds.


Block Peers that Might be Snooping


Even worse than throttling ISPs is the threat of the snooping RIAA, MPAA, or other organizations looking to take you down. Often, they'll post fake torrents of copyrighted material (or just join in on real ones) and track those downloading, leading them right to an unprepared you. While there is no foolproof way to avoid them, a really great simple way is to use a peerblocker. Transmission has this feature built-in, while Windows users will need to use a separate program.


How to Boost Your BitTorrent Speed and Privacy


If you're a Mac user, open up Transmission's preferences and head back to the Peers pane. This time, check the box that reads "Prevent Known Bad Peers from Connecting" down under the Blocklist section. Hit the update button to make sure the list of bad peers is recent, and check the Automatically Update Weekly box to keep it up to date.


How to Boost Your BitTorrent Speed and Privacy


Windows users will need to download previously mentioned PeerBlock (an updated version of the seemingly defunct, previously mentioned Peer Guardian 2) to block the big boys from snooping. The first time you run it, it'll take you through a setup wizard, in which you can decide who you want to blacklist. Check the box for anti-P2P organizations (as well as anything else you may want, though the P2P box is the only important one for BitTorrent) and schedule it to update as often as you want. You might as well update it every day; there's no reason to be stingy with your privacy here. Then, just make sure it runs when you use your BitTorrent client—it'll keep you safe from those bad peers.


Automate Your Client and Free Up Bandwidth


These are some tricks that have been around for awhile, and they won't exactly keep Big Brother off your back, but they are useful for keeping BitTorrent from overtaking your internet connection, especially if you've experienced some heavy speed increases from the above tips. Here are a few ways to automatically manage BitTorrent's use of your bandwidth.


Set Global Bandwidth Limits


How to Boost Your BitTorrent Speed and Privacy


BitTorrent downloads and uploads can hog a lot of your internet connection's bandwidth, especially if you're sharing popular content. The simplest way to keep BitTorrent from hogging your connection is to set global upload and download limits. In uTorrent, you can find them in the Connection section of the Preferences. The settings are fairly self-explanatory—just set your max upload and download rates (in kB/s), or choose 0 to keep the rates unlimited.


How to Boost Your BitTorrent Speed and Privacy


In Transmission, it's under the Bandwidth pane of the app's preferences—just check the "Download Rate" and "Upload Rate" boxes and set your speeds however you want. You can also set a "Speed Limit" mode, if you want to switch between two different bandwidth limits—say, give it more bandwidth when you're just checking email and the like, and cut the limits down when you need that bandwidth for streaming video or online gaming.


Throttle Your BitTorrent Downloads on a Schedule


You could just quit your BitTorrent client (or manually turn on Speed Limit mode) whenever you want to conserve your bandwidth, but if you're like me, you'll forget to start it back up—meaning you'll end up delaying your downloads (most likely until you want whatever was supposed to be downloading, at which point you will slap your forehead).


How to Boost Your BitTorrent Speed and Privacy


To remedy this situation, uTorrent and Transmission both come with simple Scheduler features that you can access through the Preferences. In uTorrent, go to Options > Preferences, then find Scheduler in the sidebar. Tick the box next to "Enable Scheduler" and you'll see a grid of green boxes light up. The grid runs Monday through Sunday, midnight to midnight (or 0:00 to 23:59), one box per hour. Here's how it works:



  • Dark green boxes indicate that uTorrent will download and upload at full speed (or whatever you've set as its full speed).

  • Light green boxes indicate limited download and upload rates.

  • White boxes indicate that uTorrent will not download or upload any content.

  • Pink boxes indicate that uTorrent will only seed, not download. I'm not exactly sure when one would be inclined to use this, but it's there if you want it.


I've always got a little bandwidth to spare on my connection, but I certainly don't want uTorrent hogging my bandwidth while I'm working, so I set the Scheduler to limit speeds from 8am to midnight every day. During the wee hours of the morning, when I'm very unlikely to be at my computer, I open the flood gates and give uTorrent unlimited upload/download speeds. Also, since I generally stay away from my computer on Saturday, I keep uTorrent at full throttle. See the screenshot above to see what this sort of schedule would look like. Like I said, my connection can handle a little bit of bandwidth bleeding all of the time, so when I'm running at limited rates, I set my upload speed to 5 kB/s and my download speed to 15. Handy, huh?


How to Boost Your BitTorrent Speed and PrivacyIn Transmission, it's a bit more basic. Just open up Transmission's Preferences and to the Bandwidth tab. You only have two modes instead of three—your global bandwidth limits and Speed Limit mode. You can schedule the speed limit mode to turn on and off at a specific time either every day, on weekdays, weekends, or on a specific day of the week. It's not quite as flexible as uTorrent's scheduler, but works well enough—I'll generally just limit its speed during the day, and let it tear up my connection when I'm sleeping.


Ensure a good share ratio without wasting extra bandwidth


As Adam mentioned in our beginner's guide, an important part of BitTorrent is sharing, and a good member of the BitTorrent community gives as much as he/she takes. In fact, many sites, especially private trackers, keep a close eye on your share ratio and may even ban you if you don't keep your ratio above a certain point (i.e., if you are a "leecher"). This isn't as widespread as it used to be, but it does still happen—and besides, sharing is just a nice thing to do. I'm in total agreement of the whole share-and-share-alike attitude, but once I've shared an equal part of what I've downloaded, I don't want to waste too much extra bandwidth on that torrent.


How to Boost Your BitTorrent Speed and Privacy


Rather than constantly checking your torrent ratios so you can remove them as soon as they cross the 1.0 barrier, go to the Queuing section of uTorrent and find the "Seed While" section. There you can set a goal ratio for a file you're sharing, then set how much bandwidth uTorrent will allocate to the torrent once that goal is reached (in the screenshot, for example, uTorrent will stop sharing the file after its share ratio reaches 150%). If you prefer, you can just limit the upload rate when uTorrent reaches its goal by checking the corresponding box at the bottom of the window.


How to Boost Your BitTorrent Speed and Privacy


In Transmission, head to the Transfers pane of the preferences and click on the Management tab. Check the box that says Stop Seeding at Ratio and set the ratio to whatever you want, like 1.50 (meaning when your ratio reaches 150%).


External Solutions for Hiding Your Traffic


We won't go into too much detail here (as these solutions could be posts of their own), but we thought some of the more extreme measures deserved mentions in this guide. Here are a few other ways to really keep others out of your business.


Use a VPN


While there are a number of great solutions to hide your identity while downloading, using a VPN is usually a very cheap and popular way to do so. You can use any number of VPN services (like previously mentioned ItsHidden), which will route your traffic through another server, keeping your IP address away from prying eyes.


Set up a Proxy


How to Boost Your BitTorrent Speed and Privacy


One of the other popular methods of obscuring yourself is using a proxy, which works similarly to a VPN. You could roll your own SSH proxy or use something a bit easier like BTGuard, which we've covered how to do before. You very well may see a speed drop when using this method, though, so if speed is more important to you than privacy, this may not be the best route to go.




As always, this guide is not all-encompassing. There are any number of tweaks, methods, and preferences that you could use to quicken, hide, or all-around improve your BitTorrent downloads. If you have any favorite settings we didn't cover, share them with us in the comments.

There is no need to use PeerBlock or any other external IP-filtering application. In fact, this functionality is built into uTorrent and has been for a while. All you need to do is download a filter file and drop it into the correct place.

Go to [blocklistpro.com] and download the file labelled "npfilter.dat.gz" and extract to obtain the single file "ipfilter.dat".

Place this file in your C:Users(username)AppDataRoamingu
Torrent directory and restart uTorrent (you may need to enable hidden folders to be able to see this).

Voila, instant "bad" IP address filtering with no third-party program required. Simply update (overwrite) the ipfilter.dat file with the newest version whenever it comes out and you will always be protected from known IP snoopers and sniffers.

After installing the blocklist you can verify it is working correctly by opening uTorrent and going to the "Logger" tab on the bottom. You should see "Loaded ipfilter.dat (262865 entries)".
Read more at lifehacker.com
 

Recover Lost Data Using Ubuntu Live CD

Amplify’d from lifehacker.com

Recover Data Like a Forensics Expert Using an Ubuntu Live CD





Recover Data Like a Forensics Expert Using an Ubuntu Live CDPlenty of utilities can recover deleted files, but what if you can't boot your computer, or the whole drive has been formatted? Here's how to dig deep and recover the most elusive deleted files, or even whole partitions.


We've shown you simple ways to recover accidentally deleted files, even a simple method that can be done from an Ubuntu Live CD, but for hard disks that have been heavily corrupted, those methods aren't going to cut it. In this article, we'll examine four tools that can recover data from the most messed up hard drives, regardless of whether they were formatted for a Windows, Linux, or Mac computer, or even if the partition table is wiped out entirely.

Note: These tools cannot recover data that has been overwritten on a hard disk. Whether a deleted file has been overwritten depends on many factors – the quicker you realize that you want to recover a file, the more likely you will be able to do so.


Our setup


To show these tools, we've set up a small 1 GB hard drive, with half of the space partitioned as ext2, a file system used in Linux, and half the space partitioned as FAT32, a file system used in older Windows systems. We stored ten random pictures on each hard drive.


sshot-1


We then wiped the partition table from the hard drive by deleting the partitions in GParted.


sshot-2


Is our data lost forever?


Installing the tools


All of the tools we're going to use are in Ubuntu's universe repository.


To enable the repository, open Synaptic Package Manager by clicking on System in the top-left, then Administration > Synaptic Package Manager.


Click on Settings > Repositories and add a check in the box labelled "Community-maintained Open Source software (universe)".


sshot-3


Click Close, and then in the main Synaptic Package Manager window, click the Reload button. Once the package list has reloaded, and the search index rebuilt, search for and mark for installation one or all of the following packages: testdisk, foremost, and scalpel.


Testdisk includes TestDisk, which can recover lost partitions and repair boot sectors, and PhotoRec, which can recover many different types of files from tons of different file systems.


sshot-4


Foremost, originally developed by the US Air Force Office of Special Investigations, recovers files based on their headers and other internal structures. Foremost operates on hard drives or drive image files generated by various tools.


sshot-6


Finally, scalpel performs the same functions as foremost, but is focused on enhanced performance and lower memory usage. Scalpel may run better if you have an older machine with less RAM.


sshot-5


Recover hard drive partitions


If you can't mount your hard drive, then its partition table might be corrupted. Before you start trying to recover your important files, it may be possible to recover one or more partitions on your drive, recovering all of your files with one step.


Testdisk is the tool for the job. Start it by opening a terminal (Applications > Accessories > Terminal) and typing in:



sudo testdisk



sshot-8


If you'd like, you can create a log file, though it won't affect how much data you recover. Once you make your choice, you're greeted with a list of the storage media on your machine. You should be able to identify the hard drive you want to recover partitions from by its size and label.


sshot-9


TestDisk asks you to select the type of partition table to search for. In most cases (ext2/3, NTFS, FAT32, etc.) you should select Intel and press Enter.


sshot-10


Highlight Analyse and press Enter.


sshot-11


In our case, our small hard drive has previously been formatted as NTFS. Amazingly, TestDisk finds this partition, though it is unable to recover it.


sshot-12


It also finds the two partitions we just deleted. We are able to change their attributes, or add more partitions, but we'll just recover them by pressing Enter.


sshot-13


If TestDisk hasn't found all of your partitions, you can try doing a deeper search by selecting that option with the left and right arrow keys. We only had these two partitions, so we'll recover them by selecting Write and pressing Enter.


sshot-14


Testdisk informs us that we will have to reboot.


sshot-15


Note: If your Ubuntu Live CD is not persistent, then when you reboot you will have to reinstall any tools that you installed earlier.


After restarting, both of our partitions are back to their original states, pictures and all.


sshot-16


Recover files of certain types


For the following examples, we deleted the 10 pictures from both partitions and then reformatted them.


PhotoRec


Of the three tools we'll show, PhotoRec is the most user-friendly, despite being a console-based utility. To start recovering files, open a terminal (Applications > Accessories > Terminal) and type in:



sudo photorec



To begin, you are asked to select a storage device to search. You should be able to identify the right device by its size and label. Select the right device, and then hit Enter.


sshot-17


PhotoRec asks you to select the type of partition to search. In most cases (ext2/3, NTFS, FAT, etc.) you should select Intel and press Enter.


sshot-18


You are given a list of the partitions on your selected hard drive. If you want to recover all of the files on a partition, then select Search and hit Enter.


However, this process can be very slow, and in our case we only want to search for picture files, so instead we use the right arrow key to select File Opt and press Enter.


sshot-19


PhotoRec can recover many different types of files, and deselecting each one would take a long time. Instead, we press "s" to clear all of the selections, and then find the appropriate file types – jpg, gif, and png – and select them by pressing the right arrow key.


sshot-20


Once we've selected these three, we press "b" to save these selections.


sshot-21


Press Enter to return to the list of hard drive partitions. We want to search both of our partitions, so we highlight "No partition" and "Search" and then press Enter.


sshot-22


PhotoRec prompts for a location to store the recovered files. If you have a different healthy hard drive, then we recommend storing the recovered files there. Since we're not recovering very much, we'll store it on the Ubuntu Live CD's desktop.


Note: Do not recover files to the hard drive you're recovering from.


sshot-23


PhotoRec is able to recover the 20 pictures from the partitions on our hard drive!


sshot-24


A quick look in the recup_dir.1 directory that it creates confirms that PhotoRec has recovered all of our pictures, save for the file names.


sshot-25


Foremost


Foremost is a command-line program with no interactive interface like PhotoRec, but offers a number of command-line options to get as much data out of your had drive as possible.


For a full list of options that can be tweaked via the command line, open up a terminal (Applications > Accessories > Terminal) and type in:



foremost –h



In our case, the command line options that we are going to use are:



  • -t, a comma-separated list of types of files to search for. In our case, this is "jpeg,png,gif".

  • -v, enabling verbose-mode, giving us more information about what foremost is doing.

  • -o, the output folder to store recovered files in. In our case, we created a directory called "foremost" on the desktop.

  • -i, the input that will be searched for files. This can be a disk image in several different formats; however, we will use a hard disk, /dev/sda.


Our foremost invocation is:



sudo foremost –t jpeg,png,gif –o foremost –v –i /dev/sda



Your invocation will differ depending on what you're searching for and where you're searching for it.


sshot-26


Foremost is able to recover 17 of the 20 files stored on the hard drive.


sshot-27


Looking at the files, we can confirm that these files were recovered relatively well, though we can see some errors in the thumbnail for 00622449.jpg.


sshot-28


Part of this may be due to the ext2 filesystem. Foremost recommends using the –d command-line option for Linux file systems like ext2.


We'll run foremost again, adding the –d command-line option to our foremost invocation:



sudo foremost –t jpeg,png,gif –d –o foremost –v –i /dev/sda



sshot-29


This time, foremost is able to recover all 20 images!


sshot-30


A final look at the pictures reveals that the pictures were recovered with no problems.


sshot-31


Scalpel


Scalpel is another powerful program that, like Foremost, is heavily configurable. Unlike Foremost, Scalpel requires you to edit a configuration file before attempting any data recovery.


Any text editor will do, but we'll use gedit to change the configuration file. In a terminal window (Applications > Accessories > Terminal), type in:



sudo gedit /etc/scalpel/scalpel.conf



sshot-32


scalpel.conf contains information about a number of different file types. Scroll through this file and uncomment lines that start with a file type that you want to recover (i.e. remove the "#" character at the start of those lines).


sshot-33


Save the file and close it. Return to the terminal window.


Scalpel also has a ton of command-line options that can help you search quickly and effectively; however, we'll just define the input device (/dev/sda) and the output folder (a folder called "scalpel" that we created on the desktop).


Our invocation is:



sudo scalpel /dev/sda –o scalpel



sshot-34


Scalpel is able to recover 18 of our 20 files.


sshot-35


A quick look at the files scalpel recovered reveals that most of our files were recovered successfully, though there were some problems (e.g. 00000012.jpg).


sshot-36


Conclusion


In our quick toy example, TestDisk was able to recover two deleted partitions, and PhotoRec and Foremost were able to recover all 20 deleted images. Scalpel recovered most of the files, but it's very likely that playing with the command-line options for scalpel would have enabled us to recover all 20 images.


These tools are lifesavers when something goes wrong with your hard drive. If your data is on the hard drive somewhere, then one of these tools will track it down!


Read more at lifehacker.com