這是個實用的指令,記錄一下囉!Linux 製作原始安裝光碟 ISO 檔很簡單,只要用 dd 就可以搞定了。

CentOS5製作原始安裝光碟ISO檔

參考:nixCraft

因為來源是光碟機,所以要知道光碟機的裝置代碼,而我沒有安裝圖形介面,所以光碟是不會自動掛載的。

按照文章裡面的指令,執行 mount,但卻沒有自動掛載光碟機!嘿!

# mount
/dev/sda2 on / type ext3 (rw)
proc on /proc type proc (rw)
sysfs on /sys type sysfs (rw)
devpts on /dev/pts type devpts (rw,gid=5,mode=620)
/dev/sda5 on /backup type ext3 (rw)
/dev/sda3 on /vm type ext3 (rw)
/dev/sda1 on /boot type ext3 (rw)
tmpfs on /dev/shm type tmpfs (rw)
none on /proc/sys/fs/binfmt_misc type binfmt_misc (rw)
sunrpc on /var/lib/nfs/rpc_pipefs type rpc_pipefs (rw)

所以,便利用 dmesg 來找光碟機囉!

# dmesg |grep cd
ehci_hcd 0000:00:12.2: EHCI Host Controller
ehci_hcd 0000:00:12.2: new USB bus registered, assigned bus number 1
ehci_hcd 0000:00:12.2: applying AMD SB700/SB800/Hudson-2/3 EHCI dummy qh workaro und
ehci_hcd 0000:00:12.2: debug port 1
ehci_hcd 0000:00:12.2: irq 193, io mem 0xfe02d000
ehci_hcd 0000:00:12.2: USB 2.0 started, EHCI 1.00, driver 10 Dec 2004
ehci_hcd 0000:00:13.2: EHCI Host Controller
ehci_hcd 0000:00:13.2: new USB bus registered, assigned bus number 2
ehci_hcd 0000:00:13.2: applying AMD SB700/SB800/Hudson-2/3 EHCI dummy qh workaro und
ehci_hcd 0000:00:13.2: debug port 1
ehci_hcd 0000:00:13.2: irq 193, io mem 0xfe02b000
ehci_hcd 0000:00:13.2: USB 2.0 started, EHCI 1.00, driver 10 Dec 2004
ehci_hcd 0000:00:16.2: EHCI Host Controller
ehci_hcd 0000:00:16.2: new USB bus registered, assigned bus number 3
ehci_hcd 0000:00:16.2: applying AMD SB700/SB800/Hudson-2/3 EHCI dummy qh workaro und
ehci_hcd 0000:00:16.2: debug port 1
ehci_hcd 0000:00:16.2: irq 193, io mem 0xfe028000
ehci_hcd 0000:00:16.2: USB 2.0 started, EHCI 1.00, driver 10 Dec 2004
ohci_hcd: 2005 April 22 USB 1.1 'Open' Host Controller (OHCI) Driver (PCI)
ohci_hcd 0000:00:12.0: OHCI Host Controller
ohci_hcd 0000:00:12.0: new USB bus registered, assigned bus number 4
ohci_hcd 0000:00:12.0: irq 201, io mem 0xfe02e000
ohci_hcd 0000:00:13.0: OHCI Host Controller
ohci_hcd 0000:00:13.0: new USB bus registered, assigned bus number 5
ohci_hcd 0000:00:13.0: irq 201, io mem 0xfe02c000
ohci_hcd 0000:00:14.5: OHCI Host Controller
ohci_hcd 0000:00:14.5: new USB bus registered, assigned bus number 6
ohci_hcd 0000:00:14.5: irq 201, io mem 0xfe02a000
ohci_hcd 0000:00:16.0: OHCI Host Controller
ohci_hcd 0000:00:16.0: new USB bus registered, assigned bus number 7
ohci_hcd 0000:00:16.0: irq 201, io mem 0xfe029000
usb 4-2: new low speed USB device using ohci_hcd and address 2

sr0: scsi3-mmc drive: 48x/48x writer dvd-ram cd/rw xa/form2 cdda tray

哈!看到了光碟機所屬的裝置代碼,就掛載做一下測試囉!

# mount /dev/sr0 /media/
mount: block device /dev/sr0 is write-protected, mounting read-only

既然可以掛載,就可以將它卸載了。

# umount /media/

接下來就是執行 dd 指令:

# dd if=/dev/sr0 of=/backup/iso/CentOS-5.8-i386-bin-DVD.iso
7663296+0 records in
7663296+0 records out
3923607552 bytes (3.9 GB) copied, 263.504 seconds, 14.9 MB/s

看一下成果:

# ll /backup/iso/
total 3835400
-rw-r--r-- 1 root root 3923607552 Apr  1 18:51 CentOS-5.8-i386-bin-DVD.iso

要掛載 ISO 檔也蠻簡單的,如下列指令:

# mount -o loop /backup/iso/CentOS-5.8-i386-bin-DVD.iso /media/

基本的東西,也是要好好記錄囉!

20120401

arrow
arrow
    文章標籤
    Linux CentOS CentOS5 ISO
    全站熱搜
    創作者介紹
    創作者 游蜂 的頭像
    游蜂

    暉獲無度的步烙閣

    游蜂 發表在 痞客邦 留言(0) 人氣()