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

Unix/Linux
小型机cpu类型
bind9的安装
如何查看服务器上有多少个CPU
wu-ftp 设置匿名服务器(转载)
Solaris硬盘分区学习笔记(转载)
如何在solaris中添加删除磁盘和分区 (转载)
共享光驱怎么做?
改solaris 8的ip地址的问题
加路径的问题 ;(
超级终端如何发送STOP+A?
如何对某个端口限制IP访问 比如 针对1521端口 只允许某个IP访问
如何让root用户远程telnet?
/usr/lib/ld.so.1损坏或丢失
[分享]Sun X3151A 光纤网卡故障排除实例
[分享]Solaris 2.6+Ultra5内置扬声器故障诊断实例
在VMWARE上装Sun Cluster 3.1 Update 3(ZT )
Windows客户端使用UNIX打印服务器上共享打印机的方法
如何改网卡IP地址
[color=darkblue]CacheFS笔记[/color]
在SUN工作站上安装RTL8139网卡

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


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