红联Linux门户
Linux帮助

RedHat命令行刻录光盘

发布时间:2017-06-20 09:43:10来源:blog.csdn.net/sch0120作者:Charles_Shih
准备工作
Fedora25
cdrecord刻录软件
DVD刻录机
DVD-R刻录光盘或DVD-RW可擦写光盘一张
 
安装软件
yum install -y cdrecord
 
刻录光盘
验证光盘(仅可擦写光盘)
如果光盘有内容,最好先确认一下。
 
擦除数据(仅可擦写光盘)
[root@dhcp-14-171 ~]# umount /dev/cdrom
[root@dhcp-14-171 ~]# cdrecord --dev=/dev/cdrom --blank=fast
Device type    : Removable CD-ROM
Version        : 5
Response Format: 2
Capabilities   : 
Vendor_info    : 'PLDS    '
Identification : 'DVD-RW DH16AFSH '
Revision       : 'DL31'
Device seems to be: Generic mmc2 DVD-R/DVD-RW.
Using generic SCSI-3/mmc DVD-R(W) driver (mmc_mdvd).
Driver flags   : SWABAUDIO BURNFREE 
Supported modes: PACKET SAO
Speed set to 2770 KB/s
Starting to write CD/DVD at speed   2.0 in real BLANK mode for single session.
Last chance to quit, starting real write in    0 seconds. Operation starts.
[root@dhcp-14-171 ~]# 
 
刻录光盘
将镜像文件RHEL5.11-Server-20140827.0-x86_64-DVD.iso刻录到光盘:
[root@dhcp-14-171 ~]# cdrecord -v -eject dev=/dev/cdrom /home/cheshi/Downloads/RHEL5.11-Server-20140827.0-x86_64-DVD.iso
wodim: No write mode specified.
wodim: Assuming -tao mode.
wodim: Future versions of wodim may have different drive dependent defaults.
TOC Type: 1 = CD-ROM
scsidev: '/dev/cdrom'
devname: '/dev/cdrom'
scsibus: -2 target: -2 lun: -2
Linux sg driver version: 3.5.27
Wodim version: 1.1.11
SCSI buffer size: 64512
Device type    : Removable CD-ROM
Version        : 5
Response Format: 2
Capabilities   : 
Vendor_info    : 'PLDS    '
Identification : 'DVD-RW DH16AFSH '
Revision       : 'DL31'
Device seems to be: Generic mmc2 DVD-R/DVD-RW.
Current: 0x0011 (DVD-R sequential recording)
Profile: 0x002B (DVD+R/DL) 
Profile: 0x001B (DVD+R) 
Profile: 0x001A (DVD+RW) 
Profile: 0x0016 (DVD-R/DL layer jump recording) 
Profile: 0x0015 (DVD-R/DL sequential recording) 
Profile: 0x0014 (DVD-RW sequential recording) 
Profile: 0x0013 (DVD-RW restricted overwrite) 
Profile: 0x0012 (DVD-RAM) 
Profile: 0x0011 (DVD-R sequential recording) (current)
Profile: 0x0010 (DVD-ROM) 
Profile: 0x000A (CD-RW) 
Profile: 0x0009 (CD-R) 
Profile: 0x0008 (CD-ROM) 
Profile: 0x0002 (Removable disk) 
Using generic SCSI-3/mmc DVD-R(W) driver (mmc_mdvd).
Driver flags   : SWABAUDIO BURNFREE 
Supported modes: PACKET SAO
Drive buf size : 262144 = 256 KB
Beginning DMA speed test. Set CDR_NODMATEST environment variable if device
communication breaks or freezes immediately after that.
FIFO size      : 4194304 = 4096 KB
Track 01: data  4239 MB        
Total size:     4868 MB (482:19.52) = 2170464 sectors
Lout start:     4868 MB (482:21/39) = 2170464 sectors
Current Secsize: 2048
HINT: use dvd+rw-mediainfo from dvd+rw-tools for information extraction.
Blocks total: 2298496 Blocks current: 2298496 Blocks remaining: 128032
Speed set to 22160 KB/s
Starting to write CD/DVD at speed  17.0 in real unknown mode for single session.
Last chance to quit, starting real write in    0 seconds. Operation starts.
Waiting for reader process to fill input buffer ... input buffer ready.
Performing OPC...
Starting new track at sector: 0
Track 01: 4239 of 4239 MB written (fifo 100%) [buf  95%]   8.4x.
Track 01: Total bytes read/written: 4445110272/4445110272 (2170464 sectors).
Writing  time:  477.486s
Average write speed   7.0x.
Min drive buffer fill was 93%
Fixating...
Fixating time:    9.140s
wodim: fifo had 70015 puts and 70015 gets.
wodim: fifo was 0 times empty and 21105 times full, min fill was 90%.
[root@dhcp-14-171 ~]# 
 
校验光盘
[root@dhcp-14-171 ~]# dd if=/dev/cdrom of=/root/temp.iso
8681856+0 records in
8681856+0 records out
4445110272 bytes (4.4 GB, 4.1 GiB) copied, 299.322 s, 14.9 MB/s
[root@dhcp-14-171 ~]# md5sum /root/temp.iso /home/cheshi/Downloads/RHEL5.11-Server-20140827.0-x86_64-DVD.iso
5f83a3849aa0aaeacdf6430e54ddb1da  /root/temp.iso
5f83a3849aa0aaeacdf6430e54ddb1da  /home/cheshi/Downloads/RHEL5.11-Server-20140827.0-x86_64-DVD.iso
注意:如果刻录光盘时没有添加-eject参数,那么刻录完成后光盘将不会自动弹出。如果光盘没有被重新插入,那么dd命令可能无法正确工作,这时并不能说明是光盘有问题。所以,建议大家在进行后续操作之前,一定要推出并重新插入光盘。
 
总结
对于刻录光盘的总结:
1. RedHat Linux下可以通过cdrecord命令刻录光盘,刻录完成后最好推出并重新插入光盘。
2. 使用dd和md5sum命令可以校验光盘。
 
本文永久更新地址:http://www.linuxdiyf.com/linux/31601.html