Impossible edit permission of folders

Using KDE Partiton Manager I mount an NTFS partition in /mnt/DATI where I have all my data. Of course I need to have all these data available then I used Doplhin to change permissions but I’m not able to edit permissions for all folder.
Here’s the steps I made.

  1. in KDE Partiton Manager I mount NTFS partition at boot. Mount point is /mnt/DATI
  2. reboot and I see NTFS partition mounted but all folders and files are available only for owner (that’s root).
  3. I try to change permission using Dolphin as root: kdesu dolhpin → root password → select /mnt/DATI/ → Properties → Permissions → Can View & Modify Content and I select “Apply changes to all subfolders and their contents”
    I get this error message:
Could not modify the ownership of file ‘mnt/DATI/... 
You have insufficient access to the file to perform the change.

Operating System: OpenMandriva ROME 24.01
KDE Plasma Version: 5.27.9
KDE Frameworks Version: 5.112.0
Qt Version: 5.15.11
Kernel Version: 6.6.2-desktop-1omv2390 (64-bit)
Graphics Platform: X11
Processors: 4 × Intel® Core™ i7-6500U CPU @ 2.50GHz
Memory: 7.7 GiB of RAM
Graphics Processor: Mesa Intel® HD Graphics 520
Manufacturer: HP
Product Name: HP Notebook
System Version: Type1ProductConfigId

I do not use Windows or NTFS so I am not sure if the following works with a Windows partition. As I understand things it should work.

You may be able to do this by skipping KDE Partiton Manager. After booting open Dolphin as user not root and in the Devices list select your NTFS partition and Dolphin prompts you for root password. Enter that and partition is mounted. Then what ever folder or files you wish to change permissions on select that and right click mouse and select “Properties” and from there navigate to Permissions page. If system wants root password for any permissions change it will ask.

If that does not work you can change owner of folders/files with chown command and permissions with chmod. This is one of many how to articles for changing ownership and permissions, there are many. Feel free to search for your own preferred “how to”.

It would be educational and useful for me and other users to discover what “really” works with Windows partitions used in Linux and OpenMandriva, we do get questions and my answers probably are not always adequate.

If Dolphin is not mounting Windows NTFS partitions that would be a bug needing a bug report.

This way works, and it is what I’m doing now to access files waiting for more general solution. But has two limits:

  1. it need repeated every time you boot OpenMandriva.
  2. partition is accessible only to user that mounted it. In multiuser systems where this partition could be accessed by all users this method should be avoided also because it need root password

Using KDE partition manager instead partition is mounted permanently and accessible to all users.

I read how-to but I don’t see any suggestion to change recursively permission and in my NTFS partition I have a lot of directories and subdirectories and I need to change all at once.

One question remain: why using Dolhpin as root I have “insufficient access” (see error message).

Recursive option in command line is -R

Postedit:
@Giorgio ma questa partizione dati è solo tua? Nel senso che ci lavori solo tu sebbene da SO diversi oppure ci devono avere accesso altre persone, quindi con poteri limitati?

In generale ci lavorano anche altri utenti e comunque il guaio è che non riesco a gestire i permessi. Se ci riuscissi potrei adattare i permessi agli utenti.
Fra l’altro è una cosa che ho sempre fatto con OpenMandriva, forse usando altri strumenti. Se non ricordo male tempo fa non c’era solo KDE P.M., c’erano anche altri programmi che svolgevano bene il compito.

OK, now maybe I better know what is needed here. Like in a class room where you want the partition available for multiple users. You can add that partition to /etc/fstab file and it will be mounted when you boot. You can do this in KDE Partition Manager. Just right click on the partition and select “Edit Mount Point” and click OK and the partition will be automatically added to /etc/fstab.

Note: There is an optional box there to select to let users to mount and unmount partition.

Note-2: When the dialog window pops up and tells you it is adding partition to /etc/fstab and then that “this can not be undone”. That is not true, this can easily be undone by simply removing or commenting out the line in /etc/fstab.

Io farei questo, però sarebbe meglio che qualcun altro confermasse:

# chmod -R 777 /mnt/DATI

Postedit:
con su da console di root, non con sudo

e dopo dovresti poter adattare i permessi agli utenti come dici.

La guida di @ben79 qui sopra è molto chiara.
Controlla il punto di mount dopo, perchè potrebbe diventare /dev/DATI o altro

I don’t know how to do it with gui but you may edit directly the /etc/fstab file and use the right combination of dmask and fmask (or umask directly)

What I did as teacher in my laboratory where several classes needed access to the same partition.

I cited this in point 1) in my first message.
Of course your guide is much more detailed and clear with useful images.

I did several times during my many attempts.
By the way it should be possible to remove mount point from KDE PM but here I found a bug

In mancanza di conferme ho provato comunque e il risultato non è stato quello aspettato, lo schermo si è riempito di righe più o meno uguali, del tipo:

chmod: cambio dei permessi di '/mnt/DATI/…. Operazione non supportata

dove al posto dei puntini c’è il percorso del singolo file.
Qualcosa che ricorda da vicino il messaggio d’errore che ho quando provo a cambiare i permessi con Dolphin da root.

Ok, prova con una sottodirectory a caso meglio se con dentro pochi file e qualche cartella e dai il comando
ls -la /percorso/completo/della/directory

Ti dovrebbe dire i permessi e il proprietario.

Inoltre potresti provare il chmod solo su una directory invece che su tutto il /mnt/DATI/ e vedere se cambia qualcosa.
O addirittura solo su un file. Bisogna fare qualche prova per tentare di venirne a capo.

funziona solo dando il comando come root
`# ls -la /mnt/DATI/geografia/

totale 20
drwx------ 1 root root 0 apr 19 2019 .
drwx------ 1 root root 12288 dic 15 09:06 …
drwx------ 1 root root 8192 apr 10 2022 carte_geografiche`

Provato ma non cambia granché

# chmod -R 777 /mnt/DATI/geografia/
chmod: cambio dei permessi di '/mnt/DATI/geografia/carte_geografiche/Alpi/OpenPTMap.tms': Operazione non supportata
chmod: cambio dei permessi di '/mnt/DATI/geografia/carte_geografiche/Alpi/4UMaps.tms': Operazione non supportata
chmod: cambio dei permessi di '/mnt/DATI/geografia/carte_geografiche/Alpi/Alpenkarte.tms': Operazione non supportata
.....

Anche sul singolo file non si riesce:

# chmod -R 777 /mnt/DATI/TESTI/lista_VIAGGIO.odt 
chmod: cambio dei permessi di '/mnt/DATI/TESTI/lista_VIAGGIO.odt': Operazione non supportata

Sembra quasi che il comando da console non abbia “privilegi sufficienti”. Quasi come se ci fossero due root, uno proprietario dei file e un altro che dà il comando da console, con privilegi diversi. E questo mi ricorda una discussione già fatta sull’uso di diverse password per compiti simili che avevo già aperto sul forum, ormai parecchio tempo fa.

# chmod 0777 /mnt/DATI/TESTI/lista_VIAGGIO.odt
?

Che cosa dice riguardo ai permessi dei singoli file?

/mnt/DATI/geografia/
hai messo solo le directory

# ls -la /mnt/DATI/geografia/carte_geografiche/openstreetmap.odt 
-rw------- 1 root root 17313 apr 10  2022 /mnt/DATI/geografia/carte_geografiche/openstreetmap.odt

oppure nel file in cui non è stato possibile cambiare il permesso:

# ls -la /mnt/DATI/TESTI/lista_VIAGGIO.odt 
-rw------- 1 root root 49846 ott 27 08:37 /mnt/DATI/TESTI/lista_VIAGGIO.odt

indica che non ha user o gruppi proprietari strani, il problema è rw-------
Vedi un po’ se con l’altro comando dato sul singolo file qualcosa si muove.
Dopo di che io penso di arrendermi perchè non mi viene in mente altro. Sorry.

Something to try with the partition not mounted:

sudo mount -t ntfs -o rw,auto,user,fmask=0022,dmask=0000 /dev/whatever /mnt/whatever

and see if it works. Obviously you change the “whatever” to what is real on your system.

With this command the permissions are set by the mount command, specifically ‘fmask=0022,dmask=0000’. The numbers can be changed to set permissions to whatever you wish.

This would set permissions to ‘755’ on files and ‘777’ on directories. If the command works we can get in to setting exacly what you wish. This can also be used to set an entry in /etc/fstab so the partition is mounted at boot with the permissions you wish.

Got that from the link @mandian posted and another link within that article.

Interesting.
I’d just consider to set 777 on files

to not remove the execution permission in case you have any file requiring it

Postedit:
forget – reason may be not valid.

777 will set full permissions, then root can modify them.

wdyt?

Here’s my command line and what I get:

$ sudo mount -t ntfs -o rw,auto,user,fmask=0022,dmask=0000 /dev/sda6 /mnt/DATI
[sudo] password di giorgio: 
mount: (hint) your fstab has been modified, but systemd still uses
       the old version; use 'systemctl daemon-reload' to reload.

NTFS partition is mounted but files are “read only”.
Tried to change permission using Dolphin as root (kdesu dolphin) no way to change permission.

I read link posted by Mandian but I didn’t tried because it’s not clear to me, nor what fmask and dmask should do.
I’ll search how to change setting for permission because I need “complete access” to files and folders.
Anyway there is a big question still unsolved: why I can’t change permission even with root privilege.?
You don’t think this is a big “bug” or something like?

fmask is the same ad umask but only for files and dmask is its analogue only for directories. These are options for nffs module. They cannot damage your file system.

Also check the permission of /mnt/DATI: they should be 755.

If it doesn’t work check the integrity of yours ntfs partition.

Possibly it is, I think that I am learning how this works along with you. Just talked to OM project leader and got something to try.

sudo mount -t ntfs3 -o rw,auto,user,umask=0000 /dev/sda6 /mnt/DATI

If that does not work there is another thing to try. I used umask=0000 because that should set all permissions to 777 which seems like what you want for your use case.

This was explanation from @bero:

There’s 2 different kernel drivers for ntfs – ntfs (old, read-only) and ntfs3 (much better, read-write). Probably he’s using the old one (we may want to drop that from the 6.7 build, there’s really no reason why it should still exist).

If for some reason it doesn’t work, this might: sudo rmmod ntfs ; sudo modprobe ntfs3

Then run the mount command again.

1 Like