Automatically mount at startup: Difference between revisions
From WickyWiki
mNo edit summary |
mNo edit summary |
||
| Line 3: | Line 3: | ||
[[Category:201604]] | [[Category:201604]] | ||
To find the correct UUID of your drive: | |||
<syntaxhighlight lang=bash> | |||
blkid | |||
</syntaxhighlight> | |||
Returns: | |||
<blockquote> | |||
<pre> | |||
... | |||
/dev/sda2: LABEL="Ubuntu" UUID="12312312312312312" TYPE="ext4" | |||
/dev/sda3: LABEL="Data" UUID="45645645645645645" TYPE="ntfs" | |||
... | |||
</pre> | |||
</blockquote> | |||
To get your user-id: | |||
<syntaxhighlight lang=bash> | |||
id -u $USERNAME | |||
</syntaxhighlight> | |||
Or: | |||
<syntaxhighlight lang=bash> | |||
echo $UID | |||
</syntaxhighlight> | |||
Now edit fstab: | |||
<syntaxhighlight lang=bash> | |||
sudo gedit /etc/fstab | |||
</syntaxhighlight> | |||
Add the following line: | |||
<blockquote> | |||
<pre> | |||
... | |||
UUID=45645645645645645 /media/Data auto defaults,uid=1000,nosuid,nodev,nofail,x-gvfs-show 0 0 | |||
... | |||
</pre> | |||
</blockquote> | |||
For more info on the possible options: | |||
* https://help.ubuntu.com/community/AutomaticallyMountPartitions | * https://help.ubuntu.com/community/AutomaticallyMountPartitions | ||
Revision as of 07:10, 14 May 2016
To find the correct UUID of your drive:
blkid
Returns:
... /dev/sda2: LABEL="Ubuntu" UUID="12312312312312312" TYPE="ext4" /dev/sda3: LABEL="Data" UUID="45645645645645645" TYPE="ntfs" ...
To get your user-id:
id -u $USERNAME
Or:
echo $UID
Now edit fstab:
sudo gedit /etc/fstab
Add the following line:
... UUID=45645645645645645 /media/Data auto defaults,uid=1000,nosuid,nodev,nofail,x-gvfs-show 0 0 ...
For more info on the possible options:
Edit fstab:
sudo gedit /etc/fstab
See also: