技术&日志

开机自动挂载磁盘

Ubuntu开机自动挂载磁盘 开机挂载 开机mount

  1. sudo blkid #查看分区UUID
  2. vi /etc/fstab 将分区UUID写入配置文件
# fastab 示例文件
# /etc/fstab: static file system information.
#
# Use 'blkid' to print the universally unique identifier for a
# device; this may be used with UUID= as a more robust way to name devices
# that works even if disks are added and removed. See fstab(5).
#
# <file system> <mount point>   <type>  <options>       <dump>  <pass>
# / was on /dev/sda2 during installation
UUID=7dd56b47-17c0-452d-be38-72b08e12b9c2 /               ext4    errors=remount-ro 0       1
# /boot/efi was on /dev/sda1 during installation
UUID=0F16-F098  /boot/efi       vfat    umask=0077      0       1
/swapfile                                 none            swap    sw              0       0

# 自动挂载挂载磁盘
UUID=b172dde3-f325-4940-8126-8f81afd94d87 /home/data1 ext4 defaults 0 0
UUID=95a8f11b-e426-4d25-b0c0-6657fe86aeb5 /home/data2 ext4 defaults 0 0
  1. sudo mount -a # 验证配置文件是否正确 无输出说明没有问题 否则可能无法开机

相关资料

开机自动挂载硬盘

发表评论