OD(4)

NAME
od - SCSI optical disk driver

SYNOPSIS
device od
device od1 at scbus0 target 3 lun 0

To use a drive which returns bogus ASC/ASCQ values:
options OD_BOGUS_NOT_READY

To enable an automatic spindown:
options OD_AUTO_TURNOFF

DESCRIPTION
The od driver provides support for a SCSI optical disk (AKA. Magneto-Optical or Phase change optical Disk) drive. It enables the media change operation and the disk to be divided up into a set of pseudo devices called partitions. A partition has both a raw interface and a block mode interface. In general the interfaces are similar to those described by wd(4) and sd(4).

As the SCSI adapter is probed during boot, the SCSI bus is scanned for devices. Any devices found which answered as ‘Optical’ and ‘removable’ type device will be attached to the od driver. In FreeBSD 2.1.5 or later, the first device found will be attached as od0 and the next, od1, and so on. It is possible to specify which od unit a device should come on line as; refer to scsi(4) for details on kernel configuration. Beginning in FreeBSD 2.2 the od driver can handle any device which answers as being type ‘Direct’ and ‘removable’ as well as ‘Optical’ and ‘removable’ type devices.

PARTITIONING
The od driver allows the disk to have two levels of partitioning. One layer, called the “slice layer”, is used to separate the FreeBSD areas of the disk from areas used by other operating systems. The second layer is the native 4.4BSD partitioning scheme, disklabel(5), which is used to subdivide the FreeBSD slices into areas for individual filesystems. For more information, see fdisk(8) and disklabel(8), respectively.

If an uninitialized disk is opened, the slice table will be initialized with a fictitious FreeBSD slice spanning the entire disk. Similarly, if an uninitialized (or non-FreeBSD) slice is opened, its disklabel will be initialized with parameters returned by the drive and a single ‘c’ partition encompassing the entire slice.

KERNEL CONFIGURATION
Only one od device is necessary in the config file; data structures are dynamically allocated as disks are found on the SCSI bus.

IOCTLS
The following ioctl(2) calls apply to optical disks as well as to other disks. They are defined in the header file <sys/disklabel.h>.

DIOCSBAD
    Usually used to set up a bad-block mapping system on the disk. SCSI drives incorporate their own bad-block mapping so this is not implemented, however it MAY be implemented in the future as a 'kludged' interface to the SCSI bad-block mapping.

DIOCGDINFO
    Read the in-core copy of the disklabel for the drive from the kernel. This may be a fictitious disklabel if the drive has never been initialised, in which case it will contain information read from the SCSI inquiry commands, and should be the same as the information printed at boot.

DIOCSDINFO
    Give the driver a new disklabel to use. The driver will NOT try write the new disklabel to the disk.

DIOCWLABEL
    Enable or Disable the driver's software write protect of the disklabel on the disk.

DIOCWDINFO
    Give the driver a new disklabel to use. The driver WILL try write the new disklabel to the disk.

And the following ioctl(2) calls which apply to optical disks are defined in the header file <sys/cdio.h>.

CDIOCEJECT
    Eject the optical disk media.

CDIOCALLOW
    Tell the drive to allow manual ejection of the optical disk media.

CDIOCPREVENT
    Tell the drive to prevent manual ejection of the optical disk media.

In addition, the scsi(4) general ioctls may be used with the od driver, but only against the fourth (whole disk) partition.

NOTES
Currently the od driver accepts 512, 1024 and 2048 byte/sector media. Raw and block mode device access to non-512 byte/sector media would be allowed only on each sector size boundary start position and I/O size.

FILES
/dev/rodu
    raw mode SCSI optical disk unit u, accessed as an unpartitioned device
/dev/odusn
    block mode SCSI optical disk unit u, slice n, accessed as an unpartitioned device
/dev/rodusn
    raw mode SCSI optical disk unit u, slice accessed as an unpartitioned device
/dev/odup
    block mode SCSI optical disk unit u, first FreeBSD slice, partition p
/dev/rodup
    raw mode SCSI optical disk unit u, first FreeBSD slice, partition p
    /dev/odusnp block mode SCSI optical disk unit u, nth slice, partition p
    /dev/rodusnp raw mode SCSI optical disk unit u, nth slice, partition p
    /dev/rodu.ctl the control device unit u, as being used by scsi(8)

DIAGNOSTICS
None.

SEE ALSO
fdisk(1), scsi(4), sd(4), cd(4), disklabel(5), disklabel(8)

AUTHOR
Shunsuke Akiyama <akiyama@jp.FreeBSD.org>

HISTORY
The od driver first appeared in FreeBSD2.1.5.