用隨身碟製作CentOS啟動盤

來源:互聯網
上載者:User

標籤:u盤   centos   啟動製作   


想製作一個centos5.9-X86_64 的隨身碟啟動安裝盤,

以下是把16G 隨身碟掛載到vmware workstation的虛擬下操作:


檢查當前磁碟情況 

fdisk -l


分區


fdisk /dev/sdb 

d # delete existing partition - repeat as necessary 

n # new partition 

p # primary 

1 # partition number 

<enter> # take the default 

+100M # add 100 MB 

t # change the type 

1 # partition number 

b # VFAT 

n # new partition 

p # primary 

2 # partition number 

<enter> # take the default 

+5G

n # new partition 

e # primary 

3 # partition number 

<enter> # take the default 

<enter> # take the default

n # new partition 

l #邏輯分區

<enter> # take the default 

+3G

t # change the type 

5 # partition number 

b # VFAT

n # new partition 

l #邏輯分區

<enter> # take the default 

+3G

t # change the type 

6 # partition number 

b # VFAT

n # new partition 

l #邏輯分區

<enter> # take the default 

<enter> # take the default 

t # change the type 

7 # partition number 

b # VFAT

p

650) this.width=650;" src="http://s3.51cto.com/wyfs02/M02/34/39/wKiom1Oqqi-QAMXGAAMiVq_Iq3o258.jpg" title="無標題.png" alt="wKiom1Oqqi-QAMXGAAMiVq_Iq3o258.jpg" />

w


格式化

mkfs.vfat -n BOOT /dev/sdb1 

mkfs.ext2 -m 0 -b 4096 -L DATA /dev/sdb2 

mkfs.vfat -n do /dev/sdb5

mkfs.vfat -n do /dev/sdb6

mkfs.vfat -n wolf /dev/sdb7


重新插拔u盤,mount DATA分區,mount第一個iso,複製一些資料到DATA分區,再把iso都複製到DATA分區,然後umount 分區


mkdir -p /media/BOOT 

mount /dev/sdb1 /media/BOOT 

mkdir -p /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  


安裝syslinux,用syslinux在u盤的/dev/sdb1分區製作linux啟動盤,覆蓋u盤的mbr


yum -y install syslinux

syslinux --stupid /dev/sdb1  

dd if=/usr/share/syslinux/mbr.bin of=/dev/sdb 

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  



編輯/media/BOOT/syslinux.cfg


default CentOS(注意這項和下面的label CentOS一定要對應)

prompt 0  

  

label CentOS  

  kernel vmlinuz  

  append initrd=initrd.img method=hd:sdb2:/ 

#內容片段end 


umount /media/BOOT 


斷開與虛擬機器連線:

650) this.width=650;" src="http://s3.51cto.com/wyfs02/M00/34/39/wKioL1OqrRODI2MvAAIRmldNLIE210.jpg" title="無標題.png" alt="wKioL1OqrRODI2MvAAIRmldNLIE210.jpg" />

測試用隨身碟啟動,正常;


不過在win7 “我的電腦”裡只看到了第一個分區,5、6、7沒有顯示 ,磁碟管理中有:

650) this.width=650;" src="http://s3.51cto.com/wyfs02/M02/34/3A/wKioL1OqrkOhk4PtAACrNA-4HcQ861.jpg" title="無標題.png" alt="wKioL1OqrkOhk4PtAACrNA-4HcQ861.jpg" />



相關文章

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.