linux:usb_boot
差異處
這裏顯示兩個版本的差異處。
| 兩邊的前次修訂版前次修改 下次修改 | 前次修改 | ||
| linux:usb_boot [2007/05/27 11:58] – wenpei | linux:usb_boot [2010/10/16 19:55] (目前版本) – wenpei | ||
|---|---|---|---|
| 行 1: | 行 1: | ||
| + | ====== Booting ISO files from GRUB 2 ====== | ||
| + | http:// | ||
| + | |||
| + | [[http:// | ||
| + | |||
| ====== 製作 debian 的 USB 安裝碟 ====== | ====== 製作 debian 的 USB 安裝碟 ====== | ||
| http:// | http:// | ||
| 行 14: | 行 19: | ||
| http:// | http:// | ||
| + | |||
| + | http:// | ||
| ====== 在USB隨身碟中裝入Linux開機系統 ====== | ====== 在USB隨身碟中裝入Linux開機系統 ====== | ||
| 行 48: | 行 55: | ||
| ===== Bootable USB Keys ===== | ===== Bootable USB Keys ===== | ||
| http:// | http:// | ||
| + | |||
| + | ====== Boot From a USB drive using GRUB ====== | ||
| + | http:// | ||
| + | |||
| + | Once upon a time GRUB was commonly used to make generic boot diskettes. A GRUB-enabled diskette would allow a user to boot directly into any operating system that GRUB recognized on the system. This was useful for recovering systems and fixing partitions that had bad master boot records (MBR). | ||
| + | |||
| + | Times have changed; many computers these days no longer have diskette drives, but they can boot from a USB drive. GRUB naturally adapted to USB disk drives. To get a USB disk drive to boot with GRUB, start with a USB thumb drive that is partitioned correctly and has a supported filesystem (BSD FFS, DOS FAT16 and FAT32, Minix fs, Linux ext2fs, ReiserFS, JFS, XFS, and VSTa fs). Then perform the following steps while logged in as root or a user that has sudo access. | ||
| + | |||
| + | First mount the USB drive. Under many distributions, | ||
| + | |||
| + | < | ||
| + | # mkdir /mnt/usb | ||
| + | # mount /dev/sda1 /mnt/usb | ||
| + | </ | ||
| + | |||
| + | Copy the boot stage files to your USB drive. Stage files are the executable files that comprise GRUB. You need to copy the correct stage file for your filesystem. In GNOME you can determine the filesystem by right-clicking the icon for the drive and selecting Properties from the menu; the filesystem information in on the Volume tab. If you are not running GNOME you can determine the filesystem type by using fdisk. | ||
| + | |||
| + | In all there should be three files to copy: stage1, stage2, and your filesystem stage file. (The example below uses the e2fs stage file, which corresponds to the ext2 filesystem.) Once the files are copied you need to unmount the device so the MBR can be created. | ||
| + | |||
| + | < | ||
| + | mkdir / | ||
| + | cp / | ||
| + | umount /mnt/usb | ||
| + | </ | ||
| + | |||
| + | The final step is to install a master boot record on the drive. An MBR is a 512-byte hidden area of the disk that is reserved specifically for booting. To install the MBR, use the GRUB shell -- a simple command shell that is used to preform GRUB-related tasks. | ||
| + | |||
| + | < | ||
| + | grub | ||
| + | grub> device (hd0) /dev/sda | ||
| + | grub> root (hd0,0) | ||
| + | grub> setup (hd0) | ||
| + | grub> quit | ||
| + | </ | ||
| + | |||
| + | * device tells GRUB what disk device to use when processing commands. | ||
| + | * root sets the default partition that GRUB will use to boot from. This is the partition where the stage files were copied to. GRUB starts counting at 0, not 1. | ||
| + | * setup creates the MBR on the USB drive. | ||
| + | * quit exits the GRUB command shell. | ||
| + | |||
| + | At this point GRUB is installed, and you should be able to boot the USB disk drive. When you do so, you should get dumped directly into the GRUB shell when the machine is booted. For information on what you can do with the command shell, review the GRUB command-line documentation. | ||
| + | |||
| + | If you want to go old school and use a diskette with GRUB, make sure the diskette is formatted as a FAT filesystem and replace /dev/sda1 with /dev/fd0 and hd0 with fd0. | ||
linux/usb_boot.1180238313.txt.gz · 上一次變更: (外部編輯)
