Mounting on startup

I have an additional hard drive i want to mount it into /mnt/Ddrive/ on startup but it mounts it with all the permissions and it belongs to root i wanna mount it with the this permissions:

rwx r-x r-x emre:emre

how can i configure that ?

Here is my fstab file:

You can do that with an additional line in /etc/fstab.

First - don’t use /mnt for permanent mounts - it’s purpose in the FHS is temporary mounts.

Create a separate mountpoint - and set the necessary permissions

1 Like
1 Like

I created a mountpoint /Ddrive/ after mounting permissions are changing to the drwx rwx rwx again in fstab file i mount it with this line

UUID=626E6FBF6E6F8A9D /Ddrive/ ntfs defaults,-default_permissions 0 0

Did you read my tutorial?

  1. If it’s a non-POSIX filesystem that contains only files pertinent to your user account, then mount it to a directory in your home directory.

  2. Look at the mount options for ntfs in… :arrow_down:

man mount

You need to set the uid to your user ─ hint: that would normally be 1000 ─ in the mount options, and set a umask. The umask does not represent the permissions to set, but the permissions to subtract from 777, so you’ll probably want 022.

You’ll want something like… :arrow_down:

UUID=some-long-string  /home/keops/Ddrive  ntfs-3g  auto,nofail,uid=1000,gid=1000,utf8,umask=022,defaults   0   0

With the newer 5.15 kernel, you can use ntfs3 instead of ntfs-3g. It’s allegedly a little faster because it’s an in-kernel driver, whereas ntfs-3g runs in userspace.

As for the UUID of the filesystem, you can find out about that by issuing the command… :arrow_down:

lsblk --tree -o +UUID
1 Like

Yes - this is normal for ntfs formatted partitions.

The Linux driver does not translate ntfs permissions - and what should they be translated to?

There is no correlation between users on a Windows system and a random Linux system mounting the partition.

1 Like

Technically, ntfs doesn’t have any real permissions or file ownership; it relies on ACLs to set the permissions. :wink:


This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.