K
K
karpo5182021-01-19 23:41:45
linux
karpo518, 2021-01-19 23:41:45

Why doesn't Linux allow changing the ownership of folders and files under /media/gallery?

I connected an additional HDD to the PC and mounted it to /media/gallery. But for some reason, all files and folders on this partition are owned by root and have 777 permissions, and text files have become executable. Changing permissions and ownership via chmod and chown does not work. In the file manager from root, when changing the owner of a folder, the value changes back to root after half a second. How to solve this problem?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
J
justhostRU, 2021-01-20
@justhostRU

> How to solve this problem?
rights may not be registered for two reasons:
the disk is mounted in read mode, RO. remount in write mode.
the disk is mounted with wild crutches, or with a non-native FS.
because nothing is really described, I vanguy ntfs and mount crutches in MINT to it. Format the disk in NATIVE FS format. ext4 for example.

K
karpo518, 2021-01-20
@karpo518

To solve the problem, you will need to install an additional package if it is not already installed:
sudo apt install ntfs-3g
Then you will need to make changes to /etc/fstab . I already had automatic mounting configured for the desired partition, so I simply replaced:

UUID=209AC33027DAFCFC /media/gallery	ntfs	defaults	0	2
on the
UUID=209AC33027DAFCFC /media/gallery	ntfs-3g	uid=user1,gid=user1,dmask=022,fmask=133	0	0

Here, instead of ntfs, I indicated the installed ntfs-3g driver, indicated the user and group of the owner of files and directories on the disk (uid and gid), and also, using bit masks, redefined the rights to directories and files to 755 and 644, respectively (dmask and fmask).
In general, it is recommended to mount the partitions manually, and then write the rules in /etc/fstab so as not to break the system, but I did not do that. Just in case you haven't mounted a partition yet, it's convenient to determine the UUID using Gparted in the partition information. Planc
's comment and its link https://wiki.archlinux.org/index.php/NTFS-3G_(%D0%...) The only thing I didn't understand was the difference between (dmask + fmask) and umask PS Also thanks for help ky0
, my beloved mother and all my fans for always believing in me =)

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question