亚洲av成人无遮挡网站在线观看,少妇性bbb搡bbb爽爽爽,亚洲av日韩精品久久久久久,兔费看少妇性l交大片免费,无码少妇一区二区三区

  免費注冊 查看新帖 |

Chinaunix

  平臺 論壇 博客 文庫
最近訪問板塊 發(fā)新帖
查看: 3035 | 回復(fù): 6
打印 上一主題 下一主題

(zt) 在 Linux 上燒錄CD [復(fù)制鏈接]

論壇徽章:
0
跳轉(zhuǎn)到指定樓層
1 [收藏(0)] [報告]
發(fā)表于 2003-08-01 08:30 |只看該作者 |倒序瀏覽
在 Linux 上燒錄 CD

Linux SCSI 仿真冒險
創(chuàng)建 .iso 文件
燒錄盤
復(fù)制盤
多段刻錄
結(jié)束語

相關(guān)內(nèi)容:

Knoppix 提供了一個可引導(dǎo)的、容量為一張光盤的 Linux
Basic tasks for new Linux developers


命令行上的 mkisofs 和 cdrecord 使這一切成為可能

Carla Schroder(dworks@bratgrrl.com)
負(fù)責(zé)人,Tux Computing
2003 年 7 月

Linux 為創(chuàng)建 CD 提供了功能強大且靈活的工具。您可以創(chuàng)建在幾乎任何平臺上都可讀的盤,還可以創(chuàng)建 .iso 文件以供下載和分發(fā)。
在任何平臺上從命令行燒錄 CD 都是一件令人費解且煩躁的事情,Linux 當(dāng)然也不例外。不過,由于在各平臺上所用到的命令和術(shù)語都十分相似,因此學(xué)習(xí)一下如何在 Linux 上刻錄 CD 還是十分有用的。許多 Linux 軟件都是通過 .iso 映像分發(fā)的,因此如果您知道如何燒錄 CD,就可以下載 .iso 來創(chuàng)建您自己的安裝盤。

Linux 和 Windows 都有可錄 CD 的程序可用,但 Linux 版本比起 Windows 版本來功能更強大通用性也更好。在本文中,我們將研究 Linux CD 刻錄命令中的兩個主力:mkisofs 和 cdrecord。mkisofs 創(chuàng)建預(yù)先錄制的映像,來生成 ISO9660/JOLIET/HFS 混合文件系統(tǒng)。它同時創(chuàng)建和填充文件系統(tǒng)。與其它數(shù)據(jù)存儲介質(zhì)(如硬盤驅(qū)動器和軟盤驅(qū)動器)不同,CD 上的文件系統(tǒng)并不是先創(chuàng)建后填充數(shù)據(jù)的。CD-R 只有一次機會:首先格式化將會創(chuàng)建一個帶有空文件系統(tǒng)的盤。cdrecord 命令在橙皮書(Orange Book) CD-R/RW 上刻錄數(shù)據(jù),這差不多就是其全部工作了。

由于采用了諸如 CD 刻錄之類的新興技術(shù),最好使用這些程序的較新版本。mkisofs 和 cdrecord 的版本都應(yīng)該至少已經(jīng)達(dá)到了 1.10。cdrecord 的最新版本 V2.0 已經(jīng)被重命名為 cdrtools。要查明機器上所安裝的版本,請輸入:

$ cdrecord --version


$ mkisofs --version
對于那些剛接觸可刻錄 CD 的人而言,在我們繼續(xù)之前,有幾樣?xùn)|西是值得先了解一下的:

CD-R:可刻錄 CD(CD-Recordable)。它們是 WORM(寫一次,讀多次,Write Once, Read Many)。
CD-RW:可重寫 CD(CD-Rewritable)。它們是 WMRM(寫多次,讀多次,Write Many, Read Many)。
CD-R 的使用很廣泛,在任何 CD-ROM 驅(qū)動器上都應(yīng)該可讀。
CD-RW 在所有現(xiàn)代驅(qū)動器上都應(yīng)該可讀。驅(qū)動器必須是“多格式讀取的(multiread)”,以便能夠讀取 CD-R 和 CD-RW 盤。較老的驅(qū)動器會出問題。扔掉那個 4 倍速的舊驅(qū)動器,買個新的;用不著發(fā)火。
商用 CD 不是用激光燒錄成的,而是壓制而成的。
哪一種 CD-R/RW 驅(qū)動器最好呢?隨便請教普通的硬件評論員,讓他們給您一些建議。
下面是與文件格式有關(guān)的一些術(shù)語:

黃皮書(Yellow Book):數(shù)據(jù) CD 的物理格式
橙皮書:可刻錄 CD 的物理格式:
第一部分:CD-MO(磁-光,Magneto-Optical)
第二部分:CD-WO(寫一次,Write-Once;包括 PhotoCD 的“混合”規(guī)范)
第三部分:CD-RW(可重寫,Re-writable)
ISO-9660:舊的文件布局標(biāo)準(zhǔn),它只允許 8.3 格式的文件名
Rock Ridge:是對 ISO-9660 的擴(kuò)展,它允許長文件名和 UNIX 樣式的符號鏈接;保留了所有文件屬性,如所有權(quán)和許可權(quán)。在 Windows 系統(tǒng)上讀盤時,不會顯示 UNIX 文件的屬性。
Joliet:Microsoft 對 ISO 9660 文件系統(tǒng)的擴(kuò)展,它允許在文件名中使用 Unicode 字符,同樣也允許長文件名。為了與 MS-DOS 兼容,它還創(chuàng)建截斷的文件名(這些看起來怪怪的樣子:FILENA~1.TXT)。它允許文件名長達(dá) 64 個字符(包括空格),Windows 95 或更高版本以及運行 Joliet 卷訪問(Joliet Volume Access)擴(kuò)展的 Macintosh 計算機都可以讀取它。Macs 不會讀取長度超過 31 個字符的 Joliet 文件名。
El Torito:可引導(dǎo) CD-ROM(Bootable CD-ROM)格式規(guī)范
HFS(分層文件系統(tǒng),Hierarchical File System):Macintosh 使用的本機文件系統(tǒng)
多段刻錄(Multisession):允許多次添加文件,而不是只允許在單個段中添加文件。要使盤可讀,就必須“關(guān)閉”段。但是,這卻導(dǎo)致不能向盤中添加更多文件。多段刻錄將單個段鏈接起來,然后更新盤的目錄,使得它好象一個目錄一樣。
CD-UDF(通用盤格式,Universal Disk Format):業(yè)界標(biāo)準(zhǔn)遞增包寫文件系統(tǒng)(incremental packet-writing filesystem)
對 UDF 的一點簡單說明:UDF 意味著能夠直接將文件放入盤。目前,這是在軟件級別上完成的。讀取該盤需要用來創(chuàng)建該盤的軟件。計劃將 UDF 添加到 Linux 內(nèi)核(可能是 2.6)。要實現(xiàn)這一點,CD 驅(qū)動器需要具有 CD-MRW 電路(“CD Mount Rainier ReWrite”;不要問我他們?yōu)槭裁慈∵@么個名字),因此它將是新型驅(qū)動器的一項功能。當(dāng)這一點得到實現(xiàn)時,向 CD-R/RW 中復(fù)制文件將和向軟盤中復(fù)制文件一樣容易,而且這些盤將普遍可讀。而且,它還被吹捧為古老的 3.5" 軟盤的另一種替代品。我們將拭目以待。(請參閱參考資料以獲取到更多有關(guān) Mount Rainier 的信息的鏈接。)

Linux SCSI 仿真冒險
如果可以的話,請使用 IDE/ATAPI 或 SCSI CD 刻錄機。并口接口是一種會給您添麻煩的棘手玩意兒,而 USB 驅(qū)動器則很慢。在 Linux 中它們都得不到很好的支持(雖然對于較新的 USB 2.0 驅(qū)動器,您的運氣可能會好一些)。

IDE/ATAPI 驅(qū)動器最為常見,但使用起來卻需要做些調(diào)整。那么,如果 cdrecord 顯示沒有配置任何驅(qū)動器,會發(fā)生什么事情呢?要想檢查是否配置有驅(qū)動器,請輸入以下命令:

$ cdrecord -scanbus
如果命令顯示了 CD-RW 驅(qū)動器(請參閱后面的燒錄盤),那么您可以跳過這一節(jié)的大部分,盡管您可能還是都想瀏覽一下這些內(nèi)容,以便有所了解。

Linux 使用 SCSI 仿真子系統(tǒng),因此 IDE/ATAPI CD 刻錄機需要兼容性驅(qū)動程序。如果同一臺 PC 上既有 CD-ROM 也有 CD-R/RW,那么二者都需要 ide-scsi 偽設(shè)備驅(qū)動程序來支持盤的復(fù)制。在 CD-ROM 上使用 SCSI 仿真沒有什么不利之處;它同樣能工作;只是名稱會改變。驅(qū)動器的名稱將會隨 Linux 的具體分發(fā)版而有所不同,其名稱可以是 /dev/cdrom0、/dev/hdc 或 /dev/scd0(要獲得 IDE/ATAPI 設(shè)備名列表,請參閱表 1)。

表 1. IDE/ATAPI 設(shè)備名名稱 設(shè)備
hda IDE 總線/連接器 0 主設(shè)備
hdb IDE 總線/連接器 0 從屬設(shè)備
hdc IDE 總線/連接器 1 主設(shè)備
hdd IDE 總線/連接器 1 從屬設(shè)備


要找到系統(tǒng)上的驅(qū)動器,請輸入:

$ dmesg | grep '^hd.:'

hda: IBM-DTLA-305020, ATA DISK drive
hdb: TOSHIBA DVD-ROM SD-M1202, ATAPI CD/DVD-ROM drive
hdc: LITE-ON LTR-24102B, ATAPI CD/DVD-ROM drive
hda: 40188960 sectors (20577 MB) w/380KiB Cache, CHS=2501/255/63, UDMA(66)
大多數(shù)現(xiàn)代 Linux 都包含了已編譯進(jìn)內(nèi)核的 SCSI 仿真:

$ locate ide-scsi.o

/lib/modules/2.4.19/kernel/drivers/scsi/ide-scsi.o
如果您的系統(tǒng)不是這樣的,那么您就必須將它編譯到您的內(nèi)核中。對于這篇篇幅有限的文章來說,那是一個過大的主題,因此請參閱參考資料(當(dāng)您知道如何做時,您會發(fā)現(xiàn)它并不難)。

您需要編輯兩個文本文件來配置系統(tǒng),讓它使用 ide-scsi 驅(qū)動程序。第一個是 /etc/modules.conf(在 Debian 中是 /etc/modules)。我的系統(tǒng)有一個 CD-ROM 和一個 CD-R/RW 驅(qū)動器,設(shè)備分別是 hdb 和 hdc。使用適合于您系統(tǒng)的值,將這兩行添加到 /etc/modules.conf(或 /etc/modules):

ide-cd ignore=\"hdb hdc\"
ide-scsi
缺省情況下,IDE 子系統(tǒng)將所有的 ATA 設(shè)備聲明為它自己的設(shè)備,因此 ignore 這一行使得 SCSI 子系統(tǒng)既能抓取 CD-R/RW 也能抓取 CD-ROM。

接下來,為您的引導(dǎo)裝載程序(GRUB 或 LILO)編輯配置文件。對于 LILO 用戶,請將下面兩行添加到 lilo.conf 的末尾:

append="hdb=ide-scsi"
append="hdc=ide-scsi"
對于 GRUB 用戶,請將下面這行添加到 /etc/grub.conf(或者 Debian 中的 /boot/grub/menu.lst)中 kernel 這行的末尾:

hdb=scsi hdc=scsi
現(xiàn)在重新引導(dǎo),并驗證它是否已裝入:

$ lsmod
這條命令將返回一個長列表;請查找 ide-scsi。

創(chuàng)建 .iso 文件
一旦選擇了您想復(fù)制的文件,對 CD 進(jìn)行刻錄就只有兩步:用 mkisofs 創(chuàng)建 .iso,然后用 cdrecord 將這些文件燒錄進(jìn)盤中。使用以下命令來創(chuàng)建 .iso 文件:

$ mkisofs -o test.iso -Jrv -V test_disk /home/carla/
在上面的示例中:

-o 為新的 .iso 映像文件命名(test.iso)
-J 為了與 Windows 兼容而使用 Joliet 命名記錄
-r 為了與 UNIX/Linux 兼容而使用 Rock Ridge 命名約定,它使所有文件都公共可讀
-v 設(shè)置詳細(xì)模式,以便在創(chuàng)建映像時獲得運行注釋
-V 提供了卷標(biāo)識(test_disk);該標(biāo)識就是出現(xiàn)在 Windows 資源管理器中的盤名
列表中的最后一項是選擇要打包到 .iso 中的文件(都在 /home/carla/ 中)
現(xiàn)在,掛裝 .iso 來進(jìn)行驗證;我喜歡創(chuàng)建一個測試目錄:

$ mkdir /test_iso
$ mount -t iso9660 -o ro,loop=/dev/loop0 test.iso /test_iso
查看目錄的內(nèi)容;所有的文件都應(yīng)該在那里,并且都可讀。否則,就是映像壞掉了,如果您將它燒錄到盤上,那么您最終將得到一個刻錄失敗的光盤。

燒錄盤
將映像寫到盤中再簡單不過了。首先,找到 CD-R/RW 的 SCSI 地址:

$ cdrecord -scanbus

Cdrecord 1.10 (i686-pc-linux-gnu) Copyright (C) 1995-2001 Jrg Schilling
Linux sg driver version: 3.1.24
Using libscg version 'schily-0.5'
scsibus0:
0,0,0 0) 'TOSHIBA ' 'DVD-ROM SD-M1202' '1020' Removable CD-ROM
0,1,0 1) 'LITE-ON ' 'LTR-24102B ' '5S54' Removable CD-ROM
0,2,0 2) *
0,3,0 3) *
0,4,0 4) *
0,5,0 5) *
0,6,0 6) *
0,7,0 7) *

每一項的前三個數(shù)字分別指 SCSI 總線、設(shè)備標(biāo)識和 LUN(邏輯單元號,Logical Unit Number)。(第四個數(shù)字也是設(shè)備標(biāo)識。)cdrecord 需要這三個數(shù)字。在上面的示例中,CD 刻錄機是 0,1,0。SCSI 總線 0 上的設(shè)備都可以縮寫為 1,0,即省去頭一個 0。這是一個公共約定。如果有其它總線的話,則必須指定 — 沒有快捷方式。

現(xiàn)在向盤中寫內(nèi)容:

$ cdrecord -v -eject speed=8 dev=0,1,0 test.iso
在上面的示例中:

-v 指詳細(xì)方式
-eject 在完成寫任務(wù)后彈出盤
-speed 指定寫速度(8)
-dev 是從 cdrecord -scanbus 獲得的設(shè)備號(0,1,0)
最后一個是所燒錄的映像的名稱(test.iso)
對于創(chuàng)建用于公用分發(fā)的盤,這是一種簡單且可用的方法,因為它創(chuàng)建了可以在任何 Windows 或 Linux 系統(tǒng)上讀取的盤。mkisofs 本身就非常適合于創(chuàng)建供下載的 .iso,而且 mkisofs 可以為許多平臺創(chuàng)建文件系統(tǒng)。請參閱 mkisofs 聯(lián)機幫助頁以獲取更多信息。

在一臺運行速度極快且內(nèi)存很大的機器上,您可以在刻錄期間從容地處理非 CPU 密集型任務(wù),但是在燒錄盤期間最好別做別的事情。激光器不能先停下來,然后從停下來的地方重新開始,所以任何中斷都是致命的。

cdrecord 將試圖以最快速度運行刻錄機,因此不必指定速度,但是,應(yīng)該根據(jù)經(jīng)驗來判斷如何做。指定較慢的速度對于糾正錯誤和緩沖區(qū)欠載運行很有用。采用“burn-proof”技術(shù)的新型驅(qū)動器(開發(fā)這項技術(shù)的初衷與它現(xiàn)在的名字正好相反;同樣,誰取的這些名稱呢?)不會有老式驅(qū)動器那樣的緩沖區(qū)欠載運行煩惱。

復(fù)制盤
要直接將內(nèi)容從源盤復(fù)制到可刻錄盤,請使用下面的命令:

$ cdrecord -v dev=0,1,0 speed=4 -isosize /dev/scd0
這條命令直接將 CD-ROM 即 /dev/scd0 的內(nèi)容“流”入 CD 刻錄機 dev=0,1,0。不要在速度慢的舊機器上這么做。直接復(fù)制速度很快,但卻更容易出錯。更好的做法是:先將源盤的內(nèi)容復(fù)制到硬盤驅(qū)動器,再從硬盤驅(qū)動器復(fù)制到 CD 刻錄機:

$ mount /cdrom
$ dd if=/dev/scd0 of=/tmp/diskfile.iso
$ cdrecord dev=0,1,0 speed=8 fs=8m -v -eject -dummy /tmp/diskfile.iso
請注意兩個新選項 fs=8m 和 -dummy。fs=8m 定義了環(huán)形緩沖區(qū)的大。涸谝欢ǔ潭壬希酱笤胶。記住,中斷是致命的;如果什么東西讓數(shù)據(jù)傳送慢下來了,那么 fs=8m 將創(chuàng)建一個足夠大的緩沖區(qū)來讓刻錄機保持運行。如果 8 MB 還不夠,那么您可能需要一臺更好的 PC。另一方面,超過 8 MB 也不一定更好,因為操作系統(tǒng)重新裝入 MMU(內(nèi)存管理單元,Memory Management Unit)表時會浪費時間。缺省值是 4 MB。

-dummy 是一個了不起的選項,可以用它來先進(jìn)行一次“排練”,然后在實際的盤上冒險?啼洐C執(zhí)行一切操作,但是不打開激光頭,這使用戶有機會在將內(nèi)容提交到盤上之前捕獲錯誤。

多段刻錄
CD 由段構(gòu)建而成,而段由磁道構(gòu)成。只有一個段的盤上有一個導(dǎo)入點、一個 TOC(目錄,table of content)、數(shù)據(jù)和一個導(dǎo)出點,導(dǎo)出點標(biāo)記著這張盤的終點,并阻止在這張盤上進(jìn)行進(jìn)一步的刻錄。mkisofs 將單獨段鏈接在一起。用 GUI 程序(如 X-CD-Roast 或 KonCD)創(chuàng)建多段刻錄盤可能要更容易一些,但這里演示的是如何用命令行工具完成這一任務(wù)。

第一次在盤上刻錄一個段時,請在 cdrecord 中使用 -multi 開關(guān):

$ cdrecord -v -eject speed=8 dev=0,1,0 -multi test.iso
盤將會以某種方式被固定下來,使得盤可讀,也可以添加更多數(shù)據(jù)。要向這張盤中添加更多段,mkisofs 需要知道起始扇區(qū)號和結(jié)束扇區(qū)號,可以象下面這樣來找到這些號碼:

$ cdrecord dev=0,1,0 -msinfo
0,27139
確保把要添加數(shù)據(jù)的盤放入了 CD 刻錄機。然后,添加兩個新開關(guān) -C 和 -M:

$ mkisofs -o test2.iso -Jr -V Session2 -C 0,27139 -M 0,1,0 /files/path/
或者更好的辦法是,讓命令 shell 完成這項工作:

$ mkisofs -o test2.iso -Jr -V Session2 -C `cdrecord dev=0,1,0 -msinfo` -M 0,1,0 /files/path/
多段刻錄 CD 驅(qū)動器讀取已寫入的最后一個段。上面的命令從最后一個段獲取 TOC,然后將它組合進(jìn)新 TOC 中。在刻錄盤上的最后一個段時,請省略 -multi 選項。

結(jié)束語
Linux 中的 CD 刻錄功能強大且全面。CD 刻錄機可以跨越網(wǎng)絡(luò)共享,還可用于自動備份;mkisofs 和 cdrecord 也能用于 DVD。雖然有許多優(yōu)秀的圖形前端程序,但是完整的功能在命令行程序上。

論壇徽章:
1
榮譽會員
日期:2011-11-23 16:44:17
2 [報告]
發(fā)表于 2003-08-01 09:38 |只看該作者

(zt) 在 Linux 上燒錄CD

hi, i use the command line "cdrecord" for burning data CD-ROM, but the cdrecord can't scan my BenQ 48x24x48 CD-RW drive, i only know almost all of the burning routines use this command, but under linux, i heard this routine should not be simulates SCSI drive, so i'm puzzlzing now~~~

thanks for your any advice~~     

(sorry, i'm not in my office here, there's no MS-PinYin Chinese input method for me, so i have to use English~~~)

論壇徽章:
1
榮譽會員
日期:2011-11-23 16:44:17
3 [報告]
發(fā)表于 2003-08-01 10:00 |只看該作者

(zt) 在 Linux 上燒錄CD

and i use the Redhat 7.2, KDE 3.0,

when i run this "$ cdrecord -scanbus", prompt me there'r no cd-rw drive found~~`

論壇徽章:
0
4 [報告]
發(fā)表于 2003-08-01 10:34 |只看該作者

(zt) 在 Linux 上燒錄CD

原帖由 "弱智" 發(fā)表:
and i use the Redhat 7.2, KDE 3.0,

when i run this "$ cdrecord -scanbus", prompt me there'r no cd-rw drive found~~`
   

Setup the Linux-system for writing CD-ROMs
This section applies to the following types of CD-writers: SCSI, IDE/ATAPI and the devices for the parallel port. USB CD-writers are not supported as of May 2000. Non-SCSI writers require compatibility drivers, which make them appear as if they were real SCSI devices. On the one side such a unifying strategy is easy ("everything is SCSI", because on the application level you can share your knowledge with other users regardless of their kind of CD-writer. On the other side, you have to reconfigure applications like audio CD players or the mount utility to reflect the change of the driver name. For example, if you accessed your ATAPI CD-writer through the device file /dev/hdc before, you will have to access it through /dev/scd0 after activating the SCSI compatibility drivers.

Once you succeed setting up your hardware and the rest of your Linux-system, the command cdrecord -scanbus shows you a list of devices on your SCSI busses. The goal of this section is to guide you in setting up your Linux-system, so that you finally end up seeing something like:


shell>; cdrecord -scanbus
Cdrecord release 1.7a1 Copyright (C) 1995-1998 J&rg Schilling
scsibus0:
      0,0,0) 'Quantum ' 'XP34300         ' 'F76D' Disk
      0,1,0) 'SEAGATE ' 'ST11200N        ' '8334' Disk
      0,2,0) *
      0,3,0) 'TOSHIBA ' 'MK537FB/        ' '6258' Disk
      0,4,0) 'WANGTEK ' '5150ES SCSI 36  ' 'ESB6' Removable Tape
      0,5,0) 'EXABYTE ' 'EXB-8500-85QUE  ' '0428' Removable Tape
      0,6,0) 'TOSHIBA ' 'XM-3401TASUNSLCD' '3593' Removable CD-ROM
      0,7,0) *
scsibus1:
      1,0,0) 'Quantum ' 'XP31070W        ' 'L912' Disk
      1,1,0) *
      1,2,0) *
      1,3,0) 'TEAC    ' 'CD-R55S         ' '1.0H' Removable CD-ROM
      1,4,0) 'MATSHITA' 'CD-R   CW-7502  ' '4.02' Removable CD-ROM
      1,5,0) *
      1,6,0) 'YAMAHA  ' 'CDR400t         ' '1.0d' Removable CD-ROM
      1,7,0) *

Listing: Detecting devices on your SCSI bus
The example was provided by J&rg Schilling and shows a total of four CD-writers. Please note that -scanbus also reports other devices, e.g. regular CD-ROMs and hard disk drives. The last column gives the SCSI description of the device, from which you cannot clearly distinguish ordinary CD-ROM drives from those with burning capability. But the product identification (middle column) often has hints about the feature in form of a R, -R or -RW.



1 Quickstart
This section is an attempt to provide an fast and easy description of the configuration. Not all possible setups are covered, but please go on and try it out anyways. First of all, check the Linux kernel version printed by the command "uname -r". It should be something like 2.0.X or 2.2.Y, where X is higher than 36 and Y is higher than 11. If you run older versions or the so called development kernels, you are on your own. Installing a new kernel is as much work as fixing an old one, so I have removed all hints you need for buggy kernels.
The listing below shows a set of commands you could start with. The commands create device file entries under /dev unless they already exists.


test `whoami` = 'root' || echo "You must be root to execute the commands."
cd /dev/
umask -S u=rwx,g=rwx,o-rwx
[ -f loop0 ] \
    || ./MAKEDEV loop \
    || for i in 0 1 2 3 4 5 6 7; do mknod loop$i b 7 $i; done
[ -f sg0 -o -f sga ] \
    || ./MAKEDEV sg \
    || for i in 0 1 2 3 4 5 6 7; do mknod sg$i  c 21 $i; done

Listing: creating of devicefiles
Hardware access is usally implemented through device files under Linux. So before any other thing you make sure those files do exists in the directory /dev. Still nobody could give me a compelling reason why this has not been automated through techniques like the device filesystem (devfs). The devfs is available for years know, brings a safer (!) and a far clearer naming of devices and makes the device entries appear automatically under /dev. Some prominent people argue devfs is not the perfect solution, but they do not come up with anything better, not even something comparable and last but least nothing available and tested now. Lets start to use devfs, so I can remove the above commands from this document. ( http://www.atnf.CSIRO.AU/~rgooch/linux/kernel-patches.html)


Next thing to ensure is, that the Linux kernel is equiped with the necessary drivers. The following commands check various files for the presence of drivers in the running Linux kernel. Usally the command "cdrecord -scanbus" should trigger an automatic loading of all drivers. In case a driver is not present in the kernel afterwards, it is reported and the modularized driver (module) is manually loaded through insmod.



test `whoami` = 'root' || echo "You must be root to execute the commands."
cdrecord -scanbus >; /dev/null
if ! (pidof kerneld || test -f "/proc/sys/kernel/modprobe"; then
    echo "Neither kerneld nor kmod are running to automatically load modules".
fi
report_no_autoload() {
    echo "Ensure the module $1 is loaded automatically next time."
}
if test ! -f "/proc/scsi/scsi"; then
    report_no_autoload scsi_mod  &&  insmod scsi_mod
fi
if ! grep "^........ sg_" /proc/ksyms >; /dev/null; then
    report_no_autoload sg  &&  insmod sg
fi
if ! grep "^........ sr_" /proc/ksyms >; /dev/null; then
    report_no_autoload sr_mod  &&  insmod sr_mod
fi
if ! grep "^........ loop_" /proc/ksyms >; /dev/null; then
    report_no_autoload loop  &&  insmod loop
fi
if ! grep iso9660 /proc/filesystems >; /dev/null; then
    report_no_autoload iso9660  &&  insmod iso9660
fi
echo "The following is only needed for IDE/ATAPI CD-writers."
if ! grep ide-scsi /proc/ide/drivers >; /dev/null; then
    report_no_autoload ide-scsi  &&  insmod ide-scsi
fi
cdrecord -scanbus

Listing: Testing for drivers

Please read the next chapter if insmod complains about missing module files. If you are in text mode (console), the loading of modules may cause some messages to be printed on your screen. If you are in graphics mode (X11, KDE, Gnome), you can recall these messages with the command dmesg.

There are several ways to load the modules next time you start up your Linux system:


(1) Put the relevant insmod command into the startup sequence
    (a shell script named rc.local or equivalent).
(2a) Run kerneld or kmod and
(2b) configure them in /etc/modules.conf (to be more precise,
     you configure the utility modprobe, which is called by the daemons)

People with a SCSI-writer can skip the rest of this section, because cdrecord will most likely already detect their hardware. If not, then please send me an email with some information about your setup, so I can improve the section about SCSI-writers.

Now to the people with CD-writers for IDE/ATAPI. As written in the previous chapter, you have to load the compatibility driver ide-scsi. But this driver can only access your CD-Writer if no other driver has already done so. In other words, you have to tell the regular IDE driver to leave your CD-writer unrecognized, so the ide-scsi driver can grab it.


hda = IDE bus/connector 0 master device
hdb = IDE bus/connector 0 slave  device
hdc = IDE bus/connector 1 master device
hdd = IDE bus/connector 1 slave  device

Table: device file names of IDE/ATAPI devices
The table above shows the relation of device file names and the placing of devices on the IDE busses. The device file name representing your CD-Writer has to be passed to the driver in the Linux kernel. Example: hdb=ide-scsi. Such a setting should be added to lilo.conf or chos.conf if the driver is statically compiled into your kernel, which seems to be the most common setup. If you need to pass more than one parameter to the kernel, then seperate them with spaces (like shown in the chos example). The next two listings show example configurations containing more lines than just the relevant append-line. Please note the append- and cmdline-entries are image-specific (ie. don't add them immediatly at the top).



image=/boot/zImage-2.2.14
  label=Linux
  read-only
  append="hdb=ide-scsi"

Listing: Example configuration for lilo (/etc/lilo.conf)

linux "Linux 2.1.14" {
        image=/boot/zImage-2.0.37
        cmdline= root=/dev/hda5 readonly hdb=ide-scsi
}

Listing: Example configuration for chos (/etc/chos.conf)
If the driver for IDE/ATAPI CD-ROMs is loaded as a module, then the above won't make any difference to you, but make sure you include the options-line from the next listing. The last three lines of that listing are generally suggested to further automate the loading of the required modules.


options ide-cd ignore=hdb            # tell the ide-cd module to ignore hdb
alias scd0 sr_mod                    # load sr_mod upon access of scd0
#pre-install ide-scsi modprobe imm    # uncomment for some ZIP drives only
pre-install sg     modprobe ide-scsi # load ide-scsi before sg
pre-install sr_mod modprobe ide-scsi # load ide-scsi before sr_mod
pre-install ide-scsi modprobe ide-cd # load ide-cd   before ide-scsi

Listing: Example configuration for /etc/modules.conf
If your CD-writer is the only CD-ROM attached to your machine, then remember you have to access the CD-ROM in the writer through the device file /dev/scd?where ?0,..,8. You may want to change the symbolic name cdrom to point to the new device file name. The listing below shows the command to achieve this with the example scd0.


cd /dev && rm cdrom && ln -s scd0 cdrom

Listing: Making cdrom a symbolic name for scd0
If your CD-writer and CD-ROM-drive are two different devices, then don't change the cdrom symlink.




Special notes about SCSI CD-writers

Please make sure that your writer is recognized by the BIOS of your SCSI hostadaptor card. Every SCSI hostadaptor scans the SCSI bus after power on and reports all devices found connected to the bus. The report includes the SCSI ID of the devices and their product label. It makes no sense to proceed unless your CD writer is listed in that report.

If you plan to connect your SCSI device through the parallel port (not to confuse with the IDE drives for the parallel port), you need a special active cable and a special kernel driver. Read http://www.torque.net/parport/parscsi.html to learn more about this option.


Special notes about CD-writers for the parallel port

I have no clue about this, sorry. Please read http://www.torque.net/parport/paride.html or your local file /usr/src/linux/Documentation/paride.txt.



Compiling missing kernel modules (optional)

You don't need to read this section if you hardware is already sucessfully recognized and configured by the previously described configuration steps.

The Linux kernel can be equipped with drivers for various features. You can compile the drivers into the kernel image statically or you can compile them as a module for on-demand loading. The last method is preferred for drivers not essential for bringing your Linux-system into life, because your kernel will be smaller and faster then. However, some drivers are essential for the system to come up and you shouldn't compile them as a module. Example: if your system lives on an IDE hard disk, you must have the driver for IDE hard disks in the kernel -- not as a module.

There are three different types of CD-writers: SCSI, IDE/ATAPI and external writers that work through the parallel port. The table shows how to configure the Linux kernel for those hardware types. The first column of the table is the section of the kernel configuration menu, where you can find the setting. The second column is the description of the feature (taken from the kernel configuration menu, too). The third column gives the name of the resulting module. The columns named SCSI, IDE and PP contain the necessary options for the associated hardware (PP = parallel port).


Sect.  Description                 Module   SCSI  IDE   PP
------------------------------------------------------------
BLOCK  Enhanced IDE/MFM/RLL...                     Y      
BLOCK  IDE/ATAPI CDROM             ide-cd          M     
BLOCK  SCSI emulation support      ide-scsi        M      
BLOCK  Loopback device             loop       M    M     M

PARIDE Parallel port IDE device    paride               Y/M
PARIDE Parallel port ATAPI CD-ROMs                       M
PARIDE Parallel port generic ATAPI                       M
PARIDE (select a low-level driver)                       Y

SCSI   SCSI support                scsi_mod  Y/M  Y/M   
SCSI   SCSI CD-ROM support         sr_mod    Y/M  Y/M     
SCSI     Enable vendor-specific               Y    Y      
SCSI   SCSI generic support        sg        Y/M  Y/M     
SCSI   (select a low-level driver)            Y

FS     ISO 9660 CDROM filesystem   iso9660   Y/M  Y/M   Y/M
FS     Microsoft Joliet cdrom...   joliet     Y    Y     Y

Table: driver selection for different writer types
Y stands for yes and means you should put the beast into the kernel. M stands for module and means you should or must compile this feature as a module. Y/M gives you the option to decide between either (order indicates choices with less potential problems). Empty settings don't need to be modified and not changing them increases the chance that the resulting kernel will work for you (if it did before...). Especially in environments where SCSI and ATAPI devices are mixed, you better build most things as modules.

Compiling loopback device is optional. It allows you to test the image before writing it to the media. If you want to be able to read CD-ROMs, you need support for the ISO 9660 filesystem. This driver automatically includes RockRidge Extensions. The Microsoft Joliet CD-ROM extensions have to be explicitly added to the ISO 9660 filesystem. In any case, you need a low-level driver for your hardware. Low-level refers to the driver, which interacts directly with the hardware. For SCSI and the parallel port, there are a lot of low-level drivers available.

Installing the resulting Linux-kernel is beyond the scope of this HOWTO. Please consult the documentation of your Linux-distribution.

Users of RedHat Linux be aware that you have to compile in the features "Ramdisk support" and "Initial ramdisk". Furthermore, you have to generate a new ramdisk with the new modules by issuing a command like "mkintrd --preload ide-cd initrd-2.2.14.img 2.2.14".



2 Get the user software for burning CD-Rs
A more detailed survey of tools related to produce CD-ROMs is available from http://www.fokus.gmd.de/research/cc/glone/employees/joerg.schilling/private/cdb.html.


Command line utilities
One of the following packages are required to generate images of CD-Rs (only required for data CD-ROMs):


ftp://tsx-11.mit.edu/pub/linux/packages/mkisofs/ (mkisofs)
ftp://ftp.ge.ucl.ac.uk/pub/mkhfs (mkhybrid)

To write images to the CD-R, you need one of the following software packages:


ftp://ftp.fokus.gmd.de/pub/unix/cdrecord/ (cdrecord)
http://www.ping.de/sites/daneb/cdrdao.html (cdrdao)

http://www.munich-vision.de/vcd/ (mkvcdfs)

Don't trust the man page of old versions of mkisofs which state you need version 1.5 of cdwrite. Just use cdrecord and you are fine. Please note that newer versions of cdrecord ship with an enhanced version of mkisofs and some extra tools in the subdirectory misc/ (readcd, isosize) not found elsewhere.



Graphical user interfaces (optional)
Front-ends are really front-ends under Linux. That means, you still have to install the command-line utilities, but you access them in a better looking manner.

X-CD-Roast is a program package dedicated to easy CD creation under Linux. It combines command line tools like cdrecord and mkisofs into a nice graphical user interface.


http://www.fh-muenchen.de/home/ze/rz/services/projects/xcdroast/e_overview.html
BurnIT is a JAVA front-end to cdrecord, mkisofs and cdda2wav-0.95 making it a complete package for burning CDs on the Unix platform. It is available from


http://sunsite.auc.dk/BurnIT/
CD-Tux is a character based frontend for the programs mkisofs and cdrecord. "It creates an easy to use enviroment for doing almost anything to a CD in full color through the use of the (in)famous NCURSES Library. And it does all this whith an executable of under 75K."


http://www.datadictator.co.za/cdtux/

論壇徽章:
0
5 [報告]
發(fā)表于 2003-08-01 10:40 |只看該作者

(zt) 在 Linux 上燒錄CD

[quote]原帖由 "弱智"]hi, i use the command line "cdrecord" for burning data CD-ROM, but the cdrecord can't scan my BenQ 48x24x48 CD-RW drive, i only know almost all of the burning routines use this command, but under linu..........[/quote 發(fā)表:
   
Please check first, that the writer works under the software it is shipped with (=under another operating system). Concretely:


Does the controller recognize the writer as a SCSI device?
Does the driver software recognize the writer?
Is it possible to make a CD using the accompanied software?
If "it doesn't even work" with the accompanied software you have a hardware conflict or defective hardware. If it works and you use loadlin to boot Linux, then that is a problem with loadlin. Loadlin makes a warm-boot with most of the hardware already initialized and that can confuse the Linux kernel.

論壇徽章:
208
巨蟹座
日期:2013-09-02 09:16:36卯兔
日期:2013-09-02 20:53:59酉雞
日期:2013-09-05 21:21:45戌狗
日期:2013-10-15 20:51:17寅虎
日期:2013-10-18 21:13:16白羊座
日期:2013-10-23 21:15:19午馬
日期:2013-10-25 21:22:48技術(shù)圖書徽章
日期:2013-11-01 09:11:32雙魚座
日期:2013-11-01 20:29:44丑牛
日期:2013-11-01 20:40:00卯兔
日期:2013-11-11 09:21:32酉雞
日期:2013-12-04 19:56:39
6 [報告]
發(fā)表于 2003-08-01 10:40 |只看該作者

(zt) 在 Linux 上燒錄CD

弱智,開機后,系統(tǒng)缺省加載了ide-cd,而cdrecord需要scsi-cd模擬,所以試試
#rmmod ide-cd
#modprobe ide-scsi
#cdrecord -scanbus
代哦向哦m問好

論壇徽章:
1
榮譽會員
日期:2011-11-23 16:44:17
7 [報告]
發(fā)表于 2003-08-01 11:45 |只看該作者

(zt) 在 Linux 上燒錄CD

呵呵,謝謝樓主和“流產(chǎn)者”,現(xiàn)在回自己的地盤了,所以能打漢字了。

我回去試試看。

btw: “流產(chǎn)者”,purge的龍龍MM是你JJ,不是你MM。
您需要登錄后才可以回帖 登錄 | 注冊

本版積分規(guī)則 發(fā)表回復(fù)

  

北京盛拓優(yōu)訊信息技術(shù)有限公司. 版權(quán)所有 京ICP備16024965號-6 北京市公安局海淀分局網(wǎng)監(jiān)中心備案編號:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年舉報專區(qū)
中國互聯(lián)網(wǎng)協(xié)會會員  聯(lián)系我們:huangweiwei@itpub.net
感謝所有關(guān)心和支持過ChinaUnix的朋友們 轉(zhuǎn)載本站內(nèi)容請注明原作者名及出處

清除 Cookies - ChinaUnix - Archiver - WAP - TOP