<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>USB flash drives, marketing, hobbies &#124; Ramblings from the brain of Nicholas Moller &#187; Booting</title>
	<atom:link href="http://www.usbtalk.net/tag/booting/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.usbtalk.net</link>
	<description>Flash drives, marketing ideas, photography, and my hobbies.</description>
	<lastBuildDate>Wed, 28 Dec 2011 22:28:45 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
		<item>
		<title>Booting Linux from a Flash Drive for File Recovery</title>
		<link>http://www.usbtalk.net/2009/12/booting-linux-from-a-flash-drive/</link>
		<comments>http://www.usbtalk.net/2009/12/booting-linux-from-a-flash-drive/#comments</comments>
		<pubDate>Tue, 22 Dec 2009 21:59:15 +0000</pubDate>
		<dc:creator>Nick</dc:creator>
				<category><![CDATA[Programs - Hardware - Testing - Errors]]></category>
		<category><![CDATA[Booting]]></category>
		<category><![CDATA[Linux USB Drive]]></category>
		<category><![CDATA[Recorver Windows Disks]]></category>
		<category><![CDATA[USB Boot]]></category>

		<guid isPermaLink="false">http://www.usbtalk.net/?p=141</guid>
		<description><![CDATA[Hello again, After a long time we are back to talk about some more cool tech stuff you can do with a USB flash drive. Todays 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 [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fwww.usbtalk.net%2F2009%2F12%2Fbooting-linux-from-a-flash-drive%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fwww.usbtalk.net%2F2009%2F12%2Fbooting-linux-from-a-flash-drive%2F&amp;source=usbmemorydirect&amp;style=normal&amp;hashtags=Booting,Linux+USB+Drive,Recorver+Windows+Disks,USB+Boot&amp;b=2" height="61" width="50" /><br />
			</a>
		</div>
<p>Hello again,</p>
<p>After a long time we are back to talk about some more cool tech stuff you can do with a USB flash drive. Todays 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&#8217;s or having to boot the infected pc.</p>
<p><strong>What you will need:</strong></p>
<ul>
<li>A USB stick anywhere from 512mb to 2GB (Depending on the distro)</li>
<li>A main board capable of booting from a usb device.</li>
<li>and about 15 minutes plus download time.</li>
</ul>
<p><strong>Software to be used:</strong></p>
<ul>
<li>Latest stable version of UNetbootin <a href="http://unetbootin.sourceforge.net/unetbootin-windows-latest.exe">Located Here.</a></li>
</ul>
<h2><strong><span style="text-decoration: underline;">Step #1: Prepare the USB Drive</span></strong></h2>
<p>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.</p>
<h2><span style="text-decoration: underline;"><strong>Step #2: Installing to The USB<br />
</strong></span></h2>
<p><span style="text-decoration: underline;"><strong> </strong></span>Start up UNetbootin and select the following:</p>
<ol>
<li>Use the first radio button &#8220;Distribution&#8221;. This will download and install, automatically, the distro we want.</li>
<li>Pick SystemRescueCD. We are going with this because it is easy the ntfs file system driver comes prepackaged so no additional customization is required.</li>
<li>Next select your flash drive.<br />
<span style="color: #ff0000;"><strong>NOTE: </strong>Be sure to select your flash drive and not your windows partition or primary partition, &#8217;cause if you do then you will destroy the currently installed OS</span>.</li>
<li>Finally click &#8220;Ok&#8221;.</li>
</ol>
<div id="attachment_139" class="wp-caption aligncenter" style="width: 542px"><img class="size-full wp-image-139" title="UNetbootin Main Screen" src="http://www.usbtalk.net/wp-content/uploads/2009/12/UNetbootin.gif" alt="UNetbootin options to select" width="532" height="394" /><p class="wp-caption-text">UNetbootin options to select</p></div>
<h2><span style="text-decoration: underline;">Step #3: Configuring Bios</span></h2>
<p>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.</p>
<ol>
<li>Reboot your computer and hit &#8220;F2&#8243; or &#8220;del&#8221; depending on your mother board to enter BIOS config.</li>
<li>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.</li>
<li>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.</li>
<li>Reboot the computer with the drive plugged in.</li>
</ol>
<h2><span style="text-decoration: underline;">Step #4: Booting linux</span></h2>
<p>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.</p>
<ol>
<li>Once your computer passes post you will see the boot loader screen. Navigate to &#8220;VMLinuz64&#8243; and hit enter.</li>
</ol>
<p>After a bunch of OK&#8217;s on the screen and most likely 1 red FAIL you will be at the prompt &#8220;root@sysresccd /root %&#8221;. This would indicate a success.</p>
<h2><span style="text-decoration: underline;">Step #5: Copying files from a windows partition onto an external hard disk.</span></h2>
<p>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.</p>
<ol>
<li>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:
<pre>fdisk -l | less</pre>
<p><span style="color: #ff0000;">NOTE: If you choose another distro of linux less may not be available, you may omit &#8221; | less&#8221; in such case.</span></p>
<p>This command will show you all the storage devices on your system. Use the down and up arrows to navigate the output as it may be larger than your screen. My output for this command is shown below:</p>
<pre>Disk /dev/sda: 160.0 GB, 160000000000 bytes
255 heads, 63 sectors/track, 19452 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0xd0f4738c

 Device      Boot      Start      End      Blocks       Id   System
/dev/sda1    *         1          19451    156240126    7    HPFS/NTFS

Disk /dev/sdb: 2085 MB, 2085617664 bytes
2 heads, 63 sectors/track, 32329 cylinders
Units = cylinders of 126 * 512 = 64512 bytes
Disk identifier: 0x00502bcd

Device       Boot      Start      End      Blocks     Id   System
/dev/sdb1    *         1          32330    2036720    6    FAT16</pre>
<p>My device is 160GB NTFS partition.  Knowing those two bits of info we can take an educated guess and say /dev/sda1 is our partition on the windows hard disk that we want to mount, the whole disk can be referenced by /dev/sda. Using /dev/sda in a mount command will most likely fail, you will need to use /dev/sda1.</p>
<p><span style="color: #ff0000;">NOTE: To exit this output screen press &#8220;q&#8221;.<br />
</span></li>
<li>Mount the windows drive so that we can access the files on it. Run the mount command below:
<pre>mount /dev/sda1 /mnt/windows</pre>
<p><span style="color: #ff0000;">NOTE: you will need to replace &#8220;/dev/sda&#8221; with your device found from the output of fdisk -l. It is likely though that they will be the same. Also note that mount will fail if you attempt to mount to a folder that doesn&#8217;t exist.</span></p>
<p>If you want full read write capability for the windows hard disk and are using SystemRescueCD distro run the following command:</p>
<pre>ntfs-3g /dev/sda1 /mnt/windows</pre>
<p>This command will also work on other distros if you have ntf-3g included/installed.</li>
<li>Lets find out if we mounted the right device now. Run:
<pre>ls /mnt/windows</pre>
<p>This command will list the files and folders in a directory. If you see the tell tale Program Files and WINDOWS directories it was successfully mounted.</li>
<li>Time to get our backup device out. Plug it in and wait a few seconds then run the fdisk command again:
<pre>fdisk -l</pre>
<p>or</p>
<pre>cat /proc/partitions</pre>
<p><span style="color: #ff0000;">NOTE: Running &#8220;cat /proc/partitions&#8221; will list all partitions. Be sure to mount the correct partition on the device. Usually these are /dev/sdc1 or /dev/sde1 and not /dev/sdc or /dev/sde.</span></p>
<p>Partitions not followed by numbers are usually the device itself and therefor cannot be mounted. Bellow is the output of &#8220;cat /proc/partitions&#8221; our backup device is /dev/sdc1. All devices are stored in /dev/ therefor we know that the location of the ones in the list below are /dev/xxx.</p>
<pre>major minor  #blocks  name

 8     0  168234527  sda
 8     1  156240126  sda1
 8    16    2086584  sdb
 8    32    2036720  sdb1
 8    48  244198584  sdc
 8    49  238155561  sdc1</pre>
<p>You should see both devices you saw last time and now a new one should be there. Match the size of the device to yours and note the device location most likely /dev/sdc.<br />
Mount this device to the pre-made backup folder using the mount command again:</p>
<pre>mount /dev/sdc1 /mnt/backup</pre>
</li>
<li>Now it is time to copy things from the old windows drive to the backup disk.<br />
If you want to copy your entire windows drive to your back up drive run this command:</p>
<pre>cp -R /mnt/windows/* /mnt/backup/YOUR_FOLDER_NAME</pre>
<p>If you plan on copy single files type the full file path and then the full destination path.</li>
</ol>
<h2><span style="text-decoration: underline;">Additional Useful Commands:</span></h2>
<ul>
<li>Sometimes a virus can infected 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:
<pre>dd if=/dev/zero of=/dev/sdb bs=512 count=1</pre>
<p>Remember to replace &#8220;/dev/sdb&#8221; with your device cause if you miss and clean the wrong one you may have some issues. In this case we want the actual device and not a partition on the device so we are selecting /dev/sdb and not /dev/sdb1 since writing to /dev/sdb1 wouldn&#8217;t start at block #0.</li>
<li>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:
<pre>mkdir /mnt/network</pre>
<p>Mount the share:</p>
<pre>mount -t smbfs //computername/folder /mnt/network -o username=user1,password=mypasshere</pre>
<p>Now you can copy and move files to the network share just like any other directory.<br />
To mount a share without a password use:</p>
<pre>mount -t smbfs //computername/folder /mnt/network</pre>
</li>
<li>For now this little section is finish although I am sure there will be additional things added as people leave comments.</li>
</ul>
<p>Until Next Time</p>
<p>-Nick</p>
]]></content:encoded>
			<wfw:commentRss>http://www.usbtalk.net/2009/12/booting-linux-from-a-flash-drive/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

