install centos

来源:互联网 发布:mysql and or 优先级 编辑:程序博客网 时间:2024/04/30 08:59

用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/sdcCommand (m for help): oBuilding 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): nCommand action   e   extended   p   primary partition (1-4)pPartition number (1-4): 1First cylinder (1-1022, default 1):Using default value 1Last cylinder, +cylinders or +size{K,M,G} (1-1022, default 1022):Using default value 1022Command (m for help): pDisk /dev/sdc: 8049 MB, 8049917952 bytes248 heads, 62 sectors/track, 1022 cylindersUnits = cylinders of 15376 * 512 = 7872512 bytesSector size (logical/physical): 512 bytes / 512 bytesI/O size (minimum/optimal): 512 bytes / 512 bytesDisk identifier: 0x7e4c7a0e   Device Boot      Start         End      Blocks   Id  System/dev/sdc1               1        1022     7856112   83  LinuxCommand (m for help): aPartition number (1-4): 1Command (m for help): wThe 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.


原创粉丝点击