Skip to content

Instantly share code, notes, and snippets.

@Luis-Licea
Last active June 21, 2022 19:56
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Luis-Licea/7d350d1e97378b540e9b79728ddb174c to your computer and use it in GitHub Desktop.
Save Luis-Licea/7d350d1e97378b540e9b79728ddb174c to your computer and use it in GitHub Desktop.
Mount a read-write NTFS drive with udisksctl without root privileges.
# /etc/fstab: static file system information.
#
# By default, the command `udisksctl mount -b /dev/sdb1` will mount the hard
# drive with read-only access. The following options allow `udisksctl` to mount
# the drive with read-write permissions without using `su` or `sudo`.
#
# Settings: read `man fstab ntfs-3g` for options.
#
# LABEL - the disk label obtained by running the `lsblk -f` command.
# /urn/media/luis/DATA - the directory where I want the disk to be mounted.
# ntfs-3g - the open source implementation of ntfs.
# rw - enables read-write access as opposed to read-only access.
# uid - the user id obtained by running the `id` command, needed by umask.
# gid - the group id obtained by running the `id` command, needed by umask.
# umask - permission flags for user, group, and others (vfat and ntfs formats only). Similar to rwx flags.
# windows_names - applies Windows restrictions on new file names.
LABEL=DATA /run/media/luis/DATA ntfs-3g rw,uid=1000,gid=1001,umask=077,windows_names 0 0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment