Page 1 of 1

File Recovery Using Linux on a Flash Drive

Posted: Fri Jun 26, 2015 8:58 pm
by Axiom
Recovering Files from a Computer That Won't Boot into Windows Using Linux

phew that is not a catchy title I know. Please make note though: this guide is assuming your computer can at least turn on. It DOESNT have to boot into Windows but it does at least have to turn on. Right, well, preparation.

What we'll be doing is installing Linux to a flash drive, using it as a boot drive in our PC to boot into Linux off of the flash drive, and using our flash drive Linux to recover the files you need.

Materials
  • -A 4gb or higher flash drive (definitely recommend a 16-32gb if you don't have an external hard drive because othewise you'll be doing ALOT of rebooting into this)
    -Preferrably an external hard drive, alternatively a second flash drive.
    -Universal USB Linux Installer (http://www.pendrivelinux.com/universal- ... -as-1-2-3/)
    -A working computer (the USB Installer runs on Windows but there's ways to do this on OS X, I will update this guide later with that information)
Great! Let's begin
1. Decide which flash drive will be used as your booting one. The flash drive will be formatted so, be sure to back up its contents beforehand. Plug it in.
2. Download and run the Universal USB Linux Installer. It's a free program, really great and I've used it for years.
3. Hit I agree, you should be brought to a screen similar to the one shown. In the selection list, select Ubuntu as your distribution and check off "Download link". This will open Chrome and give you a direct URL to the .iso file.
Image
PROTIP: Ubuntu is a type of Linux, no worries here.
4. After the download's finished, in step two, select browse and select your file.
5. Select the letter corresponding to your flash drive's drive letter. Take note here, as if you have multiple external storage devices plugged in, they will show here. You can get the drive letter from Windows Explorer.
6. After select "Create". Agree to the prompts, and proceed.
7. After a while, your installer will be created. You now have an entire operating system on your flash drive, use your power wisely! Linux is a powerful operating system. Really worth some looking in to ;)
8. This is the part it will differ per PC. The generic steps will be to shut down your computer, boot into BIOS with the flash drive, and change the boot order of your devices so your flash drive is first. You will need to look this up per PC. Common keys to hit on startup to get into BIOS include delete, F8, and F11. Do this research prior to booting up.
9. You will either be taken to a black menu with white text or a purpleish menu. Make sure that you select "Try Ubuntu" or "Try Ubuntu without Installing". If this option is not here, make sure you ask first.
10. Wait a little, and you will be brought to the Ubuntu desktop.
Image
It should look something SIMILAR to this. What you're looking for is the file cabinet, this is Ubuntu's file manager: Nautilus. It's comparable to explorer on Windows, except that it doesn't suck.
11. Look carefully over the left side pane, your hard drive SHOULD be listed here. If not, it doesn't hurt to click and try. If you see what looks like your internal C:\ drive, you're in luck! From here navigate into your Documents (or whatever else you need) and copy them to your other flash drive/external hard drive.
The common path for a user's home directory is usually C:\Users\<username>. The equivalent to that on here would be clicking on your harddrive, then clicking Users, then selecting your user.
12. NOTE! You literally have access to EVERY FILE ON YOUR SYSTEM AND YOU CAN IN FACT DELETE SYSTEM32. NOTHING WILL STOP YOU. USE SENSE, STAY SAFE. I'M NOT RESPONSIBLE FOR YOUR OWN LOSS OF DATA, BREAKING OF COMPUTER/OS. NADA. AND NEITHER ARE THE UBUNTU DEVS.
13. Once your done, you can use the gear in the top right corner to shut your computer down. If you really wanted to, you could install Ubuntu alongisde Windows or completely override it. That's another tutorial though!

I hope you guys find this guide useful, while not a new concept I was happy to write this guide for SMBX. Special thanks to Superiorstar for giving me the motivation to write this guide!

Re: File Recovery Using Linux on a Flash Drive

Posted: Fri Jun 26, 2015 9:00 pm
by Axiom
Using Mac OS X To Create Your Bootable Linux USB Drive

If your precious gaming PC master race crashed and all you have available to you is your "peasant" Mac (who mind you won't crash from viruses), then you're in luck. Replace any of the steps above using the Linux USB Installer with these steps below.

PROTIP: if I ask you to enter a path to a file, you can drag and drop the file onto say Terminal and the path will be inserted automagically. it's really one of the more powerful features of OS X that nobody seems to appreciate.

1. Download the ISO, as stated above (If you're unsure as to whether or not your PC is 64 bit, get the 32 bit one)
2. Open Terminal, either by Spotlight or by going into Applications/Utilities. Either way just get it open
3. You have to convert the iso into img, this is done using the hdutil command (the backend behind disk utility). For the command's example, let's say my ISO is saved to /Users/Mike/Desktop/ubuntu.iso
My command would look like this

Code: Select all

hdiutil convert -format UDRW -o /Users/Mike/Desktop/ubuntu.iso /Users/Mike/Desktop/ubuntu.img
After the -o, you can drag and drop in the ubuntu.iso file and it'll insert the path automatically. Then, after putting a space, you can drag it in again and just delete the .iso and replace it with .img. Then, hit enter.
4. Run the following command, without your flash drive in.

Code: Select all

diskutil list
5. Then, run it again with your flash drive in. Note the differences in the list, the difference/addition is your flash drive. For this example, I will pretend that my flash drive is mounted as /dev/disk2
6. Run the following command to ensure your flash drive is unmounted. Be sure to replace the 2 with your flash drive's number. Remember, I'm using /dev/disk2 as my example

Code: Select all

diskutil unmount /dev/disk2
7. Make sure your MacBook doesn't die or a power surge doesn't occur when running this command, it is possible to recover a flash drive if something goes wrong during this command but know that it is hard (but possible!). For the following command, I will be utilising my example values. Be SURE to fill in your values

Code: Select all

sudo dd if=/Users/Mike/Desktop/ubuntu.img of=/dev/rdisk2 bs=1m
Note the following
  • There is an r in front of disk2 on purpose: some have reported it is faster. If you get an error, try it without the r.
  • If you get an invalid number 1m, try changing it to 1M (it is case sensitive
  • If your drive is busy, try unmounting it through Disk Utility.app
8. After all this is done, run

Code: Select all

diskutil eject /dev/disk2
and you're good to go! Follow the tutorial from about step 8!

I CANNOT STRESS THIS ENOUGH: ALL THE COMMANDS I WROTE ARE USING EXAMPLE VALUES. PLEASE DO NOT PUT IN /DEV/DISK2 UNLESS YOU ARE 100% SURE THAT THAT IS YOUR FLASH DRIVE. YOU COULD SERIOUSLY SCREW SOMETHING UP IF YOU ARE NOT 100% SURE.
PLEASE BE 100% SURE