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

Unix/Linux
linux路由器建立心得
毕业后我给学计算机的和喜欢计算机的同学的[转自猫扑]
转帖]女人管住男人的四?方法
试用apt-spy
安装iptraf 失败
Linux软件安装之RPM的安装技巧(转)
JDBC环境的搭建
英特尔对 Linux 重点的投入到底有多大?
内核编译定制说明(部分)
Wiki不完全手册
CVS由来与发展
first blog
脚本欣赏----Shell Script to Clone Linux System - 20041201
选择设置好ext3日志模式
passwd/group文件权限问题如何解决???
使linux使用起来更有趣
Linux字体安装与简单美化(实践篇)
巧用winbind服务来使window200xPDC为你做认证 (原作者:eagerlinuxer )
AT&T x86 asm 语法! for linux kernel
debian 精彩软件

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


出处:互联网   整理: 软晨网(RuanChen.com)   发布: 2009-11-01   浏览: 179 ::
收藏到网摘: 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