用UNetBootin制作CentOS的USB安装盘

据说有人愿意赞助我300多元去制作一个校园的Linux服务器,这个价钱,就够一台二手主机,凑着用就好!
周二下午去岗顶看一下二手货,顺便在我的U盘上放一个CentOS安装文件,这样可以在店家那里测试一下USB安装系统。

经历多番波折,终于制作好了CentOS的USB安装盘。我用的是CentOS6.0的Minimal版本的iso安装文件,写入U盘使用UNetBootin这个工具。
具体步骤如下:

1、安装UNetBootin

root@xiaoxia-pc:~# apt-get install unetbootin

2、下载CentOS镜像文件

我喜欢先安装基本系统,然后网上安装软件,这样能保持系统精简,所以我使用体积比较小的minimal版本。我是在网易的源上下载的,教育网用户可以在教育网站点下载。

http://mirrors.163.com/centos/6/isos/i386/CentOS-6.0-i386-minimal.iso

3、格式化U盘

我第一次制作CentOS安装盘的时候,没料到安装不会从U盘里寻找镜像的,只有cdrom,hard drive,nfs这些选择,没有usb,所以导致安装无法进行。
解决办法是,给usb分区,让系统把usb媒介识别为硬盘。

插入U盘后,查看U盘的设备文件。

root@xiaoxia-pc:~/test# dmesg |tail
[47750.801304] scsi 12:0:0:0: Direct-Access General USB Flash Disk 1100 PQ: 0 ANSI: 0 CCS
[47750.802578] sd 12:0:0:0: Attached scsi generic sg3 type 0
[47750.803043] sd 12:0:0:0: [sdc] 15722496 512-byte logical blocks: (8.04 GB/7.49 GiB)
[47750.804222] sd 12:0:0:0: [sdc] Write Protect is off
[47750.804231] sd 12:0:0:0: [sdc] Mode Sense: 43 00 00 00
[47750.804236] sd 12:0:0:0: [sdc] Assuming drive cache: write through
[47750.808036] sd 12:0:0:0: [sdc] Assuming drive cache: write through
[47750.809045] sdc:
[47750.811045] sd 12:0:0:0: [sdc] Assuming drive cache: write through
[47750.811056] sd 12:0:0:0: [sdc] Attached SCSI removable disk

格式化U盘,使用fdisk给U盘分区。

root@xiaoxia-pc:~/test# fdisk /dev/sdc
Command (m for help): o
Building a new DOS disklabel with disk identifier 0x7e4c7a0e.
Changes will remain in memory only, until you decide to write them.
After that, of course, the previous content won't be recoverable.

Warning: invalid flag 0x0000 of partition table 4 will be corrected by w(rite)

Command (m for help): n
Command action
   e   extended
   p   primary partition (1-4)
p
Partition number (1-4): 1
First cylinder (1-1022, default 1):
Using default value 1
Last cylinder, +cylinders or +size{K,M,G} (1-1022, default 1022):
Using default value 1022

Command (m for help): p

Disk /dev/sdc: 8049 MB, 8049917952 bytes
248 heads, 62 sectors/track, 1022 cylinders
Units = cylinders of 15376 * 512 = 7872512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x7e4c7a0e

   Device Boot      Start         End      Blocks   Id  System
/dev/sdc1               1        1022     7856112   83  Linux

Command (m for help): a
Partition number (1-4): 1

Command (m for help): w
The partition table has been altered!

Calling ioctl() to re-read partition table.
Syncing disks.

重新插入U盘,可以看到有U盘分区了。用fat来格式化分区,并mount之。

root@xiaoxia-pc:~/test# ls /dev/sdc*
/dev/sdc /dev/sdc1
root@xiaoxia-pc:~/test# mkfs.vfat /dev/sdc1
mkfs.vfat 3.0.9 (31 Jan 2010)
root@xiaoxia-pc:~/test# mount /dev/sdc1 /mnt

4、使用UNetBootin制作安装启动盘。

启用UNetBootin,界面如下,选择使用光盘镜像。

点“确定”后开始复制文件,

安装完毕!无须重启直接退出。

查看U盘文件大小,只有287MB哦!!!

到此,CentOS的USB安装盘制作成功!

============================================================
加一句,要安装成功,还需要把ISO文件复制到USB安装盘的根目录下,不然会在安装过程中,遇到无法找到镜像的问题。如下

Missing ISO 9660 image
The installer has tried to mount image # 1. but cannot find it on the hard drive.
Please copy this image to the drive and click Retry. Click Exit to abort the installation.

编辑于 2011年11月08日


 转自 http://xiaoxia.org/2011/11/08/use-unetbootin-to-setup-a-centos-usb-installer/

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值