Mount is used to mount the file system. It can be mounted at startup or after startup. You can use the mount command to mount a device after startup. To enable automatic mounting of a device at startup, you must enable the autofs service to provide this function. This function is like the automatic opening function of the optical drive in windows, which allows you to mount a file system that is dynamically loaded in a timely manner. This frees us from the trouble of manual hanging. Configuration is required for dynamic and automatic mounting of optical drives and floppy disks. The configuration method is as follows:
1. Modify/etc/auto. Master and set the mount point.
Format: mount the cluster point configuration file
Specific settings:/Mnt/etc/auto. Misc
Note: mount the configuration items in/etc/auto. Misc to/MNT.
2. Configuration File Settings
Format:
Mount parameter file system location relative to mount point
Specific settings:
CDROM-fstype = iso9660, iocharset = cp936, RO:/dev/CDROM
Note: The result of the above settings is to mount the/dev/CDROM device to/mnt/CDROM.
3. Start the autofs service
After completing the preceding settings, you must configure the autofs service.
# Chkconfig autofs on
# Service autofs start
Alternatively, we can use the ntsysv command to select the autofs service in the boot startup list. After the computer is restarted, The AutoFS will be started as the boot service.
4. Access the File System
# Cd/mnt/CDROM
5. Detach a File System
# Umount/mnt/CDROM
OK. After the above steps, we can automatically mount the optical drive and use the content of the optical drive.