1cdrw(1) User Commands cdrw(1)
2
3
4
6 cdrw - CD read and write
7
9 cdrw -i [-vSCO] [-d device] [-p speed] [image-file]
10
11
12 cdrw -a [-vSCO] [-d device] [-p speed] [-T audio-type] audio-file1
13 [audio-file2]...
14
15
16 cdrw -x [-v] [-d device] [-T audio-type] track-number out-file
17
18
19 cdrw -c [-vSC] [-d device] [-p speed] [-m tmp-dir]
20 [-s src-device]
21
22
23 cdrw -b [-v] [-d device] all | session | fast
24
25
26 cdrw -L [-v] [-d device]
27
28
29 cdrw -M [-v] [-d device]
30
31
32 cdrw -l [-v]
33
34
35 cdrw -h
36
37
39 The cdrw command provides the ability to create data and audio CDs.
40 This command also provides the ability to extract audio tracks from an
41 audio CD and to create data DVDs. The CD or DVD device must be MMC-com‐
42 pliant to create a CD or DVD with the cdrw command.
43
44
45 cdrw searches for a CD or DVD writer connected to the system, unless
46 you specify a device with the -d option. If cdrw finds a single such
47 device, it uses that device as the default CD or DVD writer for the
48 command.
49
50
51 When more than one CD or DVD writer is connected to the system, use the
52 -d option to indicate which device is desired. The device name can be
53 specified in one of the following ways: /dev/rdsk/cNtNdNsN, cNtNdNsN,
54 cNtNdN, or a name used by volume manager, such as cdrom or cdrom1.
55 Using the -l option provides a list of CD or DVD writers.
56
57
58 For instructions on adding a USB-mass-storage-class-compliant CD-RW or
59 DVD-RW device to your system, see scsa2usb(7D).
60
61 Creating Data CDs
62 When creating data CDs, cdrw uses the Track-At-Once mode of writing.
63 Use the -i option to specify a file that contains the data to write on
64 CD media. If you don't specify this option, cdrw reads data from stan‐
65 dard input.
66
67
68 In either case, the data is typically prepared by using the mkisofs
69 command to convert the file and file information into the High Sierra
70 format used on CDs. See the examples that include use of this command.
71
72 Creating Data DVDs
73 cdrw can create single-session data DVDs on DVD+RW or DVD-RW devices
74 using images generated from mkisofs. These disks can be mounted as HSFS
75 file systems. When making data DVDs, cdrw uses Disk-At-Once (DAO) mode
76 of writing, which closes the media when writing is completed and pre‐
77 vents any further sessions from being added. The image should be pre‐
78 pared in advance when writing an image to the DVD media since DAO mode
79 requires that the size of the image be known in advance.
80
81 Creating Audio CDs
82 Use the -a option to create an audio CD. Single or multiple audio files
83 can be specified with this option. All of the audio files should be in
84 a supported audio format. Currently approved formats are:
85
86 sun Sun .au files with data in Red Book CDDA form
87
88
89 wav RIFF (.wav) files with data in Red Book CDDA form
90
91
92 cda .cda files having raw CD audio data (that is, 16 bit PCM stereo
93 at 44.1 KHz sample rate in little-endian byte order)
94
95
96 aur .aur files having raw CD data in big-endian byte order
97
98
99
100 If no audio format is specified, cdrw tries to identify the audio file
101 format based on the file extension. The case of the characters in the
102 extension is ignored. If a format is specified using the -T option, it
103 is assumed to be the audio file type for all the files specified. Also,
104 using the -c option closes the session after writing the audio tracks.
105 Therefore, the tracks to be written should be specified in a single
106 command line.
107
108 Extracting Audio
109 cdrw can also be used for extracting audio data from an audio CD with
110 the -x option. The CD should have tracks in Red Book CDDA form. By
111 default, the output format is based on the file extension. A user can
112 specify a sun, wav, cda, or aur output format with the -T option.
113
114 Copying CDs
115 cdrw can be used to copy single session data CD-ROMs and Red Book audio
116 CDs. When copying a CD, cdrw looks for a specified source device. If no
117 source device is specified when using the -c option, the current CD
118 writer is assumed to be the source. cdrw extracts the track or tracks
119 into a temporary file and looks for a blank writable CD-R/RW media in
120 the current CD writer. If no media is found, insert a blank writable CD
121 media in the current CD writer. If the default temporary directory does
122 not have enough space, an alternate directory can be specified by using
123 the -m option.
124
125 Erasing CD-RW or DVD-RW Media
126 Users have to erase the CD-RW media before it can be rewritten. With
127 the -b option, the following flavors of erasing are currently sup‐
128 ported:
129
130 session Erases the last session.
131
132
133 fast Minimally erases the media.
134
135
136 all Erases the entire media.
137
138
139
140 If the session erasing type is used, cdrw erases the last session. If
141 there is only one session recorded on the CD-RW (for example, a data or
142 audio CD-RW created by this tool), then session erasing only erases the
143 portion that is recorded, leaving behind a blank disk. This is faster
144 than erasing the entire media. For DVD media, using the -b session
145 erases the whole media.
146
147
148 The fast erasing type minimally erases the entire media by removing the
149 PMA and TOC of the first session. It does not erase the user data and
150 subsequent tracks on the media, but the media is treated as if it were
151 a blank disk. If a complete erase is of the media is necessary, use the
152 all option.
153
154
155 The all erasing type should be used if it is a multisession disk, the
156 last session is not closed, or disk status is unknown, and you want to
157 erase the disk. With this type of erasing, cdrw erases the entire disk.
158
159
160 DVD+RW media does not support erasing. To re-use DVD+RW media, simply
161 write a new image onto the media. cdrw formats and overwrites the
162 existing media automatically.
163
164 Checking device-list or media-status
165 You can list a system's CD or DVD writers by using the -l option. Also,
166 for a particular media, you can get the blanking status and table of
167 contents by using the -M option. The -M option also prints information
168 about the last session's start address and the next writable address.
169 This information, along with the -O option, can be used to create mul‐
170 tisession CDs. Refer to the mkisofs(8) man page,
171 (/usr/share/man/man8/mkisofs.8), in the SUNWfsman package for more
172 information.
173
175 The following options are supported:
176
177 -a Creates an audio disk. At least one audio-file name must be spec‐
178 ified. A CD can not have more than 99 audio tracks, so no more
179 than 99 audio files can be specified.
180
181
182 -b Blanks CD-RW or DVD-RW media. The type of erasing must be speci‐
183 fied by the all, fast, or session argument. DVD+RW media does not
184 support blanking, but can be rewritten without the need for
185 blanking.
186
187
188 -c Copies a CD. If no other argument is specified, the default CD
189 writing device is assumed to be the source device as well. In
190 this case, the copy operation reads the source media into a tem‐
191 porary directory and prompts you to place a blank media into the
192 drive for the copy operation to proceed.
193
194
195 -C This option is obsolete.
196
197 This option used to causecdrw to query the drive to determine
198 media capacity. This is now the default behavior.
199
200
201 -d Specifies the CD or DVD writing device.
202
203
204 -h Help. Prints usage message.
205
206
207 -i Specifies the image file for creating data CDs or DVDs. The file
208 size should be less than what can be written on the media. Also,
209 consider having the file locally available instead of having the
210 file on an NFS-mounted file system. The CD writing process
211 expects data to be available continuously without interruptions.
212
213
214 -l Lists all the CD or DVD writers available on the system.
215
216
217 -L Closes the disk. If the media was left in an open state after the
218 last write operation, it is closed to prevent any further writ‐
219 ing. This operation can only be done on re-writable CD-RW media.
220
221
222 -m Uses an alternate temporary directory instead of the default tem‐
223 porary directory for storing track data while copying a CD or
224 DVD. An alternate temporary directory might be required because
225 the amount of data on a CD can be huge. For example, the amount
226 of data can be as much as 800 Mbytes for an 80 minute audio CD
227 and 4.7 Gbytes for a DVD. The default temporary directory might
228 not have that much space available.
229
230
231 -M Reports media status. cdrw reports if the media is blank or not,
232 its table of contents, the last session's start address, and the
233 next writable address if the disk is open. DVD+RW does not sup‐
234 port erasing and always has some content on the media.
235
236
237 -O Keeps the disk open. cdrw closes the session, but it keeps the
238 disk open so that another session can be added later on to create
239 a multisession disk.
240
241
242 -p Sets the CD writing speed. For example, -p 4 sets the speed to
243 4X. If this option is not specified, cdrw uses the default speed
244 of the CD writer. If this option is specified, cdrw tries to set
245 the drive write speed to this value, but there is no guarantee of
246 the actual speed that is used by the drive.
247
248
249 -s Specifies the source device for copying a CD or DVD.
250
251
252 -S Simulation mode. In this mode, cdrw operates with the drive laser
253 turned off, so nothing is written to the media. Use this option
254 to verify if the system can provide data at a rate good enough
255 for CD writing.
256
257 CD-R, CD-RW (not MRW formatted), DVD-R, and DVD-RW media support
258 simulation mode (-S). DVD-RAM, DVD+R, DVD+RW, any MRW-formatted
259 media, and some others do not support simulation mode (-S).
260
261
262 -T Audio format to use for extracting audio files or for reading
263 audio files for audio CD creation. The audio-type can be sun,
264 wav, cda, or aur.
265
266
267 -v Verbose mode.
268
269
270 -x Extracts audio data from an audio track.
271
272
274 Example 1 Creating a Data CD or DVD
275
276 example% cdrw -i /local/iso_image
277
278
279
280 Example 2 Creating a CD or DVD from a Directory
281
282
283 This example shows how to create a CD or DVD from the directory tree
284 /home/foo.
285
286
287 example% mkisofs -r /home/foo 2>/dev/null | cdrw -i -p 1
288
289
290
291 Example 3 Extracting an Audio Track Number
292
293
294 This example shows how to extract audio track number 1 to
295 /home/foo/song1.wav.
296
297
298 example% cdrw -x -T wav 1 /home/foo/song1.wav
299
300
301
302 Example 4 Using wav Files
303
304
305 This example shows how to create an audio CD from wav files on disk.
306
307
308 example% cdrw -a song1.wav song2.wav song3.wav song4.wav
309
310
311
312 Example 5 Erasing CD-RW or DVD-RW Media
313
314
315 This example shows how to erase rewritable media.
316
317
318 example% cdrw -b all
319
320
321
322 Example 6 Creating a Data CD or DVD with Multiple Drives
323
324
325 This example shows how to create a data CD or DVD on a system with mul‐
326 tiple CD, DVD-R, or DVD-RW drives.
327
328
329 example% cdrw -d c1t6d0s2 -i /home/foo/iso-image
330
331
332
333 Example 7 Checking Data Delivery Rate
334
335
336 This example shows how to verify that the system can provide data to a
337 CD-RW or a DVD drive at a rate sufficient for the write operation.
338
339
340 example% cdrw -S -i /home/foo/iso-image
341
342
343
344 Example 8 Running at a Higher Priority
345
346
347 This example shows how to run cdrw at a higher priority (for root user
348 only).
349
350
351 example# priocntl -e -p 60 cdrw -i /home/foo/iso-image
352
353
354
355 Example 9 Creating a Multi-session Disk
356
357
358 This examples shows how to create the first session image by using
359 mkisofs and recording it onto the disk without closing the disk.
360
361
362 example% cdrw -O -i /home/foo/iso-image
363
364
365
366
367 Additional sessions can be added to an open disk by creating an image
368 with mkisofs using the session start and next writable address reported
369 by cdrw.
370
371
372 example% cdrw -M
373
374 Track No. |Type |Start address
375 ----------+--------+-------------
376 1 |Data | 0
377 Leadout |Data | 166564
378
379 Last session start address: 162140
380 Next writable address: 173464
381
382
383
384 example% mkisofs -o /tmp/image2 -r -C 0,173464 -M \
385 /dev/rdsk/c0t2d0s2 /home/foo
386
387
388
390 See attributes(5) for descriptions of the following attributes:
391
392
393
394
395 ┌─────────────────────────────┬─────────────────────────────┐
396 │ ATTRIBUTE TYPE │ ATTRIBUTE VALUE │
397 ├─────────────────────────────┼─────────────────────────────┤
398 │Availability │SUNWcdrw │
399 └─────────────────────────────┴─────────────────────────────┘
400
402 audioconvert(1), priocntl(1), policy.conf(4), attributes(5), rbac(5),
403 scsa2usb(7D), sd(7D)
404
405
406 mkisofs(8), (/usr/share/man/man8/mkisofs.8), in the SUNWfsman package
407
408
409 System Administration Guide: Devices and File Systems
410
412 The CD writing process requires data to be supplied at a constant rate
413 to the drive. Keep I/O activity to a minimum and shut down any related
414 I/O applications while writing CDs.
415
416
417 When making copies or extracting audio tracks, use an MMC compliant
418 source CD-ROM drive. The CD writer can be used for this purpose.
419
420
421 Before writing a CD, ensure that the media is blank by using the -M
422 option. You can use the -S simulation mode to test the system to make
423 sure it can provide data at the required rate. cdrw turns on buffer
424 underrun protection for drives that support it and recovers from most
425 stalls. If the system is not able to provide data at a constant rate or
426 frequent stalling occurs, you can lower the speed by using the -p
427 option. You can also try to run cdrw at a higher priority by using the
428 priocntl(1) command.
429
430
431 If you know that the CD-R/RW drive can operate at different write
432 speeds, use the -p option. Some commercially available drives handle
433 the drive speed setting command differently, so use this option judi‐
434 ciously.
435
436
437 The cdrw command uses rbac(5) to control user access to the devices. By
438 default, cdrw is accessible to all users but can be restricted to indi‐
439 vidual users. Refer to the System Administration Guide: Devices and
440 File Systems for more information.
441
442
443 To burn CDs as a non-root user hal must be enabled and the user must be
444 on the console. hal, that is the svc:/system/hal SMF service, is
445 enabled by default, therefore, typically this requires no special
446 action.
447
448
449 The user must be logged onto the console. /dev/console is also correct.
450 Previously, users could log in remotely, for example, by using telnet
451 or ssh, and be able to burn CDs. This would work unless the administra‐
452 tor had changed the default configuration to deny solaris.device.cdrw
453 authorization. See policy.conf(4).
454
455
456
457SunOS 5.11 10 Jul 2008 cdrw(1)