通过misc便捷挂载光盘
CentOS6.9以下的版本默认开启了autofs服务,可使用misc
## CentOS7实现
#检测autofs
rpm -qa|grep autofs
#没安装的话需进行安装
yum install -y autofs
#开启服务
systemctl start autofs
#加入开机启动项
[264][root@daoke: mnt]# systemctl enable autofs
Created symlink from /etc/systemd/system/multi-user.target.wants/autofs.service to /usr/lib/systemd/system/autofs.service.
# 测试
[265][root@daoke: mnt]# cd /misc/
[266][root@daoke: misc]# ll
total 0
[267][root@daoke: misc]# cd cd
#光盘成功挂载
[268][root@daoke: cd]# ll
total 1550
-rw-r--r--. 1 root root 14 Dec 5 21:02 CentOS_BuildTag
drwxr-xr-x. 3 root root 2048 Dec 5 21:20 EFI
-rw-r--r--. 1 root root 215 Dec 10 2015 EULA
-rw-r--r--. 1 root root 18009 Dec 10 2015 GPL
drwxr-xr-x. 3 root root 2048 Dec 5 21:47 images
drwxr-xr-x. 2 root root 2048 Dec 5 21:20 isolinux
drwxr-xr-x. 2 root root 2048 Dec 5 21:20 LiveOS
drwxrwxr-x. 2 root root 1548288 Dec 5 20:59 Packages
drwxrwxr-x. 2 root root 4096 Dec 5 21:42 repodata
-rw-r--r--. 1 root root 1690 Dec 10 2015 RPM-GPG-KEY-CentOS-7
-rw-r--r--. 1 root root 1690 Dec 10 2015 RPM-GPG-KEY-CentOS-Testing-7
-r--r--r--. 1 root root 2883 Dec 5 21:52 TRANS.TBL
yum源配置文件添加如下仓库
[misc]
name=misc
baseurl=file:///misc/cd
gpgcheck=0
yum clean all
CentOS6实现
#思路大致相同.下面是关键命令
rpm -qa|grep autofs
yum install autofs -y
service autofs start
chkconfig autofs on
chkconfig --list | grep auto
#配置写入yum源
cat>>/etc/yum.repos/base.repo<<EOF
echo [misc]
name=misc
baseurl=file:///misc/cd
gpgcheck=0
EOF
rpm -qa|grep autofs
#没安装的话需进行安装
yum install -y autofs
#开启服务
systemctl start autofs
#加入开机启动项
[264][root@daoke: mnt]# systemctl enable autofs
Created symlink from /etc/systemd/system/multi-user.target.wants/autofs.service to /usr/lib/systemd/system/autofs.service.
# 测试
[265][root@daoke: mnt]# cd /misc/
[266][root@daoke: misc]# ll
total 0
[267][root@daoke: misc]# cd cd
#光盘成功挂载
[268][root@daoke: cd]# ll
total 1550
-rw-r--r--. 1 root root 14 Dec 5 21:02 CentOS_BuildTag
drwxr-xr-x. 3 root root 2048 Dec 5 21:20 EFI
-rw-r--r--. 1 root root 215 Dec 10 2015 EULA
-rw-r--r--. 1 root root 18009 Dec 10 2015 GPL
drwxr-xr-x. 3 root root 2048 Dec 5 21:47 images
drwxr-xr-x. 2 root root 2048 Dec 5 21:20 isolinux
drwxr-xr-x. 2 root root 2048 Dec 5 21:20 LiveOS
drwxrwxr-x. 2 root root 1548288 Dec 5 20:59 Packages
drwxrwxr-x. 2 root root 4096 Dec 5 21:42 repodata
-rw-r--r--. 1 root root 1690 Dec 10 2015 RPM-GPG-KEY-CentOS-7
-rw-r--r--. 1 root root 1690 Dec 10 2015 RPM-GPG-KEY-CentOS-Testing-7
-r--r--r--. 1 root root 2883 Dec 5 21:52 TRANS.TBL
yum源配置文件添加如下仓库
[misc]
name=misc
baseurl=file:///misc/cd
gpgcheck=0
yum clean all
CentOS6实现
#思路大致相同.下面是关键命令
rpm -qa|grep autofs
yum install autofs -y
service autofs start
chkconfig autofs on
chkconfig --list | grep auto
#配置写入yum源
cat>>/etc/yum.repos/base.repo<<EOF
echo [misc]
name=misc
baseurl=file:///misc/cd
gpgcheck=0
EOF
yum repolist 查看仓库名称列出的信息
yum install xxx 安装软件
yum clean all 清缓存
yum list xxx 查看软件在哪个仓库里