Booting Linux From a Flash Drive For File Recovery
After a long time we are back to talk about some more cool tech stuff you can do with a USB flash drive. Today's topic will focus on booting the Linux OS from a USB stick. The purpose for booting Linux from a USB drive, at least the purpose of this guide, is to recover files from a broken install of the windows OS or any other OS for that matter. We can also run virus scans from the Linux distro securely without infecting other PC's or having to boot the infected PC.
What you will need:
* A USB stick anywhere from 512mb to 2GB (depending on the distro)
* A main board capable of booting from a usb device.
* and about 15 minutes plus download time.
Software to be used:
* Latest stable version of UNetbootin
Step # 1: Prepare the USB Drive
Once you have all your materials together go ahead and plug the USB drive in and backup all files you may have on the disk.
Step # 2: Installing to The USB
Start up UNetbootin and select the following:
1. Use the first radio button "Distribution". This will download and install, automatically, the distro we want.
2. Pick SystemRescueCD. We are going with this because it is easy the ntfs file system driver comes prepackaged so no additional customization is required.
3. Next select your flash drive.
NOTE: Be sure to select your flash drive and not your windows partition or primary partition, 'cause if you do then you will destroy the currently installed OS.
4. Finally click "Ok".
UNetbootin options to select are shown in an image in the source article located at the link at the bottom of this article.
Step # 3: Configuring Bios
We will need to setup your computer to boot from the USB stick. To do so first you mother board will need to support this feature and second you will need to do some configuration.
1. Reboot your computer and hit "F2 or" del "depending on your mother board to enter BIOS config.
2. Search for the section labeled boot sequence, or named similarly. This will sometimes be filed under a separate section like advanced BIOS features, or similar.
3. Move removable or USB to the top of the list. If you do not see these options listed your mother board most likely does not support USB boot. Consult Google for more info on this.
4. Reboot the computer with the drive plugged in.
Step # 4: Booting Linux
We are going to boot into command line for this guide. There are options to load a GUI for those of you who tremble in the face of CLI. I must warm you though Command Line is by far easier and faster.
1. Once your computer passes post you will see the boot loader screen. Navigate to "VMLinuz64" and hit enter.
After a bunch of OK's on the screen and most likely 1 red FAIL you will be at the prompt "root @ sysresccd / root%". This would indicate a success.
Step # 5: Copying files from a windows partition onto an external hard disk.
For this you will need an external medium on which to move your files have this ready to receive your data. You can also use the usb stick which you booted from, if of course there is enough space on it.
1. First we will need to identify our drives. I will assume you have two storage devices plugged in one being the flash drive and the other your windows hard drive. Execute the command below:
NOTE: To exit this output screen press "q".
2. Mount the windows drive so that we can access the files on it. Run the mount command below:
3. Lets find out if we mounted the right device now. Run:
4. Time to get our backup device out. Plug it in and wait a few seconds then run the fdisk command again:
Mount this device to the pre-made backup folder using the mount command again:
If you want to copy your entire windows drive to your back up drive run this command:
Additional Useful Commands:
* Sometimes a virus can infect the very first bit of code that is executed on your system the MBR (Master Boot Record). Luckily we can clean this up with relative ease in linux. Execute:
* Maybe you do not have an external device to back stuff up but you have another computer with a network share. Well lets mount that network share so we can copy files to it. Create a mount point:
To mount a share without a password use: