Fire up a terminal.
- [IMPORTANT]
sudo cp /etc/fstab /etc/fstab.old
- Create a backup of the fstab file just in case something unwanted happens. sudo blkid
- Note the UUID of the partition you want to automount.sudo nano /etc/fstab
- Copy the following line to the end of the file, save it and reboot afterwards to check if it worked.mkdir /my/path/tomount
# to quote : "you must create the mount point before you mount the partition." see https://help.ubuntu.com/community/Fstab
A common setup is:
UUID=<uuid> <pathtomount> <filesystem> defaults 0 0
Use lsblk -o NAME,FSTYPE,UUID
to find out the UUIDs and filesystems of the partition you want to mount. For example:
$ lsblk -o NAME,FSTYPE,UUID
NAME FSTYPE UUID
sda
├─sda2
├─sda5 swap 498d24e5-7755-422f-be45-1b78d50b44e8
└─sda1 ext4 d4873b63-0956-42a7-9dcf-bd64e495a9ff
UUID=<uuid> <pathtomount> ntfs uid=<userid>,gid=<groupid>,umask=0022,sync,auto,rw 0 0
Examples for the <>
variables:
<uuid>
=3087106951D2FA7E
<pathtomount>
=/home/data/
# create this before rebooting<userid>
=1000
<groupid>
=1000
Use id -u <username>
to get the userid and id -g <username>
to get the groupid.
(Note that specifying the sync
option can slow down write performance as it disables the cache. async is the default.)
UUID=EEA2B69CA2B668AB /WIN_C ntfs-3g defaults,nls=utf8,umask=000,dmask=027,fmask=137,uid=1000,gid=1000,windows_names 0 0