Page 1 of 1

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

Posted: Sat Aug 31, 2024 10:04 pm
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

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

Posted: Sat Aug 31, 2024 11:07 pm
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/*

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

Posted: Sun Sep 01, 2024 7:08 am
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:

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

Posted: Sun Sep 01, 2024 10:51 am
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?

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

Posted: Sun Sep 01, 2024 11:03 am
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.

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

Posted: Sun Sep 01, 2024 11:21 am
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?

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

Posted: Sun Sep 01, 2024 11:41 am
by Eadwine Rose
Please post code on the forum like this:

[code]output here[/code]

Thanks. :)

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

Posted: Sun Sep 01, 2024 11:44 am
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
$

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

Posted: Sun Sep 01, 2024 2:26 pm
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).

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

Posted: Sun Sep 01, 2024 3:19 pm
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!

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

Posted: Sun Sep 01, 2024 3:34 pm
by Eadwine Rose
Please click the checkmark of the post that holds the solution to mark the topic solved proper, so people will get guided to the solution, thanks :)

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

Posted: Sun Sep 01, 2024 8:28 pm
by m_pav
First thing I do when setting up a dual boot machine with Windows is to disable Fast Startup. Honestly, with a NVME SSD this setting is totally unnecessary and it is the exact reason for the issue you're experiencing, and I have found a SATA SSD to be much the same, only a little slower. With this setting disabled, it will make no difference if you have 10 folders open when you shutdown or exit, all "open handles" to the folders will be lost as the windows system shuts down, and it's those open handles that are causing you the problems.

On a professionally maintained Windows 10 system, even one that is 3-4 years old, the gains at startup are simply pushed to the opposite end as Windows compresses the contents of the open sessions into a hibernation file on the root of C:, with the only exception being crappy antivirus and/or security packages. I challenge anyone to prove me wrong because compression and writing to storage takes longer than reading and decompressing to RAM.

Follow the steps below in Windows to disable the setting.
1) Settings -> Power and Sleep Settings -> Additional Power Settings -> Chose what the Power buttons do -> Change settings that are currently unavailable -> Uncheck Fast Startup and reboot 2x to allow the cache to clear properly.

Some BIOSs' need to have their implementation of Fast Boot disabled too, but I generally disable that as well while disabling Secure Boot.

Furthermore I see you're using the stock Debian kernel, that is a benefit in your case because for the time being, the Debain kernel loads the ntfs-3g driver, not the Paragon ntfs3 driver, as do most other kernels like the Liquorix and Xanmod. The ntfs3 driver has more features and as such, it can read NTFS permissions, however, because Windows uses a different starting UID value for its user accounts, this will translate to a padlock indicator being displayed in all Windows user profile folders in C:\Users\<username> folders, even after a clean shutdown.

In such an instance, the KDE root actions servicemenu would suffice to give you the R/W permissions you desire, but for the sake of those that might visit this thread in the future who prefer to use the Liquorix or Xanmod kernels and do not wish to always operate as root on Windows filesystems, simply do the following and reboot.

Code: Select all

sudo rmmod ntfs3 && echo blacklist ntfs3 | sudo tee /etc/modprobe.d/blacklist-ntfs3.conf
--Edited to remove errors--

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

Posted: Tue Sep 03, 2024 3:40 pm
by Wal
Excellent explanation thanks!

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

Posted: Tue Sep 03, 2024 6:54 pm
by sunrat
m_pav wrote: Sun Sep 01, 2024 8:28 pmOn a professionally maintained Windows 10 system, even one that is 3-4 years old, the gains at startup are simply pushed to the opposite end as Windows compresses the contents of the open sessions into a hibernation file on the root of C:,
I tested this once. Fast Startup improved startup time by 2 seconds, but shutdown was 10 seconds longer! :snail:
Windows Fast Startup is snake oil.

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

Posted: Tue Sep 03, 2024 6:58 pm
by FullScale4Me
m_pav wrote: Sun Sep 01, 2024 8:28 pm Some BIOSs' need to have their implementation of Fast Boot disabled too, but I generally disable that as well while disabling Secure Boot.
A miss-named feature IMHO. It should be 'Fast Post' as it occurs before any boot-up commences.

There have been a few cases in this forum where the WiFi card was not initialized due to this being disabled. Oddly in some of those, it still worked fine in Winblows.

Fast Boot set to 'Enabled', 'Automatic', or 'Thorough' fixed those reported issues.

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

Posted: Fri Sep 06, 2024 5:25 am
by grelos
I am facing the same problem but I am not on dual boot with win. I am running Mx 23.3 with KDE and lately my non-system HDDs are mounted read-only. What is strange is that when I check permissions in Dolphin it says "user" and not "root" but in fact I cannot write on them.
The cumbersome workaround is to change permissions in Dolphin, log-out and log-in again. It seems these permissions are changed when I shutdown the system overnight.

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

Posted: Fri Sep 06, 2024 6:24 am
by Eadwine Rose
@grelos Please start your own thread.

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

Posted: Fri Sep 06, 2024 11:23 am
by Kermit the Frog
grelos wrote: Fri Sep 06, 2024 5:25 am... seems these permissions are changed when I shutdown the system overnight...
If it's ntfs the permissions / ownership won't be saved. So, when they're unmounted, mount them like this, manually:


i.e.

sudo mount /dev/sdc3 -t ntfs-3g -o permissions /media/yourusername/Somedirectory


... "Then" chown :

sudo chown -R yourusername:yourusername /media/yourusername/Somedirectory