当前位置: 首页 > 图文教程 > 操作系统 > Unix/Linux > 对光驱和软驱实现Automount

Unix/Linux
linux下一个网卡配置多个IP
linux下如何查看邮件
linux系统中如何查看日志
Linux操作系统主机名(hostname)简介
在UNIX或Linux中TTY是什么意思
SSH使用指南
SSH客户端之SSH Secure Shell 的连接方法
linux 如何查看开关机记录
kill命令的使用
Linux用户进程是如何释放内存的
Linux命令free的输出含义
PHP 4.4.1forlinux下载
Apache 2.0.55 for Linux 下载
PHPMyAdmin 2.7.0-pl1下载
linux怎么添加用户
在Linux中添加普通新用户
linux查看所有用户
linux下的用户权限
linux下查看端口命令 端口
LINUX的端口和服务

Unix/Linux 中的 对光驱和软驱实现Automount


出处:互联网   整理: 软晨网(RuanChen.com)   发布: 2009-11-01   浏览: 77 ::
收藏到网摘: n/a

  软件环境:Redhat Linux 6.0
目    的:在使用Linux的过程中,我们经常需要使用光盘和软盘,每次使用时
          都要mount,用完还要umount非常麻烦,可以使这些工作变得自动化。
实现方法:
 
 1. 安装完Redhat Linux 6.0之后,运行ntsysv,选中服务后台程序autofs.
    autofs的两个配置文件在/etc/auto.misc 和 /etc/auto.master

 2. /etc/auto.master定义了mount目录和mount所需的配置文件名及其空闲时
    自动umount的时间。 下面是默认配置。

[jephe@sh3 /etc]$ more auto.master
/misc   /etc/auto.misc  --timeout 60   

 3. 下面是我的/etc/auto.misc配置文件:
[jephe@sh3 /etc]$ more auto.misc
cdrom           -fstype=iso9660,ro      :/dev/cdrom
floppy          -fstype=vfat            :/dev/fd0
e2floppy        -fstype=ext2            :/dev/fd0

注:a.确保/dev/cdrom作为符号链接指向你的光驱所在的分区,作为我的情况:
[jephe@sh3 /dev]$ ls cdrom -l
lrwxrwxrwx   1 root     root            3 Aug 26 08:44 cdrom -> hdd    
    b.当软盘为windows 95格化化的vfat分区类型时,设定了安装目录/misc/floppy
    c.当软盘为Linux格式化过的ext2分区类型时,设定了安装目录/misc/e2floppy

 4. 至此,若还未启动autofs,则运行/etc/rc.d/init.d/autofs start, 若对上述
两个文件中做过任何更改,运行/etc/rc.d/init.d/autofs restart即可。

 5. 放入一片光盘进入光驱后,不需任何动作,直接进入目录/misc/cdrom,autofs
将自动先为你mount光驱同样,若放入一张vfat格式的软盘,你可以cd /misc/floppy,
若是ext2格式的软盘,则cd /misc/e2floppy. 在超过一分钟未使用它们,且当前目录
不是自动mount目录/misc/cdrom,/misc/floppy,/misc/e2floppy,系统将自动umount
它们。

Jephe