改动/etc/fstab文件,如果挂载到/data文件夹。在最后一行加上
/dev/sdb1 /data ext4 defaults 1 1
最后结果例如以下:
# # /etc/fstab # Created by anaconda on Thu Sep 11 04:12:21 2014 # # 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/centos-root / xfs defaults 1 1 UUID=bf755645-8a3b-4222-9278-7747b8e89ce4 /boot xfs defaults 1 2 /dev/mapper/centos-swap swap swap defaults 0 0 /dev/sdb1 /data ext4 defaults 1 1
重新启动就能够自己主动挂载了