mount NTFS partition at boot

I have an NTFS partition I want mounted at boot because I use it as main data storage.

Using YaST2 -> System -> Partitioner I select the partition, set mount point and in “Fstab options” automatically two options appears “fmask=133,dmask=022”.

If I reboot the partition is mounted but writing isn’t allowed.
May be because the two options?

Writing by whome?

And it is of course best to show the /etc/fstab entry of that file system.

As this is a non-Linux file system type, you can not expect it to support Unix/Linux ownership and permissions (which is that decides if a user can read/write/execute files).

To allow these file systems to be used on Linux, ownership and permissions are faked. To configure what is to be faked (which owner, which group. which permissions) there are file system specific optins. You have already two of them to fake the permissions of files and directories (but see below, I think they are the wrong ones and thus do nothing). But as the ownership is apparently (we can not check this, because you did not show the information) not configured, root:root will be the owner and other users are forbidden to read/write.

Thus, either you must your options so others can rea/write, or, when in fact this is to be owned and used by only one particular user), make this user (and his group) the owner by using also the uid= and gid= options.
see (of course):

man mount

Scroll down to the FILESYSTEM-SPECIFIC MOUNT OPTIONS and then Mount options for ntfs.

BTW, you will find there the umask= and not the fmask= and gmask=.
So edit your /etc/fstab line. You can post it first here when you want advice befor doing this.

Writing by the only user I have in my system.
Note that if I mount “manually” the same partition in Dolphin I can use it normally.
But partition should be mounted in a way it can be accessed by any user (I will have more users in my system).

And it is of course best to show the /etc/fstab entry of that file system.

Here’s my /etc/fstab after setting mount as described:

UUID=dfd5ace0-4197-4fa2-a61b-8630eb0ef7c9  /          ext4  defaults             0  1
UUID=bff6b194-cda9-43cf-b3fb-8c280df5df13  /home      xfs   defaults             0  0
UUID=5AA6-9421                             /boot/efi  vfat  defaults             0  2
UUID=1210e42a-e958-41cb-b810-4ddeabec4533  swap       swap  defaults             0  0
UUID=A446883746880C6C                      /mnt/DATI  ntfs  fmask=133,dmask=022  0  0

What you call “mount “manually” the same partition in Dolphin” is mounting by the desktop. The desktop does so for the loged in user and thus will use the uid= and gid= options. You can see that by dong this and then check with

mount

how it is mounted.

When you want all users read and write to that file system, then my advice would be to use root:root as owner (the deafult, but use umask=000 (and reove fmask and dmask)

UUID=A446883746880C6C                      /mnt/DATI  ntfs umask=000  0  0

Change that and then try

umount /mnt/DATI
mount /mnt/DATI

and check if a normal user can access.

BTW there are already more then one user on you system, you do not use them, but that does not mean there aren’t. Look in /etc/passwd. About 20 at least.

Still using Partitioner I removed fmask and dmask and substituted for umask 000, now my /etc/fstab is:

UUID=dfd5ace0-4197-4fa2-a61b-8630eb0ef7c9  /          ext4  defaults   0  1
UUID=bff6b194-cda9-43cf-b3fb-8c280df5df13  /home      xfs   defaults   0  0
UUID=5AA6-9421                             /boot/efi  vfat  defaults   0  2
UUID=1210e42a-e958-41cb-b810-4ddeabec4533  swap       swap  defaults   0  0
UUID=A446883746880C6C                      /mnt/DATI  ntfs  umask=000  0  0

that seems what you asked for but still impossible writing in this partition (ore create a folder).

BTW there are already more then one user on you system, you do not use them, but that does not mean there aren’t. Look in /etc/passwd. About 20 at least.
Totally new for me. I have 35 rows including one related to my user. But this means that for example this row “sshd:x:469:470:SSH daemon:/var/lib/sshd:/bin/false” is related to an user?

Your entry looks as what I asked for. (BTW, why some partitioner, just use an editor).

Now let us check how it looks. Plesae post

ls -l /mnt/DAT

that is the way you (as system manager) can see who owns and what the permissions are (and not using some end-user file manager).

And about the users. There are a lot of users for different tasks Remember that “you should not do as root waht you not need to do as root”?
These users do system things that are not needed as root, but nevertheless must be done. Some of them will be never used on the system as you use it, but others will be used regularly. They may even never run somethng, but be only owners if files.

You are using a multu-user/multi-session system and that has consequences you better try to understand, like this whole ownership/permissions design.
And yes, the user sshd will be used to run the SSH deamon (service) when you switch that on. The SSH server is a general system thing, An end-user will not run it. But there is not need to do that as root, thus for buildin security, another iser is used.

Those options are fine.

Can the root user write to the drive? If not, then the drive may have been mounted read-only, which would be because Windows fast-boot has left it in an unstable state.

Apart from that: here are the options for the NTFS drive in my “fstab”

noauto,users,uid=1001,gid=users,fmask=133,dmask=022,locale=en_US.UTF-8

Some of those options were set by the installer, and some by me.

Here’s a rundown of the ones that I set.

noauto: the disk is not automatically mounted at boot (my choice).
uid=1001: all files are owned by the user with uid=1001 (that’s me).
gid=users: all files are in the group users, which allows all ordinary users to read/write files (with that fmask).

I hope that helps.

He wants to accomodate also other users on the system (yet to be configured). Thus my advice to let user root and group root to be the owners (as with every other place where “everybody” has to have access) and set the permissions to “all allowed everything”. This contrary to your wish to have only one user to use files there.

But the idea to check if it is mounted ro is a good idea:

mount | grep DATI

Checking better I see partition is correctly mounted because I can do all (write, erase, create folder …). Then problem is solved, thanks.

(BTW, why some partitioner, just use an editor).
Because using GUI is easier.

And about the users. There are a lot of users for different tasks Remember that “you should not do as root waht you not need to do as root”?
I know and appreciate this Linux feature.
But openSuse default installation set root privilege for first user, not the best choice in my opinion.

These users do system things that are not needed as root, but nevertheless must be done. Some of them will be never used on the system as you use it, but others will be used regularly. They may even never run somethng, but be only owners if files.

You are using a multu-user/multi-session system and that has consequences you better try to understand, like this whole ownership/permissions design.
And yes, the user sshd will be used to run the SSH deamon (service) when you switch that on. The SSH server is a general system thing, An end-user will not run it. But there is not need to do that as root, thus for buildin security, another iser is used.
Very interesting.

Not root user but normal user. Then default options aren’t best choice in y opinion.

… which would be because Windows fast-boot has left it in an unstable state.
I know the problem but if I remember well if disk is “unstable” you can’t even read it.

You are welcome.

Hm, sometimes. In any case it is more difficult to communicate to the forums. :wink:

I do not think that is true.
The installer tells you that root is created and that you should provide a password.
It also advises you to create one more “normal” user, which then is done. There is nothing special about that user. The only bad thing there is that by default it will use the same password for that user as you have just given for root. It is advisable to use a different password.

It is also rather impossible, there can only be one user with superuser privileges and that is the user with UID=0. The name of that user is normaly root. There is a breach of security to have another user with UID=0 and I do not belive that the openSUSE installer creates such a beast.

The “gid=users” is supposed to take care of that, but maybe that “fmask” also needs to change to give write access via group. Perhaps it needs to be “113” instead of “133”.

Not realy.

  1. gid= should get a GID, that is a number, not a group name;
  2. nobody guarantees that those users he wants to configure will (all) be members of the group users;
  3. fmask is not mentioned in the Specific to NTFS options, thus I assume it will be ignored;

I’m pretty sure that for gid= and for uid= you can use a name or a number. For me, it doesn’t much matter, because I mainly use it as the uid= user. I think the “gid=users” was actually set by the installer way back at openSUSE 12.3, and I have just copied it since then.

As for guaranteeing that the users he wants will be in group “users” – that’s up to the administrator to guarantee.

The “fmask=” was originally set by the installer, which is really Yast partitioner – again, probably for openSUSE 12.3, which was the first version installed on this particular hardware. And it does seem to do what I expect it to do. That is, it sets the permissions for files but not for directories. And the “dmask=” seems to set the permissions for directories (and also came from the installer back at openSUSE 12.3)