用grub4dos 制作 Linux 安装U盘

转自:https://help.ubuntu.com/community/Installation/FromUSBStick


步骤:


原文摘抄如下:

Create Bootable USB Manually

Here is a way to create a bootable USB flash drive manually. The advantage is you don't have to empty your USB flash drive as long as you have enough space for the files. It also allows multi boot, so you can, for example, have your USB flash drive holding both 32bit and 64bit versions of Ubuntu and other Boot CD tools at the same time.

In order to do so you need : 

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

./bootlace /dev/sdx

For more details, visit: http://sourceforge.net/projects/grub4dos/

Next, you open up the ISO file and extract the files in casper directory. The size (and possibly manifest) are needed if you want to install from the USB flash drive otherwise the install will fail.

total 701060
-rwxr-xr-x 1 adrian adrian     38784 2010-07-27 16:15 filesystem.manifest
-rwxr-xr-x 1 adrian adrian        10 2010-07-27 16:15 filesystem.size
-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.

Simpler way using the ISO file

Another way is just using the ISO file as it is on an already bootable USB flash drive that uses Grub (to create one, see above).

  • copy the iso file onto the USB flash drive in the root (top) directory
  • add these lines to the menu.lst file:

title Ubuntu 11.04 i386
find --set-root /ubuntu-11.04-desktop-i386.iso
map /ubuntu-11.04-desktop-i386.iso (0xff)
map --hook
root (0xff)
kernel /casper/vmlinuz file=/cdrom/preseed/ubuntu.seed boot=casper iso-scan/filename=/ubuntu-11.04-desktop-i386.iso splash quiet --
initrd /casper/initrd.lz

Note: this might not work with all versions of grub. It was tested with GRUB4DOS 0.4.4 2008-11-11




评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值