Automatically mount /dev/sda1 at /mnt/ntfs_drives
Add an /etc/fstab entry so Ubuntu mounts the partition during startup. Use its UUID rather than /dev/sda1, because device names can change between boots. The nofail option helps the system continue booting if the drive is disconnected.
Make sure to install ntfs support first:
sudo apt install ntfs-3g1. Find the partition UUID and other details
Get required details:
- the UUID of the disk:
sudo blkid /dev/sda1
- user
id -u
- groupd
id -g
Copy the value after UUID=. Also note the filesystem type shown, such as ntfs.
2. Create the mount point
sudo mkdir -p /mnt/ntfs_drives
3. Umount the partition (if required)
sudo umount /dev/sda1
4. back up the fstab file
sudo cp /etc/fstab /etc/fstab.bak
5. Add an /etc/fstab entry (at EOF)
/dev/disk/by-uuid/376B271F13EAED1A /mnt/ntfs_drive ntfs3 defaults,nofail,uid=1000,gid=1000,umask=022 0 0
/dev/disk/by-uuid/376B271F13EAED1A /mnt/ntfs_drive ntfs3 defaults,nofail,uid=1000,gid=1000,umask=022 0 06. Test before restarting
sudo systemctl daemon-reload
sudo mount -a
then see if you find it:
findmnt /mnt/ntfs_drives
If mount -a reports an error, correct or remove the new fstab line before rebooting.
