linux7.2光盘自动挂载
配置文件
[root@localhost ~]# echo "/dev/sr0 /media iso 9660 defaults 0 0" >> /etc/fstab
[root@localhost ~]# cat /etc/fstab
#
# /etc/fstab
# Created by anaconda on Sun Jun 4 23:45:20 2017
#
# Accessible filesystems, by reference, are maintained under '/dev/disk'
# See man pages fstab(5), findfs(8), mount(8) and/or blkid(8) for more info
#
/dev/mapper/rhel-root / xfs defaults 0 0
UUID=6a149710-3c1c-4301-a5f1-e4b90f617fd0 /boot xfs defaults 0 0
/dev/mapper/rhel-swap swap swap defaults 0 0
验证挂载是否成功
[root@localhost yum.repos.d]# mount -a
[root@localhost yum.repos.d]# df -h
文件系统 容量 已用 可用 已用% 挂载点
/dev/mapper/rhel-root 10G 3.2G 6.9G 32% /
devtmpfs 902M 0 902M 0% /dev
tmpfs 917M 144K 917M 1% /dev/shm
tmpfs 917M 9.0M 908M 1% /run
tmpfs 917M 0 917M 0% /sys/fs/cgroup
/dev/sda1 197M 143M 55M 73% /boot
tmpfs 184M 8.0K 184M 1% /run/user/0
/dev/sr0 3.8G 3.8G 0 100% /run/media/root/RHEL-7.2 Server.x86_64
[root@localhost yum.repos.d]#