0

I am getting this error from git:

fatal: detected dubious ownership in repository at '/run/media/marcel/Хранилище/Dev/Desktop/SimpleAccent'
To add an exception for this directory, call:

        git config --global --add safe.directory '/run/media/marcel/Хранилище/Dev/Desktop/SimpleAccent'

Here's the ls -la for my directory:

drwxrwxrwx. 1 root root 4096 июл 30 18:05 ./
drwxrwxrwx. 1 root root 4096 мая 25 10:57 ../
drwxrwxrwx. 1 root root    0 июн 14 19:03 config/
drwxrwxrwx. 1 root root 4096 июн 15 16:55 .git/
-rwxrwxrwx. 1 root root 3115 июн 16 15:53 .gitignore*
drwxrwxrwx. 1 root root 4096 июл 30 18:11 .idea/
drwxrwxrwx. 1 root root 4096 июн 15 16:46 lib/
-rwxrwxrwx. 1 root root 1065 мая 25 11:22 LICENSE*
drwxrwxrwx. 1 root root    0 июл 28 12:27 logs/
-rwxrwxrwx. 1 root root    0 июл 28 12:53 nohup.out*
drwxrwxrwx. 1 root root    0 мая 28 12:18 platform/
-rwxrwxrwx. 1 root root 1436 июл 15 13:50 README.md*
drwxrwxrwx. 1 root root    0 июл 28 12:27 scripts/
drwxrwxrwx. 1 root root    0 июн 16 20:06 setup/
-rwxrwxrwx. 1 root root 2620 июл 30 18:05 simpleaccent.py*
drwxrwxrwx. 1 root root 4096 июн 15 14:08 _util/
drwxrwxrwx. 1 root root    0 июн 14 19:46 .vscode/

They are all root, my user is marcel.

I do sudo chown -R marcel:marcel . while in the directory, but the owner is still root. I try sudo chown -R marcel . ; sudo chgrp -R marcel ., but it's none the better.

How to make chown work?

Specs, if that could matter

marcel@fedora 
------------- 
OS: Fedora Linux 38 (KDE Plasma) x86_64 
Host: MS-7D18 2.0 
Kernel: 6.4.4-200.fc38.x86_64 
Uptime: 46 mins 
Packages: 2015 (rpm), 13 (flatpak) 
Shell: bash 5.2.15 
Resolution: 1920x1080 
DE: Plasma 5.27.6 
WM: kwin 
Theme: [Plasma], Breeze [GTK2/3] 
Icons: [Plasma], breeze-dark [GTK2/3] 
Terminal: tmux 
CPU: 11th Gen Intel i5-11400 (12) @ 4.400GHz 
GPU: NVIDIA GeForce RTX 3060 Lite Hash Rate 
Memory: 5712MiB / 15875MiB 
MrArsikk
  • 11
  • 3
  • 1
    No error messages from the `chown` and `chgrp` invocations? What is the filesystem type this directory is on? The "all permissions" are also strange. If not explicit set it give some FAT vibes. The /run/media/*/Desktop/ also indicates some shared stuff. – Paul Pazderski Jul 30 '23 at 11:56
  • 4
    `chown` doesn’t work as you expect if the filesystem is FAT or NTFS. In these cases the ownership is set by the way you mount the partition, either in fstab or by the mount command used – PonJar Jul 30 '23 at 12:34
  • Moreover the directory is mount in `/run` tree which is not good place for mount remote/portable media – Romeo Ninov Jul 30 '23 at 12:48
  • `df -T` will list filesystem type which would help us answer this question. – user10489 Jul 30 '23 at 13:16
  • 1
    @RomeoNinov mounting external disks in `/run/media/` is common in some DEs these days. – muru Jul 30 '23 at 13:26
  • 1
    See [What does a dot after the file permission bits mean](https://unix.stackexchange.com/questions/102624/what-does-a-dot-after-the-file-permission-bits-mean) and [What does the dot at the end of the permissions in the output of "ls -lah" mean?](https://stackoverflow.com/questions/30594871/what-does-the-dot-at-the-end-of-the-permissions-in-the-output-of-ls-lah-mean). Run `ls -Z` or `getfacl -Rpt ` to check the security context of your files. – aviro Jul 30 '23 at 13:31
  • `mount | grep 'media'` would show how it's mounted. Are you working on a FAT or NTFS formatted USB disk? They don't support Linux permissions. Read `man mount`. – waltinator Jul 30 '23 at 19:11
  • @waltinator yes, the drive is NTFS. – MrArsikk Jul 31 '23 at 10:26
  • @MrArsikk Did you read `man mount`? It has a section on mounting FAT and NTFS volumes. – waltinator Jul 31 '23 at 15:18

0 Answers0