第一种方法:
进入rc.local
[root@localhost ~]# vim /etc/rc.local
在末尾里写上mount /dev/sr0 /mnt
#!/bin/bash
# THIS FILE IS ADDED FOR COMPATIBILITY PURPOSES
#
# It is highly advisable to create own systemd services or udev rules
# to run scripts during boot instead of using this file.
#
# In contrast to previous versions due to parallel execution during boot
# this script will NOT be run after all other services.
#
# Please note that you must run 'chmod +x /etc/rc.d/rc.local' to ensure
# that this script will be executed during boot.
touch /var/lock/subsys/local
mount /dev/sr0 /mnt
~
~
~
第二种方法:
进入fstab
[root@localhost ~]# vim /etc/fstab
在末尾写上/dev/sr0 /mnt iso9660 defaults,_netdev 0 0
[root@localhost ~]# cat /etc/fstab
#
# /etc/fstab
# Created by anaconda on Wed Mar 15 12:59:52 2023
#
# 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.
#
# After editing this file, run 'systemctl daemon-reload' to update systemd
# units generated from this file.
#
/dev/mapper/rhel-root / xfs defaults 0 0
UUID=bdff0fdd-faa6-49e3-9e1b-cd2cf21a5a48 /boot xfs defaults 0 0
/dev/mapper/rhel-swap none swap defaults 0 0
/dev/sr0 /mnt iso9660 defaults,_netdev 0 0