# Ubuntu 开机自动挂载硬盘 **Published by:** [Tinychenlin](https://paragraph.com/@cryptometaman/) **Published on:** 2021-12-22 **URL:** https://paragraph.com/@cryptometaman/ubuntu ## Content 查看系统分区 $ sudo fdisk -l创建挂载目录 $ mkdir /home/user/data 查询硬盘UUID $ sudo blkid /dev/sda2 /dev/sda2: LABEL="Data" UUID="88069947069936E2" TYPE="ntfs" PARTLABEL="Basic data partition" PARTUUID="7170f9a7-9c9f-43d8-9916-da47aa9101f7" 修改配置文件 $ sudo gvim /etc/fstab 末尾添加: UUID=88069947069936E2 /home/user/data ntfs defaults 0 2 $ sudo reboot 第一个数字:0表示开机不检查磁盘,1表示开机检查磁盘; 第二个数字:0表示交换分区,1代表启动分区(Linux),2表示普通分区 我挂载的分区是在WIn系统下创建的分区,磁盘格式为ntfs ## Publication Information - [Tinychenlin](https://paragraph.com/@cryptometaman/): Publication homepage - [All Posts](https://paragraph.com/@cryptometaman/): More posts from this publication - [RSS Feed](https://api.paragraph.com/blogs/rss/@cryptometaman): Subscribe to updates