MEDIAD(1M) MEDIAD(1M) NAME mediad, cdromd, msdosd - handle removable media on the system SYNOPSIS mediad [ -o options ] [ -i ] -p device dir mediad [ -i ] -r device mediad -e [controller_id] scsi_id | device | dir mediad -m dir mediad -q device mediad -a mediad -k mediad -u mediad DESCRIPTION mediad is a daemon that monitors the removable media devices on a system. When media is inserted, mediad will mount it if it makes sense for that media type and there is a valid filesystem on it. When a user issues the eject command, eject sends mediad a message which causes it to attempt to unmount the media and eject it. mediad also works with Cadmin to update attributes on the Cadmin objectserver. mediad replaces msdosd and cdromd. Unlike msdosd and cdromd, a single mediad will monitor all removable media devices on the system. When mediad starts, it will first look in /etc/fsd.auto for devices to monitor, then it will query the Cadmin objectserver for additional devices. To specify a floppy drive, use the appropriate device special file in /dev/rdsk. You should use the devices with the hi suffix. To specify a CDROM drive, use the appropriate device special file in /dev/scsi. To specify a tape drive, use the appropriate device special file in /dev/rmt. You should specify a non-rewinding tape device, a device with the nr suffix. The options tell mediad what options to use when media is mounted. OPTIONS -a Start mediad (this is the default when no arguments are specified) -k Stop mediad -e [controller_id] scsi_id | device | dir Eject the media in the specified device. If controller id is left out, it will be defaulted to 0. Page 1 MEDIAD(1M) MEDIAD(1M) -o options Mount the device with the given options. Options should be separated by a comma only. There should be no spaces between the options. This information is entered into /etc/fsd.auto. See fsd.auto(4) for some examples. Possible options are: rw : mount filesystems read-write. This is the default. CDROMs are always mounted read-only. Floppies with the write-protect tab set are mounted read- only. ro : mount filesystems read only. mon=on|off : tells mediad to monitor or not monitor the device. A mon=off option in /etc/fsd.auto will tell mediad not to monitor the device even when mediad gets its list of removable media devices from the objectserver. inschk=num : specifies how often, in seconds, mediad checks for a media insertion on an empty device. The default is 3 seconds. rmvchk=num : specifies how often, in seconds, mediad checks for removal of media on a loaded device. The default is 45 seconds. For devices that support software eject, this interval can be made longer since mediad finds out about software ejects immediately and this is just to check against users using hardware eject. For devices that do not support software eject, for example, QIC tapes, this interval should be made shorter. -i Used with -p or -r only, this flag causes the change to take effect immediately. -p device dir Add an entry to /etc/fsd.auto for the specified special device name and mountpoint and turn the mon= option to on. This will cause mediad to monitor this device next time it reads the file. -r device Set the mon= option to off in /etc/fsd.auto. This will prevent mediad from monitoring this device next time it reads the file. -m device Print the mount point of the specified device on the standard output. -q device Find out if mediad is monitoring the specified device. The exit code (see below) gives status information. -u Tells mediad to eject the first removable media device it knows about. EXAMPLES To start mediad issue the command as root: Page 2 MEDIAD(1M) MEDIAD(1M) mediad To stop mediad issue the command as root: mediad -k To eject the floppy in the drive at /dev/rdsk/fds0d3.3.5hi (scsi id 3), issue the command as root: mediad -e /dev/rdsk/fds0d3.3.5hi To make mediad monitor the cdrom at /dev/scsi/sc0d4l0 (scsi id 4), and to have it mount any CD read-only and at /CDROM, and to have it start monitoring immediately, issue the command as root: mediad -o ro -ip /dev/scsi/sc0d4l0 /CDROM To tell mediad to never monitor the tape at /dev/rmt/tps0d5nr, issue the command as root: mediad -r /dev/rmt/tps0d5nr This will cause mediad to not monitor the tape next time it is started. This works even for systems running the objectserver since mediad reads extra options from /etc/fsd.auto after it has received a list of removable media devices from the objectserver. DIAGNOSTICS For the -q device option, the exit status is a bitmask detailing the status of the device: If bit 0 is set, an error occurred. If bit 1 is set, mediad is monitoring the device. If bit 2 is set, an /etc/fsd.auto entry exists for the device. Note that if the mon= option in /etc/fsd.auto is off, mediad will not monitor the device. For all other options, mediad exits with a status of 0 upon success, non-zero for failure. ERRORS Only one instance of mediad is allowed on the system. The filesystems monitored by mediad are implemented as user mode nfs daemons. In some cases errors detected by these daemons are reported as nfs errors. See filesystems(4). FILES /etc/fsd.tab table of devices mediad is currently monitoring /etc/fsd.auto table of removable media devices on the system /dev/rdsk/fd*hi device files to use to specify floppy drives Page 3 MEDIAD(1M) MEDIAD(1M) /dev/scsi/sc* device files to use to specify CD-ROM drives /dev/rmt/tps*nr device files to use to specify tape drives SEE ALSO to_unix(1), to_dos(1), ds(7M), mount(1M), smfd(7M), eject(1), Cadmin(1), objectserver(1), filesystems(4) Page 4