个人工具

“UbuntuHelp:Installation/FromUSBStick”的版本间的差异

来自Ubuntu中文

跳转至: 导航, 搜索
 
(未显示2个用户的15个中间版本)
第1行: 第1行:
 
{{From|https://help.ubuntu.com/community/Installation/FromUSBStick}}
 
{{From|https://help.ubuntu.com/community/Installation/FromUSBStick}}
{{Languages|php5}}
+
{{Languages|UbuntuHelp:Installation/FromUSBStick}}
== Installing Ubuntu from a Flash Drive ==
+
== Outline ==
 +
The recommended way to install Ubuntu 9.10 from a USB flash drive is to use the usb-creator program, point it at a CD ISO image, and let it create a bootable USB that you can use instead of the CD.
 +
<ol><li>Acquire the correct Ubuntu installation files and tools
 +
</li><li>Put Ubuntu onto your USB drive
 +
</li><li>Configure your computer to boot from USB drive and boot from it
 +
</li><li>Try Ubuntu or install to your hard drive.</li></ol>
  
This pages describes how to install Ubuntu (Drapper Drake, 6.06 LTS) by copying the contents of the alternative installation CD to an USB memory stick (aka flash drive) and making the stick bootable. This is handy for machines that do not have a CD drive but can boot from USB media.
+
== Introduction ==
 +
This page gives instructions on how to run Ubuntu from a USB flash drive for installation or to try it out.  This may be necessary for netbooks and other computers without CD drives and is handy for others because a USB flash drive is so convenient.  The Ubuntu 9.10 CD/DVD ISO images come with the necessary Windows and Linux utilities to get the system on a USB drive.
 +
For custom, manual, older versions, and technical instructions and troubleshooting see [[UbuntuHelp:USB Installation Media|USB Installation Media]].  There are also network installation options available.  You can also see the [https://help.ubuntu.com/9.04/installation-guide/i386/boot-usb-files.html instructions for USB drives] from the official Install Guide.
 +
Note: This article uses the terms USB stick, USB drive, thumb drive and flash drive interchangeably.
 +
== Known Issues ==
 +
The 9.10 CDs and DVDs are missing the usb-creator.exe program used by the Windows installation processes discussed below. To install the i386 desktop version to a flash drive from a disk image on Windows, use the incredibly easy process described at [http://www.pendrivelinux.com/create-a-ubuntu-9-10-live-usb-in-windows/ http://www.pendrivelinux.com/create-a-ubuntu-9-10-live-usb-in-windows/] . When you boot the resulting live persistent USB, you can install to your hard disk if you wish at any time, or not.
 +
If you just get a black screen when running from USB, using the setting "Discarded on shutdown, unless you save them elsewhere" in usb-creator might help. [http://forum.eeeuser.com/viewtopic.php?pid=658619 Forum: 9.10 NBR issues]
 +
9.10 Netbook Remix does not bring up Broadcom WIFI automatically. Poll and install a few packages manually with dpkg to get networking up.  https://bugs.launchpad.net/ubuntu/+source/jockey/+bug/449268
 +
If you get "Incorrect CD-ROM detected" error on detection stage, reboot, press F6 and then ESC to go to manual boot line editing, and add the option 'cdrom-detect/try-usb=true'. On Ubuntu 9.10 server edition the install menu will be shown right after reboot. Chose "Help" and then press F6. At the boot prompt type "install cdrom-detect/try-usb=true" and hit enter.
 +
Some BIOS's (eg., the Eee PC netbook') have trouble recognizing that the USB is bootable. You may have to trick it into booting using the following method: At boot, enter the BIOS by pressing F2. Then, right as you exit the BIOS, hit the Esc key. For some systems, this will bring up the boot menu.
 +
"Can not mount /dev/loop1 on /cow" message because usb-creator.exe is not creating a valid casper-rw file holding ext2/ext3 filesystem. Fix: After running usb-creator.exe, recreate casper-rw using cygwin tools or http://www.pendrivelinux.com/casper-rw-creator-make-a-persistent-file-from-windows/. (As of April 2010)
 +
There is an unresolved issue in that you cannot create a bootable USB stick from within Mac OSX.  You must create the stick in Linux or Windows.
 +
== Prerequisites ==
 +
=== Source machine ===
 +
==== Windows ====
 +
* Virtual Clone Drive or other ISO-reading software (or Ubuntu installation CD)
 +
==== Mac OS X ====
 +
* Administrator privileges on computer used to set up thumb drive
 +
==== Linux ====
 +
* Administrator privileges on computer used to set up thumb drive
 +
* Install and run usb-creator
 +
=== Target machine ===
 +
==== Netbook ====
 +
* 1GB thumb drive with everything backed up elsewhere, because these commands will over write the partition table.
 +
* ISO image file, or CD and another computer ubuntu-netbook-remix ISO, or kubuntu-netbook ISO, or
 +
* Optional, large capacity SD card for storing ISO and or backing up data
 +
==== Desktop or Server ====
 +
* 2GB thumb drive, or just do network install
 +
=== Ubuntu CD or ISO ===
 +
Ubuntu
 +
* Netbook: http://www.ubuntu.com/getubuntu/download-netbook
 +
* 32bit/64bit: http://www.ubuntu.com/getubuntu/download
 +
Derivatives
 +
* http://www.ubuntu.com/products/whatisubuntu/derivatives
 +
Get a disk from a friend, download, order one ... etc.
 +
== Copying Files to USB Stick ==
 +
=== From Ubuntu Linux ===
 +
* The usb-creator utility can be installed using [[UbuntuHelp:SynapticHowto|Synaptic|Package Manager]] if not already present on your system. Some people have problems with usb-creator. You can also install and use UNetbootin to do the same thing.
 +
* Run usb-creator
 +
* Top pane, you will have to click "other", locate and select the ISO image
 +
* Plug the to-be-nuked USB stick into the computer, it should show up in the bottom pane titled "USB disk to use".  (You may have to use [[UbuntuHelp:GParted|GParted]] to format the USB Stick--I used 'ext3' as the format and it worked.)
 +
* Make sure you have the correct device selected before proceeding to create a USB startup disk!
 +
* There may be bugs during the formatting which will show up as two partitions when booting from the USB stick. Try selecting each of them and one should work. If not, restart the computer and try booting from the USB stick again.
 +
If you get a DBus error with usb-creator, this bug report may be helpful: https://bugs.launchpad.net/ubuntu/+source/usb-creator/+bug/458334
 +
=== From Windows ===
 +
You can use Unetbootin to create a bootable usb drive. http://unetbootin.sourceforge.net/
 +
You won't be able to select the USB drive if it wasn't formatted in a way that Windows can see it.  You may have to format it using explorer, then it will show up in the creator tool.
 +
Versions of Ubuntu before Ubuntu 9.10 (Karmic Koala) included a file called usb-creator.exe in the CD image. To install one of these versions, download the ISO file and burn the Ubuntu ISO file to a disk or mount the ISO file in a virtual drive to access the files within the image. You can also use [http://www.7-zip.org/ 7Zip] to extract the ISO so you can work with the files inside.
 +
== Booting the Computer From USB ==
 +
Most newer computers can boot from USB. If your computer does not automatically do so, you might need to edit the BIOS settings.
 +
Restart your computer, and watch for a message telling you which key to press to enter the BIOS setup. It will usually be one of F1, F2, DEL, ESC or F10. Press this key while your computer is booting to edit your BIOS settings. (On HP Mini Netbooks, they correct key is usually F9.)
 +
You need to edit the Boot Order. Depending on your computer, and how your USB key was formatted, you should see an entry for "removable drive" or "USB media". Move this to the top of the list to force the computer to attempt to boot from USB before booting from the hard disk.
 +
== Alternative method ==
 +
Some computers can see the USB thumb drive and have the option to boot from USB but cannot actually boot from USB. All hope is not lost.
 +
=== Requirements ===
 +
* Windows running on the computer
 +
* USB drive, ready to boot (shown below)
 +
* PLoP Boot Manager - Your alternative USB boot method (http://www.plop.at/en/bootmanager.html#runwin)
 +
Just follow the instructions on the PLop website.
 +
Note: When you use this method, the files on the USB drive are changed during boot. To use this method more than once, you must delete all files from the USB drive and prepare the USB drive again as described below.
 +
=== Creating a bootable USB Drive ===
 +
* Check the USB drive for files and back them up if needed, all contents will be destroyed.
 +
* A minimum of 1GB space is required for a netbook install. Other install types may require more space.
 +
* The Windows utility won't let you select the USB drive if the drive isn't properly formatted and mounted.
 +
Booting from a USB drive created with this utility will behave just as if you had booted from the install CD.  It will show the language selection and then the install menu, from which you can install Ubuntu onto the computer's hard drive or launch the [[UbuntuHelp:LiveCD|LiveCD]] environment.
 +
==== Linux ====
 +
The Ubuntu USB desktop image creator is available in the package '''usb-creator''', '''usb-creator-kde''' on Kubuntu, or '''usb-creator-gtk''' on 9.10.
 +
From the 8.10 release on (9.10 on for Kubuntu), Ubuntu includes the usb-creator by default on all [[UbuntuHelp:LiveCD|LiveCD]]s and installations.
 +
You can find it in System-->Administration-->Create a USB startup disk (Ubuntu Desktop) or K-Menu-->Applications-->System-->USB Startup Disk Creator (Kubuntu), if it is not there then run the following command in the Terminal :
 +
<pre><nowiki>
 +
sudo apt-get install usb-creator
 +
</nowiki></pre>
 +
Make sure the software-sources are activated if you are on a [[UbuntuHelp:LiveCD|LiveCD]]
 +
(software sources or `sudo gedit /etc/apt/sources.list`).  You may need to install the python-gnome2 package as well.
 +
It should do everything needed you just need to have a [[UbuntuHelp:LiveCD|LiveCD]] in you CD-Rom or show the usb-creator the ISO image of it and the rest of the process is automatic! (for more info on how to use this tool by just popping in a [[UbuntuHelp:LiveCD|LiveCD]] to a drive in a computer running Ubuntu desktop see "Live USB creator" below, note that it also works with downloaded .iso images).
 +
If the progress bar proceeds very slowly (1% every 10 seconds or so) you may want to make sure your USB stick is mounted without the "sync" option.  This seems to work around [https://bugs.launchpad.net/ubuntu/+source/usb-creator/+bug/313364 single-byte writes bug] in Jaunty's usb-creator.
 +
{{https://wiki.kubuntu.org/Kubuntu/Netbook?action=AttachFile&do=get&target=screenshot-usb-creator.png}}
 +
==== Windows ====
 +
This method is recommended if you are creating Linux installation to coexist with your existing Windows installation.
 +
* Find a usb-creator app and run it
 +
== Installing Ubuntu directly on a USB Flash drive ==
 +
In order to install a fully working Ubuntu operating system on your USB Flash drive make sure that:
 +
* Your Flash Drive has more than 2GB of memory
 +
* Your Flash Drive is bootable
 +
* Your Flash Drive has a high read/write speed and is USB 2.0 enabled
 +
The process is described in detail in an [http://iwebdevel.com/2010/02/13/how-to-install-portable-linux-ubuntu-on-a-bootable-usb-flash-drive-from-sun-virtualbox/ external source].
 +
== 9.04 and Earlier .img for Netbook ==
 +
If you have downloaded an .img file, please refer to the [[UbuntuHelp:Installation/FromImgFiles|.img writing documentation]]
 +
== Create Bootable USB Manually  ==
 +
Here is a way to create bootable USB manually. The advantage is you don't have to empty your USB as long as you have enough space for the files. Also it allow multi boot, so you can have your USB holding both 32bits and 64bits Ubuntu and so other Boot CD tool.
 +
In order to do so you need :
 +
* Bootable Flash Drive ( NTFS / FAT32 / FAT 16 ), Disk with MBR, you can do this with gparted in linux or HP format in Win, fdisk ....etc
 +
* Ubuntu ISO of your choice
 +
* Tools to extract files in the ISO ( ISO Mount, WinZIP, WinRAR, 7Zip, etc....)
 +
* Grub4Dos
 +
<ol><li>[http://grub4dos.sourceforge.net/wiki/index.php/Grub4dos_tutorial Grub4DOS' Tutorial]
 +
</li><li>[http://download.gna.org/grub4dos/grub4dos-0.4.4-2009-06-20.zip  Grub4DOS 0.4.4 for WIN9x/DOS/Linux(Download Here)]
 +
</li><li>[http://download.gna.org/grubutil/grubinst-1.1-src-2008-01-01.zip  Grub4DOS GUI for WINXP/Vista/7]</li></ol>
  
  ''I also succeeded in installing on a Libretto 100CT
+
First you need to install grub on to the USB's MBR. Follow the link to the Grub4DOS Wiki:
  by using a 2.5" IDE disk in one of those cheap USB cradles.
+
Simple example:
  This machine has no CD-ROM, no floppy (on my unit), no USB.
+
<pre><nowiki>
  I've taken the liberty to annotate my experiences in an indented style, like this.
+
./bootlace /dev/sdx
  -- Ubuntu:Era''
+
</nowiki></pre>
  ''I installed on an IBM X40 using the contents of the mini.iso for edgy on a USB stick instead of using the iso for the bulkier alternate CD. I only
+
For more details, visit:  
  had to install syslinux and rename isolinux.cfg to syslinux.cfg (I didn't have to change the contents
+
[http://grub4dos.sourceforge.net/wiki/index.php/Installation]
  of the file).
+
Next, you open up the ISO file and extract the files in casper directory.
  It was very easy. I didn't have to try fooling the installer into thinking the stick was the CD
+
<pre><nowiki>
  and mess with symlinks etc.
+
total 701060
  -- MikkelErup''
+
-rwxrwxrwx 2 adrian adrian 704487424 2010-04-29 05:38 filesystem.squashfs*
 
+
-rwxrwxrwx 1 adrian adrian   9365872 2010-04-29 05:34 initrd.lz*
  ''I succeeded installing Ubuntu 7.04 (Feisty) with this guide and
+
-rwxrwxrwx 1 adrian adrian   4029792 2010-04-16 06:01 vmlinuz*
  just a few changes I added. Ubuntu is running stable and without any
+
/media/Fujitsu 60GB USB/bootimg/ubuntu.10.4.x86$
  problems -- Boo''
+
</nowiki></pre>
 
+
Copy grldr to the root of the drive.
In short here's what you do:
+
<pre><nowiki>
 
+
drwx------ 1 adrian adrian  4096 2010-05-05 16:49 bootimg/
* Make the USB flash drive bootable using SYSLINUX.
+
-rwxrwxrwx 1 adrian adrian 220049 2009-09-24 17:30 grldr*
* Copy the contents of the Ubuntu CD to your flash drive (make sure you include hidden files/directories).
+
-rwxrwxrwx 1 adrian adrian  2760 2010-05-04 23:08 menu.lst*
* Copy some files from sub-directories to the root directory.
+
/media/Fujitsu 60GB USB$
* Rename the file <code><nowiki>isolinux.cfg</nowiki></code> to <code><nowiki>syslinux.cfg</nowiki></code> and edit it a bit.
+
</nowiki></pre>
* Boot the computer from your USB flash drive.
+
Now create menu.lst at the root of USB.
* Create a fake cdrom drive and mount the flash drive to <code><nowiki>/cdrom</nowiki></code> during the Ubuntu installation process.
+
Example of menu.lst:
 
+
<pre><nowiki>
=== Checking your USB stick ===
+
default /default
 
+
title Ubuntu 10.04 LiveCD
Booting from USB memory sticks is neat, but there is no guarantee that it works with your particular combination of computer and USB stick. Even if you are able to boot from your flash drive on one computer, this does not mean that it is going to work with the next one. You can try experimenting with different settings in your PC's BIOS to make it work.
+
find --set-root /bootimg/ubuntu.10.4.x86/initrd.lz
 
+
kernel /bootimg/ubuntu.10.4.x86/vmlinuz boot=casper live-media-path=/bootimg/ubuntu.10.4.x86/ ignore_uuid
Since you will want to fit all of the Ubuntu installation CD onto the flash drive, make sure to pick one that is large enough to hold the contents of the installation CD. Since you will use SYSLINUX to make the flash drive bootable, make sure that it is formatted with a FAT16 filesystem. (SYSLINUX does not support booting from partitions formatted with  the FAT32 filesystem according to the SYSLINUX documentation.) Luckily most USB flash drives come formatted with a FAT16 filesystem to begin with, so there is probably nothing to work about. A flash drive with 1 GB capacity would be perfect. :-)
+
initrd /bootimg/ubuntu.10.4.x86/initrd.lz
 
+
boot
''As of version 3.00, FAT32 is supported by SYSLINUX.''
+
</nowiki></pre>
 
+
Make sure the path match where the files you copy to.
=== Making your flash drive bootable with SYSLINUX ===
+
Now, reboot.
 
+
[[category:CategoryLive]] [[category:CategoryInstallation]] [[category:CategoryInstallation]] [[category:CategoryInstallation]]
SYSLINUX is a boot loader that operates off an MS-DOS/Windows FAT filesystem. Most USB flash drives come with a FAT filesystem. Here's how you can add a SYSLINUX bootblock to your USB stick:
+
 
+
# Make sure that "syslinux" and "mtools" is installed. If they are not, install them. SYSLINUX is available for both Linux and Windows. For more information check the SYSLINUX homepage: http://www.syslinux.org/
+
# Attach your USB flash drive to your computer and mount it. This may happen automatically. If you are using Linux and it does not get mounted automatically, you can mount it by using a command such as <code><nowiki>mount -t vfat /dev/sda1 /mnt </nowiki></code>. Note the mountpoint (i.e. <code><nowiki>/mnt</nowiki></code> in the example. If you are using Windows, it should get mounted automatically. (If it doesn't your version of Windows is probably pretty old, and you'll need to install a driver for the USB stick first. Check the vendor's homepage.) Note the drive letter that Windows assigns to it (for example <code><nowiki>F:</nowiki></code>).
+
# Make the flash drive bootable. If you're using Linux and your flash drive is mounted as in the above example, use: <code><nowiki>syslinux -s /dev/sda1</nowiki></code>. If you are using Windows and the flash drive has the letter <code><nowiki>F:</nowiki></code> assigned to it as in the above example, use: <code><nowiki>syslinux -s F:</nowiki></code>
+
# You should see a new file called <code><nowiki>ldlinux.sys</nowiki></code> in the root directory of your flash drive. (Note that it is a hidden file, you might not see it in Windows Explorer; try <code><nowiki>dir /a F:</nowiki></code> from a command prompt). Now you can boot from your USB stick. Read on once you get a SYSLINUX message and a ""boot:"" prompt.
+
 
+
''Please note: This is a bit confusing in Windows.  All you see when you open the archive is source code, which might make you think you need MinGW to compile it.  You don't.  Go into \win32\ inside the archive and syslinux.exe is in there. --starkruzr''
+
 
+
  ''Regarding the IDE disk: When in the USB cradle, the disk is sda,
+
  whereas when I mount it in the Libretto as the primary IDE disk,
+
  it is of course hda.
+
   (I shot myself in the foot a couple of times because of this ...)''
+
 
+
  ''I partitioned the disk for installation with room for several boot images.
+
  I created <code><nowiki>hda1</nowiki></code> for <code><nowiki>/boot</nowiki></code> (in retrospect, maybe not necessary),
+
  <code><nowiki>hda2</nowiki></code> for swap (again in retrospect, could go in an extended partition;
+
  if I do it again I'll add the good old Woody installer <code><nowiki>rescue288</nowiki></code> disk image
+
  -- still viable and valuable as a rescue disk!),
+
  <code><nowiki>hda3</nowiki></code> for the Dapper 6.06 server install CD filesystem
+
   (this is a low-memory system which can't boot the regular live CD, I have been told),
+
  and <code><nowiki>hda4</nowiki></code> as an extended partition for the remaining BIOS hibernation and
+
  actual root filesystem partitions.''
+
 
+
  ''At this stage, I only marked the installer partition as bootable.
+
  It's a FAT16 partition (partition type 06).''
+
 
+
  ''Since there is no filesystem yet, the newly created partition needs to be formatted.
+
  <code><nowiki>mkfs -t vfat /dev/sdXY</nowiki></code> ... and be real careful to not format the wrong disk by mistake.
+
  (So in my case, this would be <code><nowiki>sda3</nowiki></code> here.)''
+
 
+
  ''No need to mount any other partitions than <code><nowiki>hda3</nowiki></code>/<code><nowiki>sda3</nowiki></code>)
+
  although Ubuntu will in fact automatically try to mount all the ones which
+
  have a filesystem on them.
+
  Actually, I momentarily unplugged and then replugged the USB cable at this point
+
  to make sure the partition table was synced OK, and then the new partition
+
  was automatically mounted on <code><nowiki>/media/usbdisk</nowiki></code>
+
  (and <code><nowiki>usbdisk-1</nowiki></code>, <code><nowiki>usbdisk-2</nowiki></code> etc for additional partitions or devices
+
  ... <code><nowiki>mount</nowiki></code> with no arguments will tell you what's where, if you're unsure).''
+
 
+
  ''The automatic mounting is a bit distracting at times. My recommendation would be
+
  to <code><nowiki>pumount</nowiki></code> any device you intend to do any low-level operations on,
+
  and then <code><nowiki>mount</nowiki></code> and <code><nowiki>unmount</nowiki></code> as root as necessary. -- Ubuntu:Era''
+
 
+
=== Copying the Ubuntu CD to your flash drive ===
+
 
+
Copy the ''contents'' of the Ubuntu installation CD to your flash drive (i.e. all files and directories that are on the installation CD). Please do ''not'' copy an ISO image of the installation CD file to your flash drive.
+
 
+
Make sure you copy hidden files and directories (eg. ones with names beginning with a ".").
+
 
+
You can use the following command from a Windows command prompt to make sure that all hidden and system files are copied, assuming that D: is your CD-ROM drive and F: is the USB stick:
+
 
+
<code><nowiki>xcopy /e /h /k d:\*.* f:</nowiki></code>
+
 
+
=== Move files to the root directory ===
+
 
+
Copy (or move) all the files from the following directories to your USB flash drive's  root directory:
+
 
+
* isolinux
+
* install
+
 
+
=== Move dapper to stable ===
+
 
+
Rename the directory <code><nowiki>dists/dapper</nowiki></code> to <code><nowiki>dists/stable</nowiki></code>.
+
 
+
  ''I think this depends slightly on which CD and which installer you're using.
+
  I've had problems when <code><nowiki>dists/dapper</nowiki></code> was missing and when <code><nowiki>dists/stable</nowiki></code>
+
  was missing and I'm not sure what the circumstances were.
+
  When it happens, just switch to a shell and rename it on the fly,
+
  then return to the installer and ask it to retry.
+
  (The <code><nowiki>vfat</nowiki></code> filesystem doesn't support symlinks, unfortunately.
+
  If you have spare disk space and a little patience, you could copy
+
  one to the other for the total belt and suspenders solution.) -- Ubuntu:Era''
+
 
+
  ''For anyone trying to install the new Ubuntu 7.04 (Feisty) with this guide: You can
+
  skip this step. In fact, it doesn't matter if you delete the file named <code><nowiki>dists/stable</nowiki></code>
+
  and rename the <code><nowiki>dists/feisty</nowiki></code> to <code><nowiki>dists/stable</nowiki></code>. -- Boo''
+
 
+
=== Editing SYSLINUX.CFG ===
+
 
+
Copy (or rename) the file <code><nowiki>isolinux.cfg</nowiki></code> to <code><nowiki>syslinux.cfg</nowiki></code>. Then edit the file and remove the <code><nowiki>/casper/</nowiki></code> or <code><nowiki>/install/</nowiki></code> reference in all paths. For example you would change the line containing <code><nowiki>DEFAULT /casper/vmlinuz</nowiki></code> to <code><nowiki>DEFAULT vmlinuz</nowiki></code>. Save the file, and make sure it is called <code><nowiki>syslinux.cfg</nowiki></code>. It does not matter whether the line breaks are in DOS or Linux format.  
+
 
+
  ''Again, for anyone installing Ubuntu 7.04 (Feisty):
+
  Just remove the <code><nowiki>/install/</nowiki></code> reference. The only line it is found is
+
  <code><nowiki>kernel /install/mt86plus</nowiki></code>, which must be changed to <code><nowiki>kernel /mt86plus</nowiki></code>. -- Boo''
+
 
+
=== Booting from the flash drive ===
+
 
+
Boot the computer that you want to install Ubuntu on from the USB stick. It should work as if you'd be booting it from the installation CD.
+
 
+
=== Mounting the flash drive as /cdrom ===
+
 
+
Switch to the second virtual console during the first couple of dialogs (when asked about your preferred language for the installation etc.) by pressing the ""ALT-2"". Do the following:
+
* <code><nowiki>mkdir /cdrom /dev/cdroms</nowiki></code>
+
* <code><nowiki>cd /dev/cdroms</nowiki></code>
+
* <code><nowiki>ln -s ../sda1 cdrom0</nowiki></code> (where sda1 is your USB stick)
+
* <code><nowiki>mount -t vfat /dev/cdroms/cdrom0 /cdrom</nowiki></code>
+
Then switch back to the first virtual console by pressing ""ALT-1"". Continue installing Ubuntu as if you were running from CD.
+
 
+
  ''This was a bit tricky until I got the hang of it.
+
  You need to have the hardware detection detect your <code><nowiki>hda</nowiki></code> before you can mount it!
+
  But just wait until it complains about a missing CD-ROM, then
+
  ''don't'' try to helpfully tell it where to look.
+
  Just accept the dialog where it says that this stage failed, ''then''
+
  switch over to the virtual console and <code><nowiki>mount -t vfat /dev/hda3 /cdrom</nowiki></code>.
+
  (I skipped the gyrations with <code><nowiki>/dev/cdroms</nowiki></code>, they don't seem to be necessary.)
+
  Back in the installer, you should now be able to proceed from the next point in the dialog.
+
  (Remember, I'm talking about the text-only installer. It might be different in the GTK install.)
+
  -- Ubuntu:Era''
+
 
+
    I think just ran into https://launchpad.net/distros/ubuntu/+source/casper/+bug/63277
+
    -- Ubuntu:SvenHerzberg
+
 
+
  ''When installing Ubuntu 7.04 (Feisty), there was no need for me to mount
+
  the flash. -- Boo''
+
  
 
[[category:UbuntuHelp]]
 
[[category:UbuntuHelp]]

2010年5月19日 (三) 22:50的最新版本


Outline

The recommended way to install Ubuntu 9.10 from a USB flash drive is to use the usb-creator program, point it at a CD ISO image, and let it create a bootable USB that you can use instead of the CD.

  1. Acquire the correct Ubuntu installation files and tools
  2. Put Ubuntu onto your USB drive
  3. Configure your computer to boot from USB drive and boot from it
  4. Try Ubuntu or install to your hard drive.

Introduction

This page gives instructions on how to run Ubuntu from a USB flash drive for installation or to try it out. This may be necessary for netbooks and other computers without CD drives and is handy for others because a USB flash drive is so convenient. The Ubuntu 9.10 CD/DVD ISO images come with the necessary Windows and Linux utilities to get the system on a USB drive. For custom, manual, older versions, and technical instructions and troubleshooting see USB Installation Media. There are also network installation options available. You can also see the instructions for USB drives from the official Install Guide. Note: This article uses the terms USB stick, USB drive, thumb drive and flash drive interchangeably.

Known Issues

The 9.10 CDs and DVDs are missing the usb-creator.exe program used by the Windows installation processes discussed below. To install the i386 desktop version to a flash drive from a disk image on Windows, use the incredibly easy process described at http://www.pendrivelinux.com/create-a-ubuntu-9-10-live-usb-in-windows/ . When you boot the resulting live persistent USB, you can install to your hard disk if you wish at any time, or not. If you just get a black screen when running from USB, using the setting "Discarded on shutdown, unless you save them elsewhere" in usb-creator might help. Forum: 9.10 NBR issues 9.10 Netbook Remix does not bring up Broadcom WIFI automatically. Poll and install a few packages manually with dpkg to get networking up. https://bugs.launchpad.net/ubuntu/+source/jockey/+bug/449268 If you get "Incorrect CD-ROM detected" error on detection stage, reboot, press F6 and then ESC to go to manual boot line editing, and add the option 'cdrom-detect/try-usb=true'. On Ubuntu 9.10 server edition the install menu will be shown right after reboot. Chose "Help" and then press F6. At the boot prompt type "install cdrom-detect/try-usb=true" and hit enter. Some BIOS's (eg., the Eee PC netbook') have trouble recognizing that the USB is bootable. You may have to trick it into booting using the following method: At boot, enter the BIOS by pressing F2. Then, right as you exit the BIOS, hit the Esc key. For some systems, this will bring up the boot menu. "Can not mount /dev/loop1 on /cow" message because usb-creator.exe is not creating a valid casper-rw file holding ext2/ext3 filesystem. Fix: After running usb-creator.exe, recreate casper-rw using cygwin tools or http://www.pendrivelinux.com/casper-rw-creator-make-a-persistent-file-from-windows/. (As of April 2010) There is an unresolved issue in that you cannot create a bootable USB stick from within Mac OSX. You must create the stick in Linux or Windows.

Prerequisites

Source machine

Windows

  • Virtual Clone Drive or other ISO-reading software (or Ubuntu installation CD)

Mac OS X

  • Administrator privileges on computer used to set up thumb drive

Linux

  • Administrator privileges on computer used to set up thumb drive
  • Install and run usb-creator

Target machine

Netbook

  • 1GB thumb drive with everything backed up elsewhere, because these commands will over write the partition table.
  • ISO image file, or CD and another computer ubuntu-netbook-remix ISO, or kubuntu-netbook ISO, or
  • Optional, large capacity SD card for storing ISO and or backing up data

Desktop or Server

  • 2GB thumb drive, or just do network install

Ubuntu CD or ISO

Ubuntu

Derivatives

Get a disk from a friend, download, order one ... etc.

Copying Files to USB Stick

From Ubuntu Linux

  • The usb-creator utility can be installed using Synaptic|Package Manager if not already present on your system. Some people have problems with usb-creator. You can also install and use UNetbootin to do the same thing.
  • Run usb-creator
  • Top pane, you will have to click "other", locate and select the ISO image
  • Plug the to-be-nuked USB stick into the computer, it should show up in the bottom pane titled "USB disk to use". (You may have to use GParted to format the USB Stick--I used 'ext3' as the format and it worked.)
  • Make sure you have the correct device selected before proceeding to create a USB startup disk!
  • There may be bugs during the formatting which will show up as two partitions when booting from the USB stick. Try selecting each of them and one should work. If not, restart the computer and try booting from the USB stick again.

If you get a DBus error with usb-creator, this bug report may be helpful: https://bugs.launchpad.net/ubuntu/+source/usb-creator/+bug/458334

From Windows

You can use Unetbootin to create a bootable usb drive. http://unetbootin.sourceforge.net/ You won't be able to select the USB drive if it wasn't formatted in a way that Windows can see it. You may have to format it using explorer, then it will show up in the creator tool. Versions of Ubuntu before Ubuntu 9.10 (Karmic Koala) included a file called usb-creator.exe in the CD image. To install one of these versions, download the ISO file and burn the Ubuntu ISO file to a disk or mount the ISO file in a virtual drive to access the files within the image. You can also use 7Zip to extract the ISO so you can work with the files inside.

Booting the Computer From USB

Most newer computers can boot from USB. If your computer does not automatically do so, you might need to edit the BIOS settings. Restart your computer, and watch for a message telling you which key to press to enter the BIOS setup. It will usually be one of F1, F2, DEL, ESC or F10. Press this key while your computer is booting to edit your BIOS settings. (On HP Mini Netbooks, they correct key is usually F9.) You need to edit the Boot Order. Depending on your computer, and how your USB key was formatted, you should see an entry for "removable drive" or "USB media". Move this to the top of the list to force the computer to attempt to boot from USB before booting from the hard disk.

Alternative method

Some computers can see the USB thumb drive and have the option to boot from USB but cannot actually boot from USB. All hope is not lost.

Requirements

Just follow the instructions on the PLop website. Note: When you use this method, the files on the USB drive are changed during boot. To use this method more than once, you must delete all files from the USB drive and prepare the USB drive again as described below.

Creating a bootable USB Drive

  • Check the USB drive for files and back them up if needed, all contents will be destroyed.
  • A minimum of 1GB space is required for a netbook install. Other install types may require more space.
  • The Windows utility won't let you select the USB drive if the drive isn't properly formatted and mounted.

Booting from a USB drive created with this utility will behave just as if you had booted from the install CD. It will show the language selection and then the install menu, from which you can install Ubuntu onto the computer's hard drive or launch the LiveCD environment.

Linux

The Ubuntu USB desktop image creator is available in the package usb-creator, usb-creator-kde on Kubuntu, or usb-creator-gtk on 9.10. From the 8.10 release on (9.10 on for Kubuntu), Ubuntu includes the usb-creator by default on all LiveCDs and installations. You can find it in System-->Administration-->Create a USB startup disk (Ubuntu Desktop) or K-Menu-->Applications-->System-->USB Startup Disk Creator (Kubuntu), if it is not there then run the following command in the Terminal :

sudo apt-get install usb-creator

Make sure the software-sources are activated if you are on a LiveCD (software sources or `sudo gedit /etc/apt/sources.list`). You may need to install the python-gnome2 package as well. It should do everything needed you just need to have a LiveCD in you CD-Rom or show the usb-creator the ISO image of it and the rest of the process is automatic! (for more info on how to use this tool by just popping in a LiveCD to a drive in a computer running Ubuntu desktop see "Live USB creator" below, note that it also works with downloaded .iso images). If the progress bar proceeds very slowly (1% every 10 seconds or so) you may want to make sure your USB stick is mounted without the "sync" option. This seems to work around single-byte writes bug in Jaunty's usb-creator. 模板:Https://wiki.kubuntu.org/Kubuntu/Netbook?action=AttachFile&do=get&target=screenshot-usb-creator.png

Windows

This method is recommended if you are creating Linux installation to coexist with your existing Windows installation.

  • Find a usb-creator app and run it

Installing Ubuntu directly on a USB Flash drive

In order to install a fully working Ubuntu operating system on your USB Flash drive make sure that:

  • Your Flash Drive has more than 2GB of memory
  • Your Flash Drive is bootable
  • Your Flash Drive has a high read/write speed and is USB 2.0 enabled

The process is described in detail in an external source.

9.04 and Earlier .img for Netbook

If you have downloaded an .img file, please refer to the .img writing documentation

Create Bootable USB Manually

Here is a way to create bootable USB manually. The advantage is you don't have to empty your USB as long as you have enough space for the files. Also it allow multi boot, so you can have your USB holding both 32bits and 64bits Ubuntu and so other Boot CD tool. In order to do so you need :

  • Bootable Flash Drive ( NTFS / FAT32 / FAT 16 ), Disk with MBR, you can do this with gparted in linux or HP format in Win, fdisk ....etc
  • Ubuntu ISO of your choice
  • Tools to extract files in the ISO ( ISO Mount, WinZIP, WinRAR, 7Zip, etc....)
  • Grub4Dos
  1. Grub4DOS' Tutorial
  2. Grub4DOS 0.4.4 for WIN9x/DOS/Linux(Download Here)
  3. Grub4DOS GUI for WINXP/Vista/7

First you need to install grub on to the USB's MBR. Follow the link to the Grub4DOS Wiki: Simple example:

./bootlace /dev/sdx

For more details, visit: [1] Next, you open up the ISO file and extract the files in casper directory.

total 701060
-rwxrwxrwx 2 adrian adrian 704487424 2010-04-29 05:38 filesystem.squashfs*
-rwxrwxrwx 1 adrian adrian   9365872 2010-04-29 05:34 initrd.lz*
-rwxrwxrwx 1 adrian adrian   4029792 2010-04-16 06:01 vmlinuz*
/media/Fujitsu 60GB USB/bootimg/ubuntu.10.4.x86$

Copy grldr to the root of the drive.

drwx------ 1 adrian adrian   4096 2010-05-05 16:49 bootimg/
-rwxrwxrwx 1 adrian adrian 220049 2009-09-24 17:30 grldr*
-rwxrwxrwx 1 adrian adrian   2760 2010-05-04 23:08 menu.lst*
/media/Fujitsu 60GB USB$

Now create menu.lst at the root of USB. Example of menu.lst:

default /default
title Ubuntu 10.04 LiveCD
find --set-root /bootimg/ubuntu.10.4.x86/initrd.lz
kernel /bootimg/ubuntu.10.4.x86/vmlinuz boot=casper live-media-path=/bootimg/ubuntu.10.4.x86/ ignore_uuid
initrd /bootimg/ubuntu.10.4.x86/initrd.lz
boot

Make sure the path match where the files you copy to. Now, reboot.