Skip Navigation Links | |
Exit Print View | |
System Administration Guide: Devices and File Systems Oracle Solaris 10 1/13 Information Library |
1. Managing Removable Media (Overview/Tasks)
2. Writing CDs and DVDs (Tasks)
Working With Audio CDs and Data CDs and DVDs
CD/DVD Media Commonly Used Terms
Writing CD and DVD Data and Audio CDs
Restricting User Access to Removable Media With RBAC
How to Restrict User Access to Removable Media With RBAC
How to Identify a CD or DVD Writer
How to Check the CD or DVD Media
How to Create an ISO 9660 File System for a Data CD or DVD
How to Create a Multi-Session Data CD
4. Dynamically Configuring Devices (Tasks)
5. Managing USB Devices (Tasks)
6. Using InfiniBand Devices (Overview/Tasks)
9. Administering Disks (Tasks)
10. SPARC: Setting Up Disks (Tasks)
11. x86: Setting Up Disks (Tasks)
12. Configuring Oracle Solaris iSCSI Targets (Tasks)
13. The format Utility (Reference)
14. Managing File Systems (Overview)
15. Creating and Mounting File Systems (Tasks)
16. Configuring Additional Swap Space (Tasks)
17. Checking UFS File System Consistency (Tasks)
18. UFS File System (Reference)
19. Backing Up and Restoring UFS File Systems (Overview/Tasks)
20. Using UFS Snapshots (Tasks)
21. Copying Files and File Systems (Tasks)
22. Managing Tape Drives (Tasks)
The following procedures are described in this section:
The process of writing to a CD or DVD cannot be interrupted and needs a constant stream of data. Consider using the cdrw -S option to simulate writing to the media to verify that the system can provide data at a sufficient rate for writing to the CD or DVD.
Write errors can be caused by one of the following problems:
The media cannot handle the drive speed. For example, some media are only certified for 2x or 4x speeds.
The system is running too many heavy processes that are starving the writing process.
The image is on a remote system, and network congestion is causing delays in reading the image.
The source drive is slower than the destination drive.
If any of these problems occur, you can lower the writing speed of the device by using the cdrw -p option.
For example, the following command shows how to simulate writing at 4x speed:
$ cdrw -iS -p 4 image.iso
Note - CD-R, CD-RW (not MRW formatted), DVD-R, and DVD-RW media support simulation mode (-S), but DVD-RAM, DVD+R, DVD+RW, and any MRW-formatted media and some others do not support simulation mode. The following message is displayed if simulation mode is not supported:
Media does not support simulated writing
For more information about media types, see CD/DVD Media Commonly Used Terms.
For more information, see cdrw(1).
By default, all users can access removable media. However, you can restrict user access to removable media by setting up a role through role-based access control (RBAC). Access to removable media is restricted by assigning the role to a limited set of users.
For a discussion of using roles, see Role-Based Access Control (Overview) in System Administration Guide: Security Services.
For more information, see Chapter 9, Using Role-Based Access Control (Tasks), in System Administration Guide: Security Services.
# roleadd -m -d /export/home/muser -c "mediauser role" -A solaris.device.cdrw -P All muser
# usermod -R muser joe
AUTHS_GRANTED=solaris.device.cdrw
If you do not do this step, all users still have access to the cdrw command, not just the members of the device management role.
After this file is modified, the device management role members are the only users who can use the cdrw command. Everyone else is denied access with the following message:
Authorization failed, Cannot access disks.
For example:
$ cdrw -l Looking for CD devices... Node | Connected Device | Device type ----------------------+--------------------------------+----------------- cdrom0 | YAMAHA CRW8824S 1.0d | CD Reader/Writer
For example:
$ cdrw -a filename.wav -d cdrom2
For example:
$ cdrw -M Device : YAMAHA CRW8824S Firmware : Rev. 1.00 (26/04/00) Media is blank %
The cdrw command works with or without removable media services running. For more information about disabling or enabling removable media services, see How to Disable or Enable Removable Media Services.
The CD or DVD can be any CD or DVD that the drive can read.
$ cdrw -l Looking for CD devices... Node Connected Device Device type ----------------------+--------------------------------+----------------- cdrom1 | YAMAHA CRW8824S 1.0d | CD Reader/Writer
Add the drive without rebooting the system.
# devfsadm
Then restart removable media services.
Prepare the data first by using the mkisofs command to convert the file and file information into the High Sierra format used on CDs or DVDs.
$ mkisofs -r /pathname > cd-file-system
Creates Rock Ridge information and resets file ownerships to zero.
Identifies the path name used to create the ISO 9660 file system.
Identifies the name of the file system to be put on the CD or DVD.
$ cdrw -i cd-file-system
The -i cd-file-system specifies the image file for creating a data CD or DVD.
Example 2-1 Creating an ISO 9660 File System for a Data CD or DVD
The following example shows how to create an ISO 9660 file system for a data CD or DVD.
$ mkisofs -r /home/dubs/dir > dubs_cd Total extents actually written = 56 Total translation table size: 0 Total rockridge attributes bytes: 329 Total directory bytes: 0 Path table size(bytes): 10 Max brk space used 8000 56 extents written (0 Mb)
Then, copy the file system onto the CD.
$ cdrw -i dubs_cd Initializing device...done. Writing track 1...done. Finalizing (Can take several minutes)...done.
This procedure describes how to put more than one session on a CD. This procedure includes an example of copying the infoA and infoB directories onto the CD.
$ mkisofs -o infoA -r -V my_infoA /data/infoA Total translation table size: 0 Total rockridge attributes bytes: 24507 Total directory bytes: 34816 Path table size(bytes): 98 Max brk space used 2e000 8929 extents written (17 Mb)
Identifies the name of the ISO file system.
Creates Rock Ridge information and resets file ownerships to zero.
Identifies a volume label to be used as the mount point by removable media services.
Identifies the ISO image directory to create.
$ cdrw -iO infoA Initializing device...done. Writing track 1...done. done. Finalizing (Can take several minutes)...done.
Identifies the name of the image file to write to the CD.
Keeps the CD open for writing.
$ eject -n . . . cdrom0 -> /vol/dev/rdsk/c2t4d0/my_infoA
Note the /vol/dev/... path name.
% cdrw -M /cdrom Device : YAMAHA CRW8424S Firmware : Rev. 1.0d (06/10/99) Track No. |Type |Start address ----------+--------+------------- 1 |Audio |0 2 |Audio |33057 3 |Data |60887 4 |Data |68087 5 |Data |75287 Leadout |Data |84218 Last session start address: 75287 Next writable address: 91118
Note the address in the Next writable address output so that you can provide this address when you write the next session.
$ mkisofs -o infoB -r -C 0,91118 -M /vol/dev/rdsk/c2t4d0/my_infoA /data/infoB Total translation table size: 0 Total rockridge attributes bytes: 16602 Total directory bytes: 22528 Path table size(bytes): 86 Max brk space used 20000 97196 extents written (189 Mb)
Identifies the name of the ISO file system.
Creates Rock Ridge information and resets file ownerships to zero.
Identifies the starting address of the first session and the next writable address.
Specifies the path of the existing ISO image to be merged.
Identifies the ISO image directory to create.
You can use the cdrw command to create audio CDs from individual audio tracks or from .au and .wav files.
The supported audio formats are described in the following table.
|
If no audio format is specified, the cdrw command tries to determine the audio file format based on the file extension. The case of the characters in the extension is ignored.
This procedure describes how to copy audio files onto a CD.
$ cd /myaudiodir
$ cdrw -a track1.wav track2.wav track3.wav
The -a option creates an audio CD.
Example 2-2 Creating an Audio CD
The following example shows how to create an audio CD.
$ cdrw -a bark.wav chirp.au meow.wav Initializing device...done. Writing track 1...done. done. Writing track 2...done. Writing track 3...done. done. Finalizing (Can take several minutes)...done.
The following example shows how to create a multi-session audio CD. The CD is ejected after the first session is written. You would need to reinsert the CD before the next writing session.
$ cdrw -aO groucho.wav chico.au harpo.wav Initializing device...done. Writing track 1...done. done. Writing track 2...done. Writing track 3...done. done. Finalizing (Can take several minutes)...done. <Re-insert CD> $ cdrw -a zeppo.au Initializing device...done. Writing track 1...done. done. Finalizing (Can take several minutes)...done.
Use the following procedure to extract an audio track from a CD and copy the audio track to a new CD.
If you don't use the cdrw -T option to specify the audio file type, the cdrw command uses the filename extension to determine the audio file type. For example, the cdrw command detects that this file is a .wav file.
$ cdrw -x 1 testme.wav
$ cdrw -x -T audio-type 1 audio-file
Extracts audio data from an audio CD.
Identifies the type of audio file to be extracted. Supported audio types are sun, wav, cda, or aur.
Identifies the audio track to be extracted.
$ cdrw -a audio-file
Example 2-3 Extracting and Creating Audio CDs
The following example shows how to extract the first track from an audio CD and name the file song1.wav.
$ cdrw -x -T wav 1 song1.wav Extracting audio from track 1...done.
This example shows how to copy a track to an audio CD.
$ cdrw -a song1.wav Initializing device...done. Writing track 1...done. Finalizing (Can take several minutes)...done.
This procedure describes how to extract all the tracks from an audio CD into a directory and then copy all of them onto a blank CD.
Note - By default, the cdrw command copies the CD into the /tmp directory. The copying might require up to 700 MB of free space. If there is insufficient space in the /tmp directory for copying the CD, use the -m option to specify an alternate directory.
$ mkdir /music_dir
$ cdrw -c -m music_dir
An Extracting audio ... message is display for each track.
The CD is ejected when all the tracks are extracted.
After the tracks are extracted, the audio CD is ejected. You are prompted to insert a blank CD.
Example 2-4 Copying a CD
This example shows how to copy one CD to another CD. You must have two CD-RW devices to do this task.
$ cdrw -c -s cdrom0 -d cdrom1
You have to erase existing CD-RW data before the CD can be rewritten.
Erase the last session only.
$ cdrw -d cdrom0 -b session
Erasing just the last session with the -b session option is faster than erasing the entire media with the -b all option. You can use the -b session option even if you used the cdrw command to create a data or audio CD in just one session.
Erase the entire media.
$ cdrw -d cdrom0 -b all