23.3 KDE: HDD-Folders changing permissions on the fly

Help for Current Versions of MX
When asking for help, use Quick System Info from MX Tools. It will be properly formatted using the following steps.
1. Click on Quick System Info in MX Tools
2. Right click in your post and paste.
Message
Author
grelos
Posts: 76
Joined: Wed Mar 28, 2018 3:12 pm

23.3 KDE: HDD-Folders changing permissions on the fly

#1 Post by grelos »

I run 23.3 KDE, single boot (no windows). OS runs on a SSD, while documents, personal files are located on a few HDDs. All disks are ext4 formatted.

When I boot the machine, everything looks ok, meaning that the owner of /media/desktop/HDDx is User. However, after a while (time unknown, I would say 1-2 hours) something happens and permissions on /media/desktop/HDDx got changed without any intervention from my side. This is already weird but what is even worse is that when I check permissions in Dolphin, it still says the owner is the User but as a matter of fact it's not because User can't write nor modify anything in those disks/folders.

The cumbersome solution I am currently using is changing ownership in Dolphin (via root actions) so the user, log out, log in again and then I am ok until that happens again.
This is a major problem I need to fix otherwise I would have to change distro.

EDIT: I suspect an hardware problem but I need to investigate further.

Code: Select all

[CODE]System:
  Kernel: 6.1.0-25-amd64 [6.1.106-3] arch: x86_64 bits: 64 compiler: gcc v: 12.2.0
    parameters: BOOT_IMAGE=/vmlinuz-6.1.0-25-amd64 root=UUID=<filter> ro quiet splash
  Desktop: KDE Plasma v: 5.27.5 wm: kwin_x11 vt: 7 dm: SDDM Distro: MX-23.3_KDE_x64 Libretto May
    19 2024 base: Debian GNU/Linux 12 (bookworm)
Machine:
  Type: Desktop Mobo: ASRock model: A300M-STX serial: <superuser required>
    UEFI: American Megatrends v: P3.60 date: 10/28/2019
CPU:
  Info: model: AMD Ryzen 5 3400G with Radeon Vega Graphics bits: 64 type: MT MCP arch: Zen/Zen+
    note: check gen: 1 level: v3 note: check built: 2019 process: GF 12nm family: 0x17 (23)
    model-id: 0x18 (24) stepping: 1 microcode: 0x8108102
  Topology: cpus: 1x cores: 4 tpc: 2 threads: 8 smt: enabled cache: L1: 384 KiB
    desc: d-4x32 KiB; i-4x64 KiB L2: 2 MiB desc: 4x512 KiB L3: 4 MiB desc: 1x4 MiB
  Speed (MHz): avg: 1382 high: 1393 min/max: 1400/3700 boost: enabled scaling:
    driver: acpi-cpufreq governor: ondemand cores: 1: 1380 2: 1385 3: 1393 4: 1380 5: 1380 6: 1389
    7: 1387 8: 1367 bogomips: 59201
  Flags: avx avx2 ht lm nx pae sse sse2 sse3 sse4_1 sse4_2 sse4a ssse3 svm
  Vulnerabilities:
  Type: gather_data_sampling status: Not affected
  Type: itlb_multihit status: Not affected
  Type: l1tf status: Not affected
  Type: mds status: Not affected
  Type: meltdown status: Not affected
  Type: mmio_stale_data status: Not affected
  Type: reg_file_data_sampling status: Not affected
  Type: retbleed mitigation: untrained return thunk; SMT vulnerable
  Type: spec_rstack_overflow mitigation: safe RET
  Type: spec_store_bypass mitigation: Speculative Store Bypass disabled via prctl
  Type: spectre_v1 mitigation: usercopy/swapgs barriers and __user pointer sanitization
  Type: spectre_v2 mitigation: Retpolines; IBPB: conditional; STIBP: disabled; RSB filling;
    PBRSB-eIBRS: Not affected; BHI: Not affected
  Type: srbds status: Not affected
  Type: tsx_async_abort status: Not affected
Graphics:
  Device-1: AMD Picasso/Raven 2 [Radeon Vega Series / Radeon Mobile Series] driver: amdgpu
    v: kernel arch: GCN-5 code: Vega process: GF 14nm built: 2017-20 pcie: gen: 3 speed: 8 GT/s
    lanes: 16 ports: active: HDMI-A-1 empty: DP-1,DP-2,DP-3 bus-ID: 05:00.0 chip-ID: 1002:15d8
    class-ID: 0300 temp: 46.0 C
  Display: x11 server: X.Org v: 1.21.1.7 with: Xwayland v: 22.1.9 compositor: kwin_x11 driver: X:
    loaded: amdgpu unloaded: fbdev,modesetting,radeon,vesa dri: radeonsi gpu: amdgpu display-ID: :0
    screens: 1
  Screen-1: 0 s-res: 1920x1080 s-dpi: 96 s-size: 508x285mm (20.00x11.22") s-diag: 582mm (22.93")
  Monitor-1: HDMI-A-1 mapped: HDMI-A-0 model: Acer SA270 serial: <filter> built: 2021
    res: 1920x1080 hz: 75 dpi: 82 gamma: 1.2 size: 598x336mm (23.54x13.23") diag: 686mm (27")
    ratio: 16:9 modes: max: 1920x1080 min: 720x400
  API: OpenGL v: 4.6 Mesa 23.1.2-1~mx23ahs renderer: AMD Radeon Vega 11 Graphics (raven LLVM
    15.0.6 DRM 3.49 6.1.0-25-amd64) direct-render: Yes
Audio:
  Device-1: AMD Raven/Raven2/Fenghuang HDMI/DP Audio driver: snd_hda_intel v: kernel pcie: gen: 3
    speed: 8 GT/s lanes: 16 bus-ID: 05:00.1 chip-ID: 1002:15de class-ID: 0403
  Device-2: AMD Family 17h/19h HD Audio vendor: ASRock driver: snd_hda_intel v: kernel pcie:
    gen: 3 speed: 8 GT/s lanes: 16 bus-ID: 05:00.6 chip-ID: 1022:15e3 class-ID: 0403
  API: ALSA v: k6.1.0-25-amd64 status: kernel-api tools: alsamixer,amixer
  Server-1: PipeWire v: 1.0.0 status: active with: 1: pipewire-pulse status: active
    2: wireplumber status: active 3: pipewire-alsa type: plugin 4: pw-jack type: plugin
    tools: pactl,pw-cat,pw-cli,wpctl
Network:
  Device-1: Intel Wi-Fi 6 AX200 driver: iwlwifi v: kernel modules: wl pcie: gen: 2 speed: 5 GT/s
    lanes: 1 bus-ID: 03:00.0 chip-ID: 8086:2723 class-ID: 0280
  IF: wlan0 state: up mac: <filter>
  Device-2: Realtek RTL8111/8168/8411 PCI Express Gigabit Ethernet vendor: ASRock driver: r8169
    v: kernel pcie: gen: 1 speed: 2.5 GT/s lanes: 1 port: f000 bus-ID: 04:00.0 chip-ID: 10ec:8168
    class-ID: 0200
  IF: eth0 state: down mac: <filter>
Bluetooth:
  Device-1: Intel AX200 Bluetooth type: USB driver: btusb v: 0.8 bus-ID: 1-3.1:4 chip-ID: 8087:0029
    class-ID: e001
  Report: hciconfig ID: hci0 rfk-id: 1 state: up address: <filter> bt-v: 3.0 lmp-v: 5.2
    sub-v: 2184 hci-v: 5.2 rev: 2184
  Info: acl-mtu: 1021:4 sco-mtu: 96:6 link-policy: rswitch sniff link-mode: peripheral accept
    service-classes: rendering, capturing, object transfer, audio, telephony
Drives:
  Local Storage: total: 11.37 TiB used: 6.1 TiB (53.7%)
  SMART Message: Unable to run smartctl. Root privileges required.
  ID-1: /dev/nvme0n1 maj-min: 259:0 vendor: Kingston model: SA2000M8250G size: 232.89 GiB
    block-size: physical: 512 B logical: 512 B speed: 31.6 Gb/s lanes: 4 type: SSD serial: <filter>
    rev: S5Z42105 temp: 40.9 C scheme: GPT
  ID-2: /dev/nvme1n1 maj-min: 259:1 vendor: Kingston model: SA2000M8250G size: 232.89 GiB
    block-size: physical: 512 B logical: 512 B speed: 31.6 Gb/s lanes: 4 type: SSD serial: <filter>
    rev: S5Z42105 temp: 45.9 C scheme: GPT
  ID-3: /dev/sda maj-min: 8:0 type: USB vendor: Seagate model: Expansion size: 3.64 TiB
    block-size: physical: 4096 B logical: 512 B type: N/A serial: <filter> rev: 0712 scheme: GPT
  ID-4: /dev/sdd maj-min: 8:48 type: USB vendor: Seagate model: ST2000LM015-2E8174 size: 1.82 TiB
    block-size: physical: 4096 B logical: 512 B type: HDD rpm: 5400 serial: <filter> rev: 2501
    scheme: GPT
  ID-5: /dev/sde maj-min: 8:64 vendor: Toshiba model: MQ04ABF100 size: 931.51 GiB block-size:
    physical: 4096 B logical: 512 B speed: 1.5 Gb/s type: HDD rpm: 5400 serial: <filter> rev: 2E
    scheme: GPT
  ID-6: /dev/sdf maj-min: 8:80 type: USB vendor: Toshiba model: HDWL120 size: 1.82 TiB
    block-size: physical: 512 B logical: 512 B type: HDD rpm: 5400 serial: <filter> rev: 0107
    scheme: GPT
  ID-7: /dev/sdg maj-min: 8:96 type: USB vendor: Toshiba model: DT01ACA300 size: 2.73 TiB
    block-size: physical: 512 B logical: 512 B type: HDD rpm: 7200 serial: <filter> rev: 0107
    scheme: GPT
Partition:
  ID-1: / raw-size: 231.62 GiB size: 226.92 GiB (97.97%) used: 157.42 GiB (69.4%) fs: ext4
    dev: /dev/dm-0 maj-min: 253:0 mapped: luks-<filter>
  ID-2: /boot raw-size: 1024 MiB size: 973.4 MiB (95.06%) used: 359.9 MiB (37.0%) fs: ext4
    dev: /dev/nvme1n1p2 maj-min: 259:4
  ID-3: /boot/efi raw-size: 256 MiB size: 252 MiB (98.46%) used: 274 KiB (0.1%) fs: vfat
    dev: /dev/nvme1n1p1 maj-min: 259:2
Swap:
  Kernel: swappiness: 15 (default 60) cache-pressure: 100 (default)
  ID-1: swap-1 type: file size: 5 GiB used: 9.2 MiB (0.2%) priority: -2 file: /swap/swap
Sensors:
  System Temperatures: cpu: 45.5 C mobo: N/A gpu: amdgpu temp: 45.0 C
  Fan Speeds (RPM): N/A
Repos:
  Packages: pm: dpkg pkgs: 2619 libs: 1385 tools: apt,apt-get,aptitude,nala pm: rpm pkgs: 0
    pm: flatpak pkgs: 0
  No active apt repos in: /etc/apt/sources.list
  Active apt repos in: /etc/apt/sources.list.d/brave-browser-release.list
    1: deb [signed-by=/usr/share/keyrings/brave-browser-archive-keyring.gpg] https://brave-browser-apt-release.s3.brave.com/ stable main
  Active apt repos in: /etc/apt/sources.list.d/debian-stable-updates.list
    1: deb http://deb.debian.org/debian bookworm-updates main contrib non-free non-free-firmware
  Active apt repos in: /etc/apt/sources.list.d/debian.list
    1: deb http://deb.debian.org/debian bookworm main contrib non-free non-free-firmware
    2: deb http://security.debian.org/debian-security bookworm-security main contrib non-free non-free-firmware
  Active apt repos in: /etc/apt/sources.list.d/megasync.list
    1: deb [signed-by=/usr/share/keyrings/meganz-archive-keyring.gpg] https://mega.nz/linux/repo/Debian_12/ ./
  Active apt repos in: /etc/apt/sources.list.d/mx.list
    1: deb http://nl.mxrepo.com/mx/repo/ bookworm main non-free
    2: deb http://nl.mxrepo.com/mx/repo/ bookworm ahs
Info:
  Processes: 352 Uptime: 1h 36m wakeups: 1 Memory: 21.43 GiB used: 14.99 GiB (70.0%) Init: SysVinit
  v: 3.06 runlevel: 5 default: graphical tool: systemctl Compilers: gcc: 12.2.0 alt: 12
  Client: shell wrapper v: 5.2.15-release inxi: 3.3.26
Boot Mode: UEFI
[/code]
MX-19 on Lenovo 520-15IKB

User avatar
m_pav
Developer
Posts: 1799
Joined: Sun Aug 06, 2006 3:02 pm

Re: 23.3 KDE: HDD-Folders changing permissions on the fly

#2 Post by m_pav »

Never seen that before, but I guess it's because I almost never allow a GUI app to do permissions and I usually set up newly introduced drive partitions using the command line to change the owner of the hidden "dot file" at the root of all partitions to myself.

Assuming your external drives are all formatted with a Unix type FileSystem, I suggest you do this from the command line, replacing all instances of <device> with the proper label for each of your external partitions, and all instances of <me> with your login username.

Code: Select all

sudo chown /media/<device>/. && sudo chown -R <me>:<me> /media/<device>/*
Notice the trailing dot after the first EXT-DATA/ ? That's the hidden dot file that controls all inherited permissions for all new content written to that partition. It does not change any of the drives existing content, hence the second half of the command with the dash followed by an uppercase R ahead of the user name and the trailing asterisk.

The first chown will change the ownership of the hidden "dot file" at the root of the partition, the second will recursively change the permissions of all files and folders on the partition to your username, thereby fixing all permission based issues.

Thereafter, I suggest you stay away from GUI based permissions and you should never face this issue again because the partitions will be set up for continued successful and trouble free operation.

To give an example, if I were to issue the command above on a USB drive with an ext4 formatted partition, where the partition label is EXT-DATA, it might look like the following;

sudo chown mike:mike /media/EXT-DATA/. && sudo chown -R mike:mike /media/EXT-DATA/*

Also noted you are referencing 2 USB attached external drives and I have to ask if there were any power management events within those 2 hours as that would be the primary thing I would be looking for in this scenario. It is also entirely possible the external drive controller is spinning down the drives after a period or inactivity and causing this phenomenon.

The 2nd thing is also related to power, momentary browning causing a rapid disconnection/reconnection is enough to trigger the phenomenon you are reporting. I have seen it many times over with sloppy USB ports, worn or damaged USB cables and ageing power bricks for power hungry external drives.

I always purchase 12v 5A supplies to run external power hungry Desktop Drives because a 5A supply will have roughly 2A higher capacity than such a drive and enclosure could ever demand. This is the best safeguard against brown-outs, during which a power adapter is incapable of supplying enough current to the device and these drives usually come with a 2A supply. You may have seen an examole of this before when the house lights dim for a short period, this is officially known as browning.
Mike P

Regd Linux User #472293
(Daily) Lenovo T560, i7-6600U, 16GB, 2.0TB SSD, MX_ahs
(ManCave) AMD Ryzen 5 5600G, 32G, 8TB mixed, MX_ahs
(Spare)2017 Macbook Air 7,2, 8GB, 256GB SSD, MX_ahs

Post Reply

Return to “MX Help”