<!-- This whole topic should be combined with install-raw.html -->
<!--
TODO
- Test out dd to usb stick on mac. Confirm it writes on byte 0 of the drive.
- Does BeOS, Freebsd and others (which?) use fdisk -l (For USB KEY install).
- Reformat my steps to remove the 15pt margin between terminal style text
-->
<h1><aid="usb"name="usb">Installing on a USB flash drive</a></h1>
<ul>
<li><ahref="#unix">From a Unix system</a></li>
<li><ahref="#windows">From Windows</a></li>
</ul><br/>
<p>Booting Haiku from a USB memory stick is currently one of the best ways to test out the operating system. No changes will be made to your computer, so you can test a pre-Alpha OS without any worries. It is also the easiest method to install Haiku, so it is recommended for beginners. The installation process differs from a Unix system (This includes many operating systems like Linux, Mac OS X, FreeBSD and such) to that of Windows.</p>
<p> You will need a small USB memory stick (512MB should be more than enough) that you are ready to erase and a recent <ahref="http://haiku-files.org/raw/index.php">HDD raw image</a>. Note that these are test images, they are not complete distributions that include a lot of software. Future releases will include a more complete set of software, obviously. Your motherboard should also support booting from USB Drives (most recent computers do).</p>
<h2><aid="unix"name="unix">Using a Unix system (Linux, Mac OS X, FreeBSD etc.)</a></h2>
<p>Now that you've downloaded the raw image, you will need to expand this image on your USB Drive you intend to install it to. You will first need to know the name of your drive (something like <spanclass="path">/dev/sdb</span>, <spanclass="path">/dev/disk1</span> or a variant).</p>
<p>Now you need to use the <spanclass="cli">dd</span> tool to extract the raw image to your USB Key. Make sure you have the right drive selected here, since this will erase all data on the specified location. Recheck with a partition tool to verify for example. You might need administrative rights, so add the <spanclass="cli">sudo</span> or <spanclass="cli">su</span> command before the next step to run the process as administrator (a password will be required).</p>
<p><b>Note:</b><i>You will want to put the image at the absolute start of the drive, make sure that you write to the whole raw drive and not to a partition. You do that by specifying a raw device instead of a partition. Under Linux you would for example omit the partition number resulting in</i><spanclass="cli">sdb</span><i>instead of</i><spanclass="cli">sdb1</span><i>. Under BeOS you would pick the</i><spanclass="cli">.../raw</span><i>path instead of one with a number. If you use such a command, you overwrite the MBR containing the partition table of your USB memory stick. This means, that all the partitions on that drive will become inaccessible (not only the first part of the drive). So be sure that you want to do such a destructive operation!</i></p>
<p>Congratualtions! You have just installed Haiku to a USB memory stick. You can now restart your computer to boot from Haiku. Note that you will probably have to enable USB drive booting in your BIOS and change the hard drive boot priority order. If Haiku's splash screen stops in the middle of the icons, and then sends you to <i>Kernel Debug Land</i>, you might have to disable the <i>Plug and Play OS</i> option in your BIOS.</p>
<p>You will need basic knowledge of your command prompt to go through this step-by-step guide. You can type <spanclass="cli">help</span> inside your command prompt to get some information on the required navigation commands.</p>
<p><b>Note:</b><i>The <spanclass="app">Flashnul</span> website isn't in English. You can simply click on the "Download" link and then select the upper-most entry (the latest version) to download.</i></p>
<p>Extract your raw image zip file and the <spanclass="app">Flashnul</span> program in the same directory (ex. <spanclass="path">c:\haiku</span>). Rename the raw image's extension to <spanclass="cli">.img</span> (ex. <spanclass="cli">haiku.img</span>).</p>
<p>Open your command prompt (go to <spanclass="menu">Start > Run</span>, then type <spanclass="cli">cmd</span> and press <spanclass="key">ENTER</span>). You will see a black window with a blinking cursor, this is your command line editor (commonly named command prompt or shell).</p>
<p><b>Note:</b><i>If you are using Windows Vista, you will need administrator rights to see the available physical drives. To run the command prompt in administrator mode, go to </i>Start > All Programs > Accessories > Command prompt<i>, right click on the program and select </i>Run as Administrator.</p>
<p>You need to find the number of your USB flash drive. This is very important, because if you do not select the right drive, your whole hard drive <b><i>will be erased</i></b>. To find out your flashdrive's name, in the command prompt, type:</p>
<preclass="terminal">flashnul -p</pre>
<p>The output should resemble something like,</p>
<pre>Available physical drives:
0 size = 81961123328 (76 Gb)
<b>1 size = 1000341504 (954 Mb)</b></pre>
<p>You are now ready to extract the raw image over the memory stick. Make sure the number you have noted <i>is the one of your flash drive</i>. X being your memory stick's number, type:</p>
<preclass="terminal">flashnul X -L haiku.img</pre>
<p>Congratualtions! You have just installed Haiku to a USB memory stick. You can now restart your computer to boot from Haiku. Note that you will probably have to enable USB drive booting in your BIOS and change the hard drive boot priority order. If Haiku's splash screen stops in the middle of the icons, and then sends you to <i>Kernel Debug Land</i>, you might have to disable the option <i>Plug and Play OS</i> in your BIOS.</p>