Chinaunix首页 | 论坛 | 博客
  • 博客访问: 606603
  • 博文数量: 138
  • 博客积分: 3067
  • 博客等级: 中校
  • 技术积分: 1565
  • 用 户 组: 普通用户
  • 注册时间: 2008-02-21 12:44
文章分类

全部博文(138)

文章存档

2016年(5)

2014年(4)

2012年(1)

2011年(2)

2010年(10)

2009年(19)

2008年(97)

我的朋友

分类:

2008-07-24 12:12:00

How to use your CD writer under Linux

First, you need a compatible CD burner. Linux works with SCSI CD-burners, IDE CD-burners (through ide-scsi emulation), and USB CD burners. In all cases, the device appears as a SCSI device. If you can see your device with the command 'cdrecord -scanbus', then you are ready to burn. If so, skip to section 2.

Section 1: Configuring your CD writer

Often, people have a IDE cd-writer, but don't have the ide-scsi emulation turned on. This is best done by editing the /etc/lilo.conf on your computer, and adding an entry to your current boot option:
image=/boot/vmlinuz-STD-current
label=linux
read-only
root=/dev/device
append="hdb=ide-scsi"

(NOTE: this is just an example, your root partition and CD-writer device might be different. If you have any problems identifying or configuring your CD-writer, contact ).
Once you have configured lilo, re-run /sbin/lilo to install the new bootloader, and reboot.

Section 2: Using cdrecord

The output of 'cdrecord -scanbus' will look something like this:
# cdrecord -scanbus
Cdrecord 1.9 (i686-pc-linux-gnu) Copyright (C) 1995-2000 Jörg Schilling
Linux sg driver version: 3.1.22
Using libscg version 'schily-0.1'
scsibus0:
0,0,0 0) 'TOSHIBA ' 'DVD-ROM SD-R1202' '1020' Removable CD-ROM
0,1,0 1) *
0,2,0 2) *
0,3,0 3) *
0,4,0 4) *
0,5,0 5) *
0,6,0 6) *
0,7,0 7) *

The CD writer is the device labeled '0,0,0' in this example. You can now use cdrecord to burn an audio or data CD, using that device number. Here's an example of how to burn an ISO image to a cd, using cdrecord:
# cdrecord -v speed=2 dev=0,0,0 -data cdimage.iso
Read the man page for 'cdrecord' for more options and examples.

Section 3: Making ISO images

You may want to generate a CD image containing data. You can do this with the comand 'mkisofs'.
       mkisofs  -r   -o cd_image   private_collection/
`---------' `-----------------'
| |
write output to take directory as input
You can then use cdrecord to write cd_image to a CD.

Additional information

The following off-site links will open in a new browser window:

is a good place to find more information about writing CDs under linux.


1、准备
 cdrecord可以支持IDE、SCSI接口的光盘刻录设备,新版本可以支持CD、DVD光盘刻录。

#cdrecord -scanbus

查看刻录设备的连接端口,如IE的第一个通道的Master设备为:0,0,0

扫IDE光驱可以用cdrecord dev=ATAPI -scan,可又看到有另一个参数,是cdrecord dev=ATA -scan


2、光盘的一次性刻录

cdrecord -v dev=0,0,0 speed=24 file.iso

-v 是显示刻录信息
dev=设备号,必须使用cdrecord -scanbus获得,不同于linux的设备号
speed=速度,直接跟数字,没有X,例如24,而不是24X
file.iso 需要刻录的iso文件,可以使用mkisofs生成
2、光盘的多段刻录
第一次刻录:

cdrecord -v dev=0,0,0 -multi -data firstimage speed=8

-mulit 使用多段刻录模式
-data firstimage 指定第一次刻录的文件(.iso)
后续的刻录,先执行:

cdrecord msinfo

获得类似0,23456的数值;

mkisofs -L -l -v -r -C xx,yy -o secondimage

其中,xx,yy就是前面的0,23456值。
写入:

cdrecord -v dev=0,0,0 -multi -data secondimage speed=8


3、格式化CDRW
当我们遇到CDRW的时候,我们必须要先格式化它,然后才能使用:

cdrecord -v dev=0,0,0 blank=fast

快速格式化


cdrecord -v dev=0,0,0 blank=all

完全格式化
接着就可以当普通的CDR光盘进行了。

4、DVD刻录
由于cdrecord会自动识别CDR和DVDR介质,我们不要额外的考虑他们的区别,直接用上述的命令即可。

5、注意事项
红旗DC 5.0使用了最新的2.6核心,所以在设备的识别上跟以往的2.4核心有点不同,我们在使用cdrecord前,可以先做一个链接:

ln -s /dev/hdb /dev/pg0




CDRECORD 的使用2008年01月11日 星期五 下午 03:11cdrecord是OpenSolaris上一个功能强大的用以刻录CD/DVD的命令行工具。与之前的cdrw相比,cdrecord能更好的兼容USB和1394接口的刻录机,而cdrw则仅推荐在内置的IDE/ATAPI刻录机上使用。

在继续之前,让我们先来了解一下与刻录相关的概念。

CD-R:可刻录CD(CD-Recordable)。只能够写入一次,可多次读取。(WORM,Write Once, Read Many)
CD-RW:可重写CD(CD-Rewritable)。多次写,多次读。(WMRM,Write Many,Read Many)
DVD+R:可刻录DVD,只能写入一次。容量为4.7GB,于2002年由众多公司共同支持的DVD+RW联盟开发。并于2003年开始支持双面存储, 使得容量达到了8.5GB。该标准不被DVD论坛接纳,并声称DVD+R并非官方DVD格式,但是很多厂商仍然支持该格式。
DVD+RW:可重写DVD,可多次写入。由DVD+RW联盟开发,容量达到了4.7GB,可重写近1,000次
DVD-R:可刻录DVD,仅能写入一次。最初容量为4.7GB,于2005年开始支持容量可达8.5GB的双面存储。于DVD+R相比,DVD-R由 Poineer公司开发并获得了DVD论坛的承认而被大部分DVD播放器应用。现在很多能同时支持这两种格式的DVD机,一般都注明DVD±R标记。
DVD-RW:可重写DVD,可多次写入。由Pioneer公司开发,容量为4.7GB,可重写近1,000次
DVD的[+]和[-]标准在市场上同样受欢迎,很多刻录机/影碟机都同时支持这两种标准
下面是与文件格式相关的一些术语:

ISO-9660:旧的和DOS兼容的文件系统,仅支持8,3文件名格式
Rock Ridge:ISO-9660文件系统的扩展。支持长文件名、UNIX符号链接和文件属性(rwx)等
Joliet:微软对ISO -9660文件系统的扩展。支持unicode编码的文件名和长文件名(64个unicode字符)。在只支持8个字符文件名的操作系统(比如 Windows 3.1)中,CD上一个长于8个字符的文件名将通过在一位数字后面加一个波浪符号(~)作为这个名字的最后一个字符来将其删减为8字符的文件名。
Multisession:多区段刻录,允许多次添加/写入文件。每个刻录过程只刻录并且关闭一个区段(session),剩余空间下次可以继续刻录下一区段。
DAO:Disc-At-Once,是在一个刻录过程中在一片光盘中刻入全部数据的方式。轨道(track)间没有间隔,在刻录录结束时自动关闭光盘。
TAO:Track -At-Once,是在一个刻录过程中逐个刻录所有轨道(track),轨道之间有间隔。如果是数据轨道和音轨之间,则间隔为2到3秒,如果是音轨之间则 间隔为2秒。刻录时可以选择不关闭区段,以后还可以添加轨道到光盘的这一区段,一般用于音乐CD的刻录,而对数据光盘无效。在CD或VCD播放机上播放 时,区段必须关闭。刻录时也可以选择不关闭光盘,则以后还可以继续追加刻录下一区段。
扫描刻录机
用cdrecord -scanbus扫描系统SCSI总线确定设备的描述符(例如:0,4,0)
示例:
# cdrecord -scanbus
Cdrecord-ProDVD-Clone 2.01.01a10 (i386-pc-solaris2.11) Copyright (C) 1995-2006 J rg Schilling
Warning: Using USCSI interface.
Using libscg version 'schily-0.8'.
scsibus0:
        0,0,0     0) 'MATSHITA' 'DVD-R   UJ-857D ' 'KCV9' Removable CD-ROM
        0,1,0     1) *
        0,2,0     2) *
        0,3,0     3) *
        0,4,0     4) *
        0,5,0     5) *
        0,6,0     6) *
        0,7,0     7) *这里设备描述符是“0,0,0”
创建.iso文件
OpenSolaris上刻录通常分两步完成,首先用mkisofs生成ISO映像,然后用cdrecord刻录CD/DVD。创建ISO映像示例如下。
# mkisofs -o backup.iso -J -r -v -V "Backup Volume" /path/to/mybackup其中,-o 输出.iso文件名
-J 为了与Windows兼容,使用Joliet命名记录
-r 为了与UNIX/Linux兼容,使用Rock Ridge命名方式
-v 打印命令执行的详细信息
-V 指定卷ID
最后一个参数是要生成iso映像的目录路径另外,在Solaris中可以用lofiadm命令把iso文件虚拟成块设备而mount到系统中
# lofiadm -a /export/iwork.iso
阅读(976) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~