2、制作u盘的系统需要安装了syslinux,我的版本是3.11
3、u盘分区成如下格式
- [root@localhost ~]# fdisk -l /dev/sdb
- Disk /dev/sdb: 7948 MB, 7948206080 bytes
- 245 heads, 62 sectors/track, 1021 cylinders
- Units = cylinders of 15190 * 512 = 7777280 bytes
- Sector size (logical/physical): 512 bytes / 512 bytes
- I/O size (minimum/optimal): 512 bytes / 512 bytes
- Disk identifier: 0xcad4ebea
- Device Boot Start End Blocks Id System
- /dev/sdb1 * 1 14 106299 b W95 FAT32
- /dev/sdb2 15 1021 7648165 c W95 FAT32 (LBA)
4、分别格式化两个分区
- mkfs.vfat -n BOOT /dev/sdb1
- mkfs.vfat -n DATA /dev/sdb2
- mkdir -p /media/iso /media/DATA
- mount /dev/sdb2 /media/DATA
- mount -o loop /path/to/CentOS-6.0-x86_64-bin-DVD1.iso /media/iso/
- cp -rv /media/iso/images /media/DATA
- cp -rv /path/to/CentOS-6.0-x86_64-bin-DVD*.iso /media/DATA
- umount /media/DATA
- dd if=/usr/lib/syslinux/mbr.bin of=/dev/sdb
- syslinux -s /dev/sdb1
- mkdir -p /media/BOOT
- mount /dev/sdb1 /media/BOOT
- cp /media/iso/isolinux/isolinux.bin /media/BOOT/syslinux.bin
- cp /media/iso/isolinux/isolinux.cfg /media/BOOT/syslinux.cfg
- cp /media/iso/isolinux/vmlinuz /media/BOOT
- cp /media/iso/isolinux/initrd.img /media/BOOT
- default CentOS
- prompt 0
- label CentOS
- kernel vmlinuz
- append initrd=initrd.img method=hd:sda2:/
8、最后umount BOOT和iso就完成啦,enjoy it!!!
转自:http://blog.csdn.net/phoenixie/article/details/6641165