Documente Academic
Documente Profesional
Documente Cultură
Unix in general and Solaris in particular has the propensity to make simple tasks complex and mounting
CDROM is one of such cases. There are two main ways of mount CDROM on Solaris
• Using vold
daemon
• Direct mounting using mount
command
Using vold
The simplest way to mount CDROM on Solaris is use vold daemon. The vold daemon in Solaris manages
the CDROM device and automatically performs the mounting similar to how Windows manages CDROMs
(but not as transparent or reliable). If CD is detected in drive its should be automatically mounted to the
/cdrom/cdrom0 directory. If you are running File Manager, a separate File Manager window displays the
contents of the CDROM.
If the /cdrom/cdrom0 directory is empty because the CDROM was not mounted, or if File Manager did
not open a window displaying the contents of the CDROM the first step is to verify the vold daemon is
running using the command:
# pgrep vold
If vold is running, the system displays the process identification number of vold. If the system does not
display anything, restart the daemon by entering the following command:
# /usr/sbin/vold &
If the vold daemon is running but did not mount the CDROM, stop the vold daemon process and then
restart the daemon. To stop the vold process, you must know the process identification number. you can get
it by entering this command:
# pgrep vold
Restart the vold process by entering the following command:
/etc/init.d/volmgt stop
If approach based on vold does not work you do try to do it via direct mount command. The first step is to
determine the device which corresponds to the CDROM drive on you server or workstation.
CDROM on Solaris is usually linked to device /dev/sr0. You can determine the name of the device by
entering the following command:
This command returns the name(s) of the CDROM devices on the server. For example, the command can
return the string /dev/dsk/c0t6d0s2.
You can also get the device name in cxtydzsn format, associated with the CD drive:
% iostat -En
Here
• -E displays all device error statistics & -n shows the names in descriptive format. We are
interested in only the logical device name though.
• slice 0 is the default
After you determined the name of device for CDROM drive you can use mount command (if mounting
directory for example /cdrom does not exit you need to create it mkdir /cdrom; chmod a+rwx /cdrom ):
or
to mount it (I would like to stress it again that directory /cdrom should exist and have proper permissions
for operation to succeed).
After then you can check the results using df command, for example
If you want to simplify the mount process, you can add an entry to the /etc/vfstab file. Edit the
/etc/vfstab file and add the following entry:
If you have UFS CDROM you can specify multiple entries, one for each typr of the filesystem, for example:
share F nfs o ro /cdrom/cd1
Ensure your remote machine is enabled as an NFS server by entering the following command:
This indicates whether the following daemons are running: /usr/lib/nfs/nfsd and /usr/lib/nfs/mountd.
If these daemons are not running, you need to enable your machine as an NFS server by entering the
following command:
# /etc/init.d/nfs.server start
If your machine is enabled as an NFS server, enter one of the following commands:
# share
or
# shareall
Log on as superuser on target machine. Then create a /cdrom directory, if one does not already exist, by
entering the following command:
# mkdir -p /cdrom/cd1
Now you can mount the remote CDROM as NFS filesystem using command
You need to move out of the CDROM directory to successfully unmount it:
If CDROM is mounted via NFS from remote computer you need unmount it in two places.
The typical problem is that some process is still using the mounted filesystem. The fuser utility lists
processes using a file or files in a filesystem. To determine what processes may be preventing a filesystem's
amount, the c switch should be used:
fuser c /cdrom
This command will list the process ids of processes with open files in the filesystem mounted under /mnt.
The characters following the pid provide additional information about the file:
c the process is using the file as its current working directory
m the file is mapped with mmap
o the process is using it as an open file
r the file is the root directory of the process
t the process is accessing the file as a text file
y this file is the controlling terminal for the process
The fuser utility lists processes using a file or files in a filesystem. It's To determine what processes may be
preventing a filesystem's umount, the c switch must be used as running this command as root:
fuser c /mnt
/mnt: 19504tm 19492tm 19460tm
This command will list the process ids of processes with open files in the filesystem mounted under /mnt.
The characters following the pid provide additional information about the file:
c the process is using the file as its current working directory
m the file is mapped with mmap
o the process is using it as an open file
r the file is the root directory of the process
t the process is accessing the file as a text file
y this file is the controlling terminal for the process
A useful option for fuser is u which adds the username owning the process to the display:
fuser cu /mnt
/mnt: 19504tm(root) 19492tm(root) 19460tm(qmchenry)
If you feel comfortable killing the processes reported by fuser, you can do it in one quick blow with the k
option:
fuser ck /mnt
This sends the SIGKILL signal to each process which is the same as running kill pid to each process.
However, before you go to this extreme, perhaps the most common reason a filesystem won't unmount is
because you (or a previous shell you used) has its current working directory in that filesystem.