Trashcan support on NTFS volumes: Difference between revisions
mNo edit summary |
mNo edit summary |
||
| Line 48: | Line 48: | ||
<blockquote> | <blockquote> | ||
< | <syntaxhighlight lang=bash> | ||
... | ... | ||
UUID=45645645645645645 /media/DATA ntfs-3g 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 | ||
... | ... | ||
</ | </syntaxhighlight> | ||
</blockquote> | </blockquote> | ||
| Line 58: | Line 58: | ||
<blockquote> | <blockquote> | ||
< | <syntaxhighlight lang=bash> | ||
... | ... | ||
UUID=45645645645645645 /media/DATA ntfs-3g 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 | ||
... | ... | ||
</ | </syntaxhighlight> | ||
</blockquote> | </blockquote> | ||
Revision as of 10:28, 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 |