Cant write or delete on newly attached drive in KDE-Plasma

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
Wal
Posts: 39
Joined: Tue Mar 22, 2022 12:34 am

Cant write or delete on newly attached drive in KDE-Plasma

#1 Post by Wal »

Hello again I am new to Plasma enviroment but very pleased with the esthetics so far. However.. I dont understand the permission differences from Xfce. In Xfce I used Thunar and could easily change ownership on new drives so I could write to them or delete from them. But in Plasma there is Dolphin and it seems to work different, because; If I check a folder on a newly mounted drive it says Im the owner but still cant write to it or delete on it. And rightclicking bring up all thoose ownershipchangeoptions that somehow neither works. Im quite sure Im doing something wrong, but think I tried all options. This is a new installed machine and whatever extra drive I connect I cant write to it or delete on it allthough I seem to be the owner...how come?

Code: Select all

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=/boot/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 System: ASUS product: N/A v: N/A serial: <superuser required>
  Mobo: ASUSTeK model: PRIME H510M-E v: Rev 1.xx serial: <superuser required>
    UEFI: American Megatrends v: 1203 date: 10/27/2021
Battery:
  Device-1: hidpp_battery_0 model: Logitech Wireless Touch Keyboard K400 Plus serial: <filter>
    charge: 100% (should be ignored) rechargeable: yes status: discharging
CPU:
  Info: model: Intel Core i3-10100F bits: 64 type: MT MCP arch: Comet Lake gen: core 10 level: v3
    note: check built: 2020 process: Intel 14nm family: 6 model-id: 0xA5 (165) stepping: 3
    microcode: 0xFC
  Topology: cpus: 1x cores: 4 tpc: 2 threads: 8 smt: enabled cache: L1: 256 KiB
    desc: d-4x32 KiB; i-4x32 KiB L2: 1024 KiB desc: 4x256 KiB L3: 6 MiB desc: 1x6 MiB
  Speed (MHz): avg: 4183 high: 4202 min/max: 800/4300 scaling: driver: intel_pstate
    governor: powersave cores: 1: 4200 2: 4189 3: 4155 4: 4194 5: 4200 6: 4172 7: 4153 8: 4202
    bogomips: 57600
  Flags: avx avx2 ht lm nx pae sse sse2 sse3 sse4_1 sse4_2 ssse3 vmx
  Vulnerabilities:
  Type: gather_data_sampling mitigation: Microcode
  Type: itlb_multihit status: KVM: VMX disabled
  Type: l1tf status: Not affected
  Type: mds status: Not affected
  Type: meltdown status: Not affected
  Type: mmio_stale_data mitigation: Clear CPU buffers; SMT vulnerable
  Type: reg_file_data_sampling status: Not affected
  Type: retbleed mitigation: Enhanced IBRS
  Type: spec_rstack_overflow status: Not affected
  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: Enhanced / Automatic IBRS; IBPB: conditional; RSB filling;
    PBRSB-eIBRS: SW sequence; BHI: SW loop, KVM: SW loop
  Type: srbds mitigation: Microcode
  Type: tsx_async_abort status: Not affected
Graphics:
  Device-1: NVIDIA GP106 [GeForce GTX 1060 3GB] driver: nouveau v: kernel non-free: 530.xx+
    status: current (as of 2023-03) arch: Pascal code: GP10x process: TSMC 16nm built: 2016-21 pcie:
    gen: 1 speed: 2.5 GT/s lanes: 16 link-max: gen: 3 speed: 8 GT/s ports: active: DVI-D-1
    empty: DP-1, DP-2, DP-3, HDMI-A-1 bus-ID: 01:00.0 chip-ID: 10de:1c02 class-ID: 0300
    temp: 52.0 C
  Display: x11 server: X.Org v: 1.21.1.7 with: Xwayland v: 22.1.9 compositor: kwin_x11 driver: X:
    loaded: modesetting unloaded: fbdev,vesa dri: nouveau gpu: nouveau display-ID: :0 screens: 1
  Screen-1: 0 s-res: 1920x1200 s-dpi: 96 s-size: 508x317mm (20.00x12.48") s-diag: 599mm (23.57")
  Monitor-1: DVI-D-1 model: Samsung SyncMaster serial: <filter> built: 2007 res: 1920x1200 hz: 60
    dpi: 94 gamma: 1.6 size: 518x324mm (20.39x12.76") diag: 611mm (24.1") ratio: 16:10 modes:
    max: 1920x1200 min: 720x400
  API: OpenGL v: 4.3 Mesa 23.1.2-1~mx23ahs renderer: NV136 direct-render: Yes
Audio:
  Device-1: Intel vendor: ASUSTeK driver: snd_hda_intel v: kernel bus-ID: 00:1f.3
    chip-ID: 8086:f0c8 class-ID: 0403
  Device-2: NVIDIA GP106 High Definition Audio driver: snd_hda_intel v: kernel pcie: gen: 1
    speed: 2.5 GT/s lanes: 16 link-max: gen: 3 speed: 8 GT/s bus-ID: 01:00.1 chip-ID: 10de:10f1
    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 Ethernet I219-V vendor: ASUSTeK driver: e1000e v: kernel port: N/A
    bus-ID: 00:1f.6 chip-ID: 8086:15fa class-ID: 0200
  IF: eth0 state: up speed: 1000 Mbps duplex: full mac: <filter>
Drives:
  Local Storage: total: 2.29 TiB used: 435.71 GiB (18.6%)
  SMART Message: Unable to run smartctl. Root privileges required.
  ID-1: /dev/nvme0n1 maj-min: 259:0 vendor: Gigabyte model: GP-GSM2NE3512GNTD size: 476.94 GiB
    block-size: physical: 512 B logical: 512 B speed: 31.6 Gb/s lanes: 4 type: SSD serial: <filter>
    rev: EDFMB0.5 temp: 32.9 C scheme: GPT
  ID-2: /dev/sda maj-min: 8:0 vendor: Samsung model: SSD 840 EVO 1TB size: 931.51 GiB block-size:
    physical: 512 B logical: 512 B speed: 6.0 Gb/s type: SSD serial: <filter> rev: CB6Q scheme: GPT
  ID-3: /dev/sdb maj-min: 8:16 vendor: Samsung model: SSD 850 EVO 500GB size: 465.76 GiB
    block-size: physical: 512 B logical: 512 B speed: 6.0 Gb/s type: SSD serial: <filter> rev: 2B6Q
    scheme: MBR
  ID-4: /dev/sdc maj-min: 8:32 vendor: Samsung model: SSD 870 EVO 500GB size: 465.76 GiB
    block-size: physical: 512 B logical: 512 B speed: 6.0 Gb/s type: SSD serial: <filter> rev: 1B6Q
    scheme: GPT
Partition:
  ID-1: / raw-size: 147 GiB size: 143.63 GiB (97.71%) used: 15.76 GiB (11.0%) fs: ext4
    dev: /dev/nvme0n1p6 maj-min: 259:6
  ID-2: /boot/efi raw-size: 500 MiB size: 499 MiB (99.80%) used: 292 KiB (0.1%) fs: vfat
    dev: /dev/nvme0n1p5 maj-min: 259:5
Swap:
  Kernel: swappiness: 15 (default 60) cache-pressure: 100 (default)
  ID-1: swap-1 type: file size: 5 GiB used: 0 KiB (0.0%) priority: -2 file: /swap/swap
Sensors:
  System Temperatures: cpu: 34.0 C mobo: N/A gpu: nouveau temp: 52.0 C
  Fan Speeds (RPM): N/A gpu: nouveau fan: 0
Repos:
  Packages: pm: dpkg pkgs: 2572 libs: 1374 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/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/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: 229 Uptime: 21m wakeups: 3 Memory: 23.32 GiB used: 2.34 GiB (10.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

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

Re: Cant write or delete on newly attached drive in KDE-Plasma

#2 Post by m_pav »

What you explained has nothing to do with the difference between the types of Desktop environments, we need to go deeper, and it's a thousand times simpler than you would expect.

Drives and partitions formatted using a native Linux type filesystem will always inherit the permissions of the parent folder they are mounted into, and for USB drives, this will typically be the /media folder which is owned by root.

If you only ever have 1 user account, permissions become drop dead easy. Simply mount a drive, then change the permissions of the hidden dot file at the root of the partition, and to do this, you must use a terminal prompt. This is of course best done when a partition has just been created because thereafter all files created in the partition will inherit the same permissions as that of the dot file.

Let's say your partition label is USB-HDD. When mounted, its mount point will become /media/USB-HDD, and we'll pretend your account name is "yourname"

To change the permissions of the dot file, you open a terminal and issue the command as below.

Code: Select all

sudo chown yourname:yourname /media/USB-HDD/.
Notice the trailing dot in the command above? That's the magic of the terminal, hidden things that have so much influence can be modified with the greatest of ease.
Do this from now on when you introduce a new empty drive/partition and you'll have a superb experience with Linux formatted removable storage media on Debian based machines with a single user account only, given the single user is the "first" user account created on that machine.

NOTE, remember how I said "IF you only ever have 1 user account"? When logged into a single user account Debian based system, the first user will be assigned a UID (User ID) numeric value of 1000.
The partition with the dot file assigned to UID 1000 will be full R/W on any number of Debian type systems which assign the first user account the numerical value of 1000 without limits, irrespective of their user name, which also means the demo user in our live system will have the same rights as your own.

Now if the partition already contains content created by other users with differing numerical UIDs, then the folders and content created with the different UID will not be R/W.

If you want to change that, another command will do that for you, but, you must determine for yourself if this is something you want to do. The following command will change the permissions for everything on that partition to yourname

Code: Select all

sudo chown -R yourname:yourname /media/USB-HDD/*
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

User avatar
operadude
Posts: 849
Joined: Tue Nov 05, 2019 12:08 am

Re: Cant write or delete on newly attached drive in KDE-Plasma

#3 Post by operadude »

@m_pav

Just wanted to thank you for this clear and concise explanation!

I have had this issue in the past, and you have made the solution clear, at least to me.

:happy:

Wal
Posts: 39
Joined: Tue Mar 22, 2022 12:34 am

Re: Cant write or delete on newly attached drive in KDE-Plasma

#4 Post by Wal »

Yes, avery excellent explanation! Thank you!
However, my situation might be more complicated (to me and for the time being anyway) since; the drives are NTFS-formatted ssd-disks sitting in a dual-boot machine (win10). NTFS because I need some of the files for windows-specific things. I have reinstalled mx with XFCE many times and just used :su Thunar and then given the new user r/w permissions direct in Thunar. No problems at all. Now i tried the same thing and Dolphin says Im the owner but I still cant write anything to thoose disks, neither delete. Could it have something to do with the fact that I named the new user the same username as the old?

Wal
Posts: 39
Joined: Tue Mar 22, 2022 12:34 am

Re: Cant write or delete on newly attached drive in KDE-Plasma

#5 Post by Wal »

Ok, I tried to see if Thunar would show the same thing as Dolphin and it did. Im the owner but still cant write to them.

User avatar
DukeComposed
Posts: 1315
Joined: Thu Mar 16, 2023 1:57 pm

Re: Cant write or delete on newly attached drive in KDE-Plasma

#6 Post by DukeComposed »

Wal wrote: Sun Sep 01, 2024 11:03 am Ok, I tried to see if Thunar would show the same thing as Dolphin and it did. Im the owner but still cant write to them.
And what does ls -la say about it?

User avatar
Eadwine Rose
Administrator
Posts: 14470
Joined: Wed Jul 12, 2006 2:10 am

Re: Cant write or delete on newly attached drive in KDE-Plasma

#7 Post by Eadwine Rose »

Please post code on the forum like this:

[code]output here[/code]

Thanks. :)
MX-23.6_x64 July 31 2023 * 6.1.0-34amd64 ext4 Xfce 4.20.0 * 8-core AMD Ryzen 7 2700
Asus TUF B450-Plus Gaming UEFI * Asus GTX 1050 Ti Nvidia 535.216.01 * 2x16Gb DDR4 2666 Kingston HyperX Predator
Samsung 870EVO * Samsung S24D330 & P2250 * HP Envy 5030

Wal
Posts: 39
Joined: Tue Mar 22, 2022 12:34 am

Re: Cant write or delete on newly attached drive in KDE-Plasma

#8 Post by Wal »

Code: Select all

wal@snabbis:/media/wal/Winlager 500Gb
$ ls -la
total 8653133
drwxrwxrwx 1 wal wal 8192 Sep 1 02:16 .
drwxr-x---+ 3 root root 4096 Sep 1 17:29 ..
drwxrwxrwx 1 wal wal 0 Feb 21 2024 '$RE
-rwxrwxrwx 1 wal wal 112 Apr 5 13:27 bo
drwxrwxrwx 1 wal wal 8192 Sep 1 02:16 Do
drwxrwxrwx 1 wal wal 49152 Sep 1 00:36 Do
drwxrwxrwx 1 wal wal 196608 May 11 08:51 'ELEKTRONIK
drwxrwxrwx 1 wal wal 4096 Feb 23 2024
drwxrwxrwx 1 wal wal 4096 Sep 1 02:16 IS
-rwxrwxrwx 1 wal wal 21308664 Feb 13 2023 Lain.de
drwxrwxrwx 1 wal wal 4096 Feb 21 2024 Lin
drwxrwxrwx 1 wal wal 20480 Aug 31 23:47 M
-rwxrwxrwx 1 wal wal 1818230784 Jul 18 21:43 MX-23.
-rwxrwxrwx 1 wal wal 2727346176 Jul 18 17:22 MX-2
drwxrwxrwx 1 wal wal 4096 Aug 31 23:47 Pale
drwxrwxrwx 1 wal wal 516096 Sep 1 02:16 PI
-rwxrwxrwx 1 wal wal 2332033024 Jul 15 02:59 soly
-rwxrwxrwx 1 wal wal 1961017344 Jul 15 02:59 solydx_
drwxrwxrwx 1 wal wal 4096 Mar 31 17:13 'Syste
drwxrwxrwx 1 wal wal 0 Sep 1 02:16 'Te
drwxrwxrwx 1 wal wal 4096 Sep 1 02:16 The
drwxrwxrwx 1 wal wal 0 Mar 20 20:48 .Trash
drwxrwxrwx 1 wal wal 28672 May 5 2023 'Vat
drwxrwxrwx 1 wal wal 4096 Sep 1 02:16 Vi
drwxrwxrwx 1 wal wal 8192 Sep 1 00:09 ZZ
wal@snabbis:/media/wal/Winlager 500Gb
$

User avatar
Kermit the Frog
Posts: 626
Joined: Mon Jul 08, 2024 8:52 am

Re: Cant write or delete on newly attached drive in KDE-Plasma

#9 Post by Kermit the Frog »

Wal wrote: Sun Sep 01, 2024 10:51 am... NTFS-formatted ssd-disks sitting in a dual-boot machine (win10) ...
You "have to" disable "Fast Startup" in Windows. (Cause it keeps devices engaged, especially the ntfs partitions).

Wal
Posts: 39
Joined: Tue Mar 22, 2022 12:34 am

Re: Cant write or delete on newly attached drive in KDE-Plasma

#10 Post by Wal »

I solved it myself. I suddenly remembered that if you close Win10 with some drives, folders or files open in "filemanager" or what its called, Win10 somehow locks them. Easy fix, just booted Win10, opened all drives closed them again and rebooted MX. Voila! It works again as it should. Sorry for takingh your time!

Post Reply

Return to “MX Help”