开机会加载文件中的命令信息 --/etc/rc.local [root@oldboy-xiadao ~]# echo "mount /dev/sdb1 /mnt" >>/etc/rc.local [root@oldboy-xiadao ~]# cat /etc/rc.local mount /dev/sdb1 /mnt centos7的开机加载文件需要添加权限才能生效 [root@xiaoyong ~]# ls -l /etc/rc.d/rc.local -rw-r--r--. 1 root root 473 Apr 11 2018 /etc/rc.d/rc.local [root@xiaoyong ~]# chmod a+x /etc/rc.d/rc.local [root@xiaoyong ~]# ls -l /etc/rc.d/rc.local -rwxr-xr-x. 1 root root 473 Apr 11 2018 /etc/rc.d/rc.local 重启即刻生效