Trashcan support on NTFS volumes: Difference between revisions

From WickyWiki
mNo edit summary
mNo edit summary
Line 50: Line 50:
<pre>
<pre>
...
...
UUID=45645645645645645   /media/DATA   defaults,umask=077,fmask=177,uid=1000,gid=1000,noatime 0 0
UUID=45645645645645645 /media/DATA ntfs-3g  defaults,umask=077,fmask=177,uid=1000,gid=1000,noatime 0 0
...
...
</pre>
</pre>
Line 60: Line 60:
<pre>
<pre>
...
...
UUID=45645645645645645   /media/DATA   defaults,umask=077,fmask=177,uid=1000,gid=1000,noauto,noatime 0 0
UUID=45645645645645645 /media/DATA ntfs-3g  defaults,umask=077,fmask=177,uid=1000,gid=1000,noauto,noatime 0 0
...
...
</pre>
</pre>
Line 80: Line 80:
<syntaxhighlight lang=bash>
<syntaxhighlight lang=bash>
sudo mkdir /media/DATA
sudo mkdir /media/DATA
sudo mount /dev/sda3 /media/DATA -o defaults,noauto,uid=1000,locale=en_US.UTF-8
sudo mount /dev/sda3 /media/DATA -o defaults,umask=077,fmask=177,uid=1000,gid=1000,noatime
</syntaxhighlight>
</syntaxhighlight>


== The other settings explained ==
== Other settings explained ==
 
{| class="wikitable"
{| class="wikitable"
|-
|-
! Header text !! Header text
! Header text !! Header text
|-
| /media/DATA  || mount point
|-
| ntfs-3g || volume type
|-
|-
| uid=1000 || user-id 1000, check yours with 'id -u'
| uid=1000 || user-id 1000, check yours with 'id -u'
Line 99: Line 103:
| noatime || do not store accesstimes, advisable on SSD drives
| noatime || do not store accesstimes, advisable on SSD drives
|-
|-
| user,noauto || if you don't want automatic mounting
| user,noauto || if you want user-mounting, not automatic
|-
|-
| exec || user implies noexec, add this if you still want execute
| exec || user implies noexec, add this if you still want to execute things
|}
|}

Revision as of 10:20, 3 March 2018


To enable Trashcan support on an NTFS partition you need to associate a user-id with the partition.

Modify fstab

Associating a user-id with a partition can be done with an entry in the /etc/fstab file. You also need the drive's UUID, system's main user-id usually is 1000. The trash will be stored in a per-user folder on the drive /.Trash-<USER-ID>/

Show your user-id:

id -u

Show your group-id:

id -g

To find the correct drive-UUID:

sudo blkid

Returns:

...
/dev/sda2: LABEL="Ubuntu" UUID="12312312312312312" TYPE="ext4" 
/dev/sda3: LABEL="Data" UUID="45645645645645645" TYPE="ntfs" 
...

Edit fstab:

sudo gedit /etc/fstab

Add or edit the following line to include uid=1000:

...
UUID=45645645645645645  /media/DATA  ntfs-3g  defaults,umask=077,fmask=177,uid=1000,gid=1000,noatime  0  0
...

The partition will be mounted after you start your machine. If you don't want automatic mount you should add 'noauto':

...
UUID=45645645645645645  /media/DATA  ntfs-3g  defaults,umask=077,fmask=177,uid=1000,gid=1000,noauto,noatime  0  0
...

Now remount the partitions:

sudo umount -a
sudo mount -a

In this example the Trash can will be located in /media/DATA/.Trash-1000/.

Mount manually

You can also use the same options when manually mounting:

sudo mkdir /media/DATA
sudo mount /dev/sda3 /media/DATA -o defaults,umask=077,fmask=177,uid=1000,gid=1000,noatime

Other settings explained

Header text Header text
/media/DATA mount point
ntfs-3g volume type
uid=1000 user-id 1000, check yours with 'id -u'
gid=1000 group-id 1000, check yours with 'id -g'
umask=077 causes files to be accessible only to you, not other users
fmask=177 makes files non-executable
noatime do not store accesstimes, advisable on SSD drives
user,noauto if you want user-mounting, not automatic
exec user implies noexec, add this if you still want to execute things