用UNetBootin製做CentOS的USB安裝盤

用UNetBootin製做CentOS的USB安裝盤

聽說有人願意贊助我300多元去製做一個校園的Linux服務器,這個價錢,就夠一臺二手主機,湊着用就好!
週二下午去崗頂看一下二手貨,順便在個人U盤上放一個CentOS安裝文件,這樣能夠在店家那裏測試一下USB安裝系統。centos

經歷多番波折,終於製做好了CentOS的USB安裝盤。我用的是CentOS6.0的Minimal版本的iso安裝文件,寫入U盤使用UNetBootin這個工具。
具體步驟以下:服務器

一、安裝UNetBootinide

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

二、下載CentOS鏡像文件測試

我喜歡先安裝基本系統,而後網上安裝軟件,這樣能保持系統精簡,因此我使用體積比較小的minimal版本。我是在網易的源上下載的,教育網用戶能夠在教育網站點下載。網站

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

三、格式化U盤this

我第一次製做CentOS安裝盤的時候,沒料到安裝不會從U盤裏尋找鏡像的,只有cdrom,hard drive,nfs這些選擇,沒有usb,因此致使安裝沒法進行。
解決辦法是,給usb分區,讓系統把usb媒介識別爲硬盤。spa

插入U盤後,查看U盤的設備文件。code

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

四、使用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日

相關文章
相關標籤/搜索