特殊:Badtitle/NS100:Installation/FromUSBStick
文章出处: |
{{#if: | {{{2}}} | https://help.ubuntu.com/community/Installation/FromUSBStick }} |
点击翻译: |
English {{#ifexist: {{#if: php5 | php5 | {{#if: | :}}Installation/FromUSBStick}}/af | • {{#if: php5|Afrikaans| [[::Installation/FromUSBStick/af|Afrikaans]]}}|}} {{#ifexist: {{#if: php5 | php5 | {{#if: | :}}Installation/FromUSBStick}}/ar | • {{#if: php5|العربية| [[::Installation/FromUSBStick/ar|العربية]]}}|}} {{#ifexist: {{#if: php5 | php5 | {{#if: | :}}Installation/FromUSBStick}}/az | • {{#if: php5|azərbaycanca| [[::Installation/FromUSBStick/az|azərbaycanca]]}}|}} {{#ifexist: {{#if: php5 | php5 | {{#if: | :}}Installation/FromUSBStick}}/bcc | • {{#if: php5|جهلسری بلوچی| [[::Installation/FromUSBStick/bcc|جهلسری بلوچی]]}}|}} {{#ifexist: {{#if: php5 | php5 | {{#if: | :}}Installation/FromUSBStick}}/bg | • {{#if: php5|български| [[::Installation/FromUSBStick/bg|български]]}}|}} {{#ifexist: {{#if: php5 | php5 | {{#if: | :}}Installation/FromUSBStick}}/br | • {{#if: php5|brezhoneg| [[::Installation/FromUSBStick/br|brezhoneg]]}}|}} {{#ifexist: {{#if: php5 | php5 | {{#if: | :}}Installation/FromUSBStick}}/ca | • {{#if: php5|català| [[::Installation/FromUSBStick/ca|català]]}}|}} {{#ifexist: {{#if: php5 | php5 | {{#if: | :}}Installation/FromUSBStick}}/cs | • {{#if: php5|čeština| [[::Installation/FromUSBStick/cs|čeština]]}}|}} {{#ifexist: {{#if: php5 | php5 | {{#if: | :}}Installation/FromUSBStick}}/de | • {{#if: php5|Deutsch| [[::Installation/FromUSBStick/de|Deutsch]]}}|}} {{#ifexist: {{#if: php5 | php5 | {{#if: | :}}Installation/FromUSBStick}}/el | • {{#if: php5|Ελληνικά| [[::Installation/FromUSBStick/el|Ελληνικά]]}}|}} {{#ifexist: {{#if: php5 | php5 | {{#if: | :}}Installation/FromUSBStick}}/es | • {{#if: php5|español| [[::Installation/FromUSBStick/es|español]]}}|}} {{#ifexist: {{#if: php5 | php5 | {{#if: | :}}Installation/FromUSBStick}}/fa | • {{#if: php5|فارسی| [[::Installation/FromUSBStick/fa|فارسی]]}}|}} {{#ifexist: {{#if: php5 | php5 | {{#if: | :}}Installation/FromUSBStick}}/fi | • {{#if: php5|suomi| [[::Installation/FromUSBStick/fi|suomi]]}}|}} {{#ifexist: {{#if: php5 | php5 | {{#if: | :}}Installation/FromUSBStick}}/fr | • {{#if: php5|français| [[::Installation/FromUSBStick/fr|français]]}}|}} {{#ifexist: {{#if: php5 | php5 | {{#if: | :}}Installation/FromUSBStick}}/gu | • {{#if: php5|ગુજરાતી| [[::Installation/FromUSBStick/gu|ગુજરાતી]]}}|}} {{#ifexist: {{#if: php5 | php5 | {{#if: | :}}Installation/FromUSBStick}}/he | • {{#if: php5|עברית| [[::Installation/FromUSBStick/he|עברית]]}}|}} {{#ifexist: {{#if: php5 | php5 | {{#if: | :}}Installation/FromUSBStick}}/hu | • {{#if: php5|magyar| [[::Installation/FromUSBStick/hu|magyar]]}}|}} {{#ifexist: {{#if: php5 | php5 | {{#if: | :}}Installation/FromUSBStick}}/id | • {{#if: php5|Bahasa Indonesia| [[::Installation/FromUSBStick/id|Bahasa Indonesia]]}}|}} {{#ifexist: {{#if: php5 | php5 | {{#if: | :}}Installation/FromUSBStick}}/it | • {{#if: php5|italiano| [[::Installation/FromUSBStick/it|italiano]]}}|}} {{#ifexist: {{#if: php5 | php5 | {{#if: | :}}Installation/FromUSBStick}}/ja | • {{#if: php5|日本語| [[::Installation/FromUSBStick/ja|日本語]]}}|}} {{#ifexist: {{#if: php5 | php5 | {{#if: | :}}Installation/FromUSBStick}}/ko | • {{#if: php5|한국어| [[::Installation/FromUSBStick/ko|한국어]]}}|}} {{#ifexist: {{#if: php5 | php5 | {{#if: | :}}Installation/FromUSBStick}}/ksh | • {{#if: php5|Ripoarisch| [[::Installation/FromUSBStick/ksh|Ripoarisch]]}}|}} {{#ifexist: {{#if: php5 | php5 | {{#if: | :}}Installation/FromUSBStick}}/mr | • {{#if: php5|मराठी| [[::Installation/FromUSBStick/mr|मराठी]]}}|}} {{#ifexist: {{#if: php5 | php5 | {{#if: | :}}Installation/FromUSBStick}}/ms | • {{#if: php5|Bahasa Melayu| [[::Installation/FromUSBStick/ms|Bahasa Melayu]]}}|}} {{#ifexist: {{#if: php5 | php5 | {{#if: | :}}Installation/FromUSBStick}}/nl | • {{#if: php5|Nederlands| [[::Installation/FromUSBStick/nl|Nederlands]]}}|}} {{#ifexist: {{#if: php5 | php5 | {{#if: | :}}Installation/FromUSBStick}}/no | • {{#if: php5|norsk| [[::Installation/FromUSBStick/no|norsk]]}}|}} {{#ifexist: {{#if: php5 | php5 | {{#if: | :}}Installation/FromUSBStick}}/oc | • {{#if: php5|occitan| [[::Installation/FromUSBStick/oc|occitan]]}}|}} {{#ifexist: {{#if: php5 | php5 | {{#if: | :}}Installation/FromUSBStick}}/pl | • {{#if: php5|polski| [[::Installation/FromUSBStick/pl|polski]]}}|}} {{#ifexist: {{#if: php5 | php5 | {{#if: | :}}Installation/FromUSBStick}}/pt | • {{#if: php5|português| [[::Installation/FromUSBStick/pt|português]]}}|}} {{#ifexist: {{#if: php5 | php5 | {{#if: | :}}Installation/FromUSBStick}}/ro | • {{#if: php5|română| [[::Installation/FromUSBStick/ro|română]]}}|}} {{#ifexist: {{#if: php5 | php5 | {{#if: | :}}Installation/FromUSBStick}}/ru | • {{#if: php5|русский| [[::Installation/FromUSBStick/ru|русский]]}}|}} {{#ifexist: {{#if: php5 | php5 | {{#if: | :}}Installation/FromUSBStick}}/si | • {{#if: php5|සිංහල| [[::Installation/FromUSBStick/si|සිංහල]]}}|}} {{#ifexist: {{#if: php5 | php5 | {{#if: | :}}Installation/FromUSBStick}}/sq | • {{#if: php5|shqip| [[::Installation/FromUSBStick/sq|shqip]]}}|}} {{#ifexist: {{#if: php5 | php5 | {{#if: | :}}Installation/FromUSBStick}}/sr | • {{#if: php5|српски / srpski| [[::Installation/FromUSBStick/sr|српски / srpski]]}}|}} {{#ifexist: {{#if: php5 | php5 | {{#if: | :}}Installation/FromUSBStick}}/sv | • {{#if: php5|svenska| [[::Installation/FromUSBStick/sv|svenska]]}}|}} {{#ifexist: {{#if: php5 | php5 | {{#if: | :}}Installation/FromUSBStick}}/th | • {{#if: php5|ไทย| [[::Installation/FromUSBStick/th|ไทย]]}}|}} {{#ifexist: {{#if: php5 | php5 | {{#if: | :}}Installation/FromUSBStick}}/tr | • {{#if: php5|Türkçe| [[::Installation/FromUSBStick/tr|Türkçe]]}}|}} {{#ifexist: {{#if: php5 | php5 | {{#if: | :}}Installation/FromUSBStick}}/vi | • {{#if: php5|Tiếng Việt| [[::Installation/FromUSBStick/vi|Tiếng Việt]]}}|}} {{#ifexist: {{#if: php5 | php5 | {{#if: | :}}Installation/FromUSBStick}}/yue | • {{#if: php5|粵語| [[::Installation/FromUSBStick/yue|粵語]]}}|}} {{#ifexist: {{#if: php5 | php5 | {{#if: | :}}Installation/FromUSBStick}}/zh | • {{#if: php5|中文| [[::Installation/FromUSBStick/zh|中文]]}}|}} {{#ifexist: {{#if: php5 | php5 | {{#if: | :}}Installation/FromUSBStick}}/zh-hans | • {{#if: php5|中文(简体)| [[::Installation/FromUSBStick/zh-hans|中文(简体)]]}}|}} {{#ifexist: {{#if: php5 | php5 | {{#if: | :}}Installation/FromUSBStick}}/zh-hant | • {{#if: php5|中文(繁體)| [[::Installation/FromUSBStick/zh-hant|中文(繁體)]]}}|}} |
{{#ifeq:php5|:Installation/FromUSBStick|请不要直接编辑翻译本页,本页将定期与来源同步。}} |
{{#ifexist: :Installation/FromUSBStick/zh | | {{#ifexist: Installation/FromUSBStick/zh | | {{#ifeq: {{#titleparts:Installation/FromUSBStick|1|-1|}} | zh | | }} }} }} {{#ifeq: {{#titleparts:Installation/FromUSBStick|1|-1|}} | zh | | }}
Installing Ubuntu from a Flash Drive
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.
I also succeeded in installing on a Libretto 100CT by using a 2.5" IDE disk in one of those cheap USB cradles. This machine has no CD-ROM, no floppy (on my unit), no USB. I've taken the liberty to annotate my experiences in an indented style, like this. -- Ubuntu:Era 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 had to install syslinux and rename isolinux.cfg to syslinux.cfg (I didn't have to change the contents of the file). It was very easy. I didn't have to try fooling the installer into thinking the stick was the CD and mess with symlinks etc. -- MikkelErup
I succeeded installing Ubuntu 7.04 (Feisty) with this guide and just a few changes I added. Ubuntu is running stable and without any problems -- Boo
In short here's what you do:
- Make the USB flash drive bootable using SYSLINUX.
- Copy the contents of the Ubuntu CD to your flash drive (make sure you include hidden files/directories).
- Copy some files from sub-directories to the root directory.
- Rename the file
isolinux.cfg
tosyslinux.cfg
and edit it a bit. - Boot the computer from your USB flash drive.
- Create a fake cdrom drive and mount the flash drive to
/cdrom
during the Ubuntu installation process.
Checking your USB stick
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.
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. :-)
As of version 3.00, FAT32 is supported by SYSLINUX.
Making your flash drive bootable with SYSLINUX
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
mount -t vfat /dev/sda1 /mnt
. Note the mountpoint (i.e./mnt
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 exampleF:
). - Make the flash drive bootable. If you're using Linux and your flash drive is mounted as in the above example, use:
syslinux -s /dev/sda1
. If you are using Windows and the flash drive has the letterF:
assigned to it as in the above example, use:syslinux -s F:
- You should see a new file called
ldlinux.sys
in the root directory of your flash drive. (Note that it is a hidden file, you might not see it in Windows Explorer; trydir /a F:
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 createdhda1
for/boot
(in retrospect, maybe not necessary),hda2
for swap (again in retrospect, could go in an extended partition; if I do it again I'll add the good old Woody installerrescue288
disk image -- still viable and valuable as a rescue disk!),hda3
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), andhda4
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.mkfs -t vfat /dev/sdXY
... and be real careful to not format the wrong disk by mistake. (So in my case, this would besda3
here.)
No need to mount any other partitions thanhda3
/sda3
) 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/media/usbdisk
(andusbdisk-1
,usbdisk-2
etc for additional partitions or devices ...mount
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 topumount
any device you intend to do any low-level operations on, and thenmount
andunmount
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:
xcopy /e /h /k d:\*.* f:
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 dists/dapper
to dists/stable
.
I think this depends slightly on which CD and which installer you're using. I've had problems whendists/dapper
was missing and whendists/stable
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. (Thevfat
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 nameddists/stable
and rename thedists/feisty
todists/stable
. -- Boo
Editing SYSLINUX.CFG
Copy (or rename) the file isolinux.cfg
to syslinux.cfg
. Then edit the file and remove the /casper/
or /install/
reference in all paths. For example you would change the line containing DEFAULT /casper/vmlinuz
to DEFAULT vmlinuz
. Save the file, and make sure it is called syslinux.cfg
. 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/install/
reference. The only line it is found iskernel /install/mt86plus
, which must be changed tokernel /mt86plus
. -- 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:
mkdir /cdrom /dev/cdroms
cd /dev/cdroms
ln -s ../sda1 cdrom0
(where sda1 is your USB stick)mount -t vfat /dev/cdroms/cdrom0 /cdrom
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 yourhda
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 andmount -t vfat /dev/hda3 /cdrom
. (I skipped the gyrations with/dev/cdroms
, 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