Home -- Michael's Blog :: Just Do IT -- Manuals

16.7. 创建和使用光学介质(DVD)

Contributed by Marc Fonvieille. With inputs from Andy Polyakov.

16.7.1. 介绍

和 CD 相比,DVD 是下一代光学存储介质技术。 DVD 可以容纳比任何 CD 更多的数据,已经成为现今视频出版业的 标准。

我们称作可记录 DVD 的有五种物理记录格式:

一张单层的可记录 DVD 可以存储 4,700,000,000 字节,相当于 4.38 GB 或者说 4485 MB (1 千字节等于 1024 字节)。

注: 必须说明一下物理介质与应用程序的分歧。 例如 DVD-Video 是一种特殊的文件系统, 可以被覆写到任何可记录的 DVD 物理介质上: DVD-R, DVD+R, DVD-RW 等等。在选择介质类型之前, 你一定要确认刻录机和 DVD-Video 播放器 (一种单独的播放器或者计算机上的 DVD-ROM 驱动器) 是和这种介质兼容的。

16.7.2. 配置

growisofs(1) 将被用来实施 DVD 刻录。 这个命令是 dvd+rw-tools 工具集 (sysutils/dvd+rw-tools) 的一部分。 dvd+rw-tools 支持所有的 DVD 介质类型。

这些工具将使用 SCSI 子系统来访问设备,因此 ATAPI/CAM 支持 必须加入内核。 如果你的刻录机采用 USB 接口则不需要这么做,请参考 第 16.5 节 来了解 USB 设备配置的进一步详情。

此外,还需要启用 ATAPI 设备的 DMA 支持。 这一工作可以通过在 /boot/loader.conf 文件中加入下面的行来完成:

hw.ata.atapi_dma="1"

试图使用 dvd+rw-tools 之前你应该参考 dvd+rw-tools' 硬件兼容性列表 是否有与您的 DVD 刻录机有关的信息。

注: If you want a graphical user interface, you should have a look to K3b (sysutils/k3b) which provides a user friendly interface to growisofs(1) and many others burning tools.

16.7.3. 刻录数据 DVD

growisofs(1) 命令是 mkisofs 的前端,它会调用 mkisofs(8) 来创建文件系统布局,完成到 DVD 上的刻录。 这意味着你不需要 在刻录之前创建数据映像。

要把 /path/to/data 目录的数据刻录到 DVD+R 或者 DVD-R 上面,使用 下面的命令:

# growisofs -dvd-compat -Z /dev/cd0 -J -R /path/to/data

-J -R 选项传递给 mkisofs(8) 用于文件系统创建(这种情况下: 带有 joliet 和 Rock Ridge 扩展的 ISO 9660 文件系统), 参考 mkisofs(8) 手册页了解更多 细节。

选项 -Z 用来在任何情况下初始刻录会话: 不管多会话与否。 DVD 设备,/dev/cd0,必须依照 你的配置做出改变。 -dvd-compat 参数会结束光盘, 光盘成为不可附加的。这会提供更多的 和 DVD-ROM 驱动器的介质兼容性。

也可以刻录成一个 pre-mastered 映像, 例如记录一个映像文件 imagefile.iso, 我们可以运行:

# growisofs -dvd-compat -Z /dev/cd0=imagefile.iso

刻录的速度可以被检测到并自动进行调整, 根据介质和驱动器的使用情况。如果你想强制改变速度, 可以使用 -speed= 参数。更多的信息,请看 growisofs(1) 手册页。

16.7.4. Burning a DVD-Video

A DVD-Video is a specific file layout based on ISO 9660 and the micro-UDF (M-UDF) specifications. The DVD-Video also presents a specific data structure hierarchy, it is the reason why you need a particular program such as multimedia/dvdauthor to author the DVD.

If you already have an image of the DVD-Video file system, just burn it in the same way as for any image, see the previous section for an example. If you have made the DVD authoring and the result is in, for example, the directory /path/to/video, the following command should be used to burn the DVD-Video:

# growisofs -Z /dev/cd0 -dvd-video /path/to/video

The -dvd-video option will be passed down to mkisofs(8) and will instruct it to create a DVD-Video file system layout. Beside this, the -dvd-video option implies -dvd-compat growisofs(1) option.

16.7.5. Using a DVD+RW

Unlike CD-RW, a virgin DVD+RW needs to be formatted before first use. The growisofs(1) program will take care of it automatically whenever appropriate, which is the recommended way. However you can use the dvd+rw-format command to format the DVD+RW:

# dvd+rw-format /dev/cd0

You need to perform this operation just once, keep in mind that only virgin DVD+RW medias need to be formatted. Then you can burn the DVD+RW in the way seen in previous sections.

If you want to burn new data (burn a totally new file system not append some data) onto a DVD+RW, you do not need to blank it, you just have to write over the previous recording (in performing a new initial session), like this:

# growisofs -Z /dev/cd0 -J -R /path/to/newdata

DVD+RW format offers the possibility to easily append data to a previous recording. The operation consists in merging a new session to the existing one, it is not multisession writing, growisofs(1) will grow the ISO 9660 file system present on the media.

For example, if we want to append data to our previous DVD+RW, we have to use the following:

# growisofs -M /dev/cd0 -J -R /path/to/nextdata

The same mkisofs(8) options we used to burn the initial session should be used during next writes.

注: You may want to use the -dvd-compat option if you want better media compatibility with DVD-ROM drives. In the DVD+RW case, this will not prevent you from adding data.

If for any reason you really want to blank the media, do the following:

# growisofs -Z /dev/cd0=/dev/zero

16.7.6. Using a DVD-RW

A DVD-RW accepts two disc formats: the incremental sequential one and the restricted overwrite. By default DVD-RW discs are in sequential format.

A virgin DVD-RW can be directly written without the need of a formatting operation, however a non-virgin DVD-RW in sequential format needs to be blanked before to be able to write a new initial session.

To blank a DVD-RW in sequential mode, run:

# dvd+rw-format -blank=full /dev/cd0

注: A full blanking (-blank=full) will take about one hour on a 1x media. A fast blanking can be performed using the -blank option if the DVD-RW will be recorded in Disk-At-Once (DAO) mode. To burn the DVD-RW in DAO mode, use the command:

# growisofs -use-the-force-luke=dao -Z /dev/cd0=imagefile.iso

The -use-the-force-luke=dao option should not be required since growisofs(1) attempts to detect minimally (fast blanked) media and engage DAO write.

In fact one should use restricted overwrite mode with any DVD-RW, this format is more flexible than the default incremental sequential one.

To write data on a sequential DVD-RW, use the same instructions as for the other DVD formats:

# growisofs -Z /dev/cd0 -J -R /path/to/data

If you want to append some data to your previous recording, you will have to use the growisofs(1) -M option. However, if you perform data addition on a DVD-RW in incremental sequential mode, a new session will be created on the disc and the result will be a multi-session disc.

A DVD-RW in restricted overwrite format does not need to be blanked before a new initial session, you just have to overwrite the disc with the -Z option, this is similar to the DVD+RW case. It is also possible to grow an existing ISO 9660 file system written on the disc in a same way as for a DVD+RW with the -M option. The result will be a one-session DVD.

To put a DVD-RW in the restricted overwrite format, the following command must be used:

# dvd+rw-format /dev/cd0

To change back to the sequential format use:

# dvd+rw-format -blank=full /dev/cd0

16.7.7. Multisession

Very few DVD-ROM drives support multisession DVDs, they will most of time, hopefully, only read the first session. DVD+R, DVD-R and DVD-RW in sequential format can accept multiple sessions, the notion of multiple sessions does not exist for the DVD+RW and the DVD-RW restricted overwrite formats.

Using the following command after an initial (non-closed) session on a DVD+R, DVD-R, or DVD-RW in sequential format, will add a new session to the disc:

# growisofs -M /dev/cd0 -J -R /path/to/nextdata

Using this command line with a DVD+RW or a DVD-RW in restricted overwrite mode, will append data in merging the new session to the existing one. The result will be a single-session disc. This is the way used to add data after an initial write on these medias.

注: Some space on the media is used between each session for end and start of sessions. Therefore, one should add sessions with large amount of data to optimize media space. The number of sessions is limited to 154 for a DVD+R, about 2000 for a DVD-R, and 127 for a DVD+R Double Layer.

16.7.8. For More Information

To obtain more information about a DVD, the dvd+rw-mediainfo /dev/cd0 command can be ran with the disc in the drive.

More information about the dvd+rw-tools can be found in the growisofs(1) manual page, on the dvd+rw-tools web site and in the cdwrite mailing list archives.

注: The dvd+rw-mediainfo output of the resulting recording or the media with issues is mandatory for any problem report. Without this output, it will be quite impossible to help you.

Michael's Blog :: Just Do IT -- manuals