Score:-1

How to chown of a directory in another disk?

ng flag

I have a dual boot with ubuntu 22.04.2 on one disk and windows 10 on another. The disk with windows is under the user 'lucas', but this provides no security whatsoever for any files in the windows disk as long as I'm logged in to my account. For most files that's fine, but I wanted to either add a custom password or require the user password to enter the folder 'db', or change the owner of the folder 'db' to the user 'test'.

I tried sudo chown test:test 'Hydrus Network', and it doesn't change the owners (ls -l shows all files of the windows disk are still under 'lucas') nor raise an error.

I saw some answers to similar questions talking about mounting, but I'm not sure if they are the answer to my question, and I'm not sure what mounting and unmounting are.

Note: This is my first week using Ubuntu, so give a detailed explanation.

sudodus avatar
jp flag
With Linux file systems it works in the same way in different drives. With Microsoft file systems you can find workarounds at [this link](https://askubuntu.com/questions/11840/how-do-i-use-chmod-on-an-ntfs-or-fat32-partition/956072#956072).
Score:3
ru flag

If the "other disk" is Windows, then it's NTFS. NTFS does not respect Linux file permissions. As such, chown, chmod, etc. does not work on NTFS drives and partitions or any files on them.

The only way to set permissions or ownership of files is partition-wide at the time that you mount (open for readability) the partition. If you are simply opening the drive in your GUI file browser, this will default to your own user. You would have to set the ownership independently by manually using mount on the command line to define where to mount the drive partition and what options such as user/group ownership, permissions mask, etc. need to be on the drive. There are numerous example questions such as the one linked to by sudodus in comments on the question which explain how to mount NTFS partitions with the proper usermasks for custom use cases, however be advised this only works partition wide and you can't mount the same drive twice, so if you intend to have a subdirectory on the drive be 'special case' that should live only on the Linux partition and not the Windows partition because of the rules of NTFS and it not supporting Linux/UNIX style permissions.

cn flag
might be useful to add (s)he needs to do this when mounting :)
I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.