On 2022-12-31 14:34, gumb wrote:
On 31/12/2022 13:14, Carlos E. R. wrote:
On 2022-12-31 12:57, gumb wrote:
I have some directories that seem to be missing ownership. The files within them are all attributed to an owner but some (not all) of the directories themselves have an 'empty' owner, at least when viewed within Dolphin file manager. I've already run this command, as root, from the top-level directory:
chown -R 4242:fbox_cifs media/
but this doesn't enforce user 4242 as the owner of all the directories, only the files within them. How can I correct this?
I'll send more detail if necessary but maybe there's a simple solution without me having to post several more paragraphs.
CIFS, or SAMBA, do not support file or directory ownership, because FAT drives do not support it.
So chown doesn't work.
The ownership is decided in the mount command.
Okay, thanks. Well that sort of gives some clues, but the filesystem is not FAT, it's ext4. Maybe what you say applies nonetheless with ext4 as well?
But you are accessing it via CIFS, which is a Windows protocol. It behaves as if it were a FAT disk. If you were using NFS, then Linux ownership would be supported.
It's an external HDD plugged into my ISP's router. The ISP actually stipulates ext4 as the filesystem that has to be used, but it can only be accessed (usefully) via Samba/Cifs.
LOL.
Years ago I tried via FTP but hit a bunch of unresolvable issues which meant Cifs was the only remaining option.
I have uid=me,gid=root stipulated in the mount command in fstab which creates some kind of overlay, although that overlay sometimes seems to get 'uncovered' or overridden by the router and everything shows up again as 4242:fbox_cifs. On occasions in the past when there were anomalies I had to recursively chown all the files as me:root whilst I have the drive plugged directly into my PC's USB port, then plug it back into the router. Might be worth trying that again.
Sorry, can't advise better, I'm not very familiar with CIFS. Maybe you can configure the samba service to assign the permissions you want. Maybe google for "linux permissions CIFS"? For instance: https://sysadmins.tech/linux-and-cifs-files-permissions/ Doc: https://wiki.samba.org/index.php/LinuxCIFS_utils -- Cheers / Saludos, Carlos E. R. (from 15.4 x86_64 at Telcontar)