This forum has been archived. All content is frozen. Please use KDE Discuss instead.

New Internal Partition: I need write permission

Tags: None
(comma "," separated)
User avatar
ianp5a
Registered Member
Posts
64
Karma
0
Hi. I have just created a new partition on my internal SSD using KDE Partition Manager. But I cannot write files to it in Dolphin which says I do not have permission. In Dolphin Right-Click-Properties-Permissions is set to root. And the fields are greyed out and can't be changed.
Is there any easy GUI way for normal users to fix this?
Or is there a better way to create a partition so that I can use it with the right permissions right away?
thanks
User avatar
Mamarok
Manager
Posts
6071
Karma
16
OS
What kind of partition did you create, which file system?


Running Kubuntu 22.10 with Plasma 5.26.3, Frameworks 5.100.0, Qt 5.15.6, kernel 5.19.0-23 on Ryzen 5 4600H, AMD Renoir, X11
FWIW: it's always useful to state the exact Plasma version (+ distribution) when asking questions, makes it easier to help ...
User avatar
ianp5a
Registered Member
Posts
64
Karma
0
Primary, EXT4 , not LUKS encryped. On Kubuntu 20.10
But I'd be happy to wipe it and do it some other way if it helped.
User avatar
claydoh
Registered Member
Posts
1170
Karma
9
OS
Once you have created an ext4 file system, it needs to have non-root permissions set, either in the mounting or of the directories created on it. This is true of most Linux file systems, afaik.

One quick and simpler way:
https://itsfoss.com/set-write-permissio ... ntu-linux/
If you intend to have this mounted as a particular directory (such as /home) you can do this via creating a line in your /etc/fstab file for it, and creating the directory if needed. But the above works well for most cases. You can easily find the path by clicking on the drive in Dolphin's side bar, then click on the address area above the directory window to reveal the full path needed to set the permissions. This is less confusing and is often more clear than using the blkid command.

fat32 or exfat file systems, such as found on flash drives and older Windows installs, don't have permissions functionality, so you would not get this error. But they are not anywhere near as robust as ext4 or NTFS

Windows NTFS does have permissions capabilities, but they are not enabled out of the box, or at least in Linux when I create them. This is a good option if you need to use a directory in both Windows and Linux


claydoh, proud to be a member of KDE forums since 2008-Oct, and KDE user since 2001
User avatar
ianp5a
Registered Member
Posts
64
Karma
0
Thanks but I'm looking for a solution for non IT experienced users. I'm worried a long series of hacks is going to scare people off of using KDE.
It turns out that where Dolphin fails, the Krusader program can change the permissions using Right click ->Properties.
I also understand the Gnome Disks program can create the partition with the user permissions already set. But this really needs a fix, as normal users can manage most other things easily in Plasma.

Last edited by ianp5a on Tue Mar 23, 2021 5:56 am, edited 1 time in total.
User avatar
ianp5a
Registered Member
Posts
64
Karma
0
This problem seems to be a known bug:
https://bugs.kde.org/show_bug.cgi?id=407192
darklovenonservium
Registered Member
Posts
1
Karma
0
So i know this is really old and the bug is listed above with guidance however. While searching for a very unlikely solution to my screw up where i "chown"ed my entire filesystem which effectivly set me way out of orderwith uid n gids of the files on my harddrive. To make maters worse before i thought i would go ahead and try to complete what i started. Not realizing what a horribke mistake I just made i unmounted several partitions all but root...compleyed my task sucessfully...so i thought. I was trying to add an outside partitiin and expand my home n root. Anyways i did finally succeed in that using kde part manager. However on next boot or rhather i shoukd say as soon as i trued to run any other commands i realized how horrendous this is. Not willing to give up on my precious files i spent the weekend sapping back and forth frpm vt to vt and finally managed to get it up and running. Tge biggest clue was apt and dbus message errirs as well as a few others that explicitly mention the uid and gid. Aparently it is bot enought to just change obe at a time even on comand line as root. Also it seems kde has a way of protecting base files even rewriting new ones on a app to app basis as long as it has the right permisions. So i started with an older pc one that still had thw same base os and managed to replace the sudo executable...fron there it got easier and finally i have the meticukous taskdone. While doijng so i discovered the s uid and gid bit documentation which ordinariky chmod can set on comand line.. But you can also set it in kde in alnost the same place you woukd chanfe the owner. So to start you need to be an administrator on your system which i assume you are and using Dolphin you can open and navigate to your files and this is the only comand part that youll have to do and ots super easy. And only neccessary if your not already set as an "OWNER N EDIT" AT least. If you are skip this and go to step two. If bit tyoe in F4 or it may be fn F4 if your set up to use the toop row of keys instead of F1-12 keys. Eitger way Dolphin will open a small embed comand line. Additionally you can use any terminal and do the same bit this is as clise as i coukd get to full gui sollution. Youlk type in. This

Sudo chown "your user or desired owners user name" ./*

Enter your password if prompted. Fier example mine was

sudo chown dark ./*
Note this is much different then rhe same command

sudo chown dark ./ -R which traverses recursively into sub folders . if you are 100 percent positive to can safely do that i suggest adding " --from "username""and or the "--preserve-root" option. My mistake was running
sudo chown dark -R --dereference -HL . /* thinking that my prevous solution of linking the outside partiition to my home directory would buy me some maintanance free solutiin to the soace problem...it did not and due ti the --no dereference option in traversed the entire drive severak times over follwing every refeferene to the actual files and so on...dont do that.

Ok so i know this was long winded but one more thing to mention. You can also adhust a files groups this way and save some trouble later if you need persay more than just you or root access tge files and you can also interchange usr ids with isernames and the same with groups i.e

sudo chown dark:guest ./* is the same in my case as
sudo chown 1000:1002 ./* or sudo chown 1000:guest
The * is a regex modifier for all directory contents and the . in front of the / in "./*" is the same as typing
sudo chown dark file1
sudo chown dark file2 , file3
sudo chown dark file1 & or && sudo chown dark file2 etc...
And only the files and folders in the curent directory or the 'pwd" will be altered. If you followed from step one to now dokphin will have automatically changed your directory to the matching on screen gui directory...

If you differed then use cd to change to your desired location and pwd to make sure your in the right spot. Also ls could help make sure your modifing the right files and hekp determin current rights abd or if there are linked files that may deter you from the deference comand. So

cd /your/desired/location/
pwd shoukd match /your/desired/location/
and ls -alsh ./* will give you output like
root dark rwx rw - filename 5 Mb /your/files/location
dark guest rwx rwx --x filename 2 4B /your/files/location
Etc.

Ok now that you have done step one which is if you followed from Dolphin is as easy as
1 open dolphin press f4 and type
sudo chown user:group ./*
You can now right ckick on the file or folder one at a time works best and click the advanced buttion on the permisions tab. There you can add users griups and chnage the uid guid and sticky. Bit settings and if its a folder you can apply it in subdirectories. Beliw those check boxes youll see a grid of permissions for users and to the right of them menu buttons to add remove groups and users...make sure to click inside the seemingly unclickable grid and select the checkmarks you desire per user or group and this will get you the desired results your needing.

I should note that for whatever reason running theese comands in terminal as sudo not a root shell dies not set the gid or uid bits matching the owner or login name. But tge gui ootion here lets any admin user adjust it. If you make a mistake...trust me when i tell you ked will let you know and definitely do not midify the perms on any system files as any othe user besides the currentlt owning user or yiy will be stuck like i was unabke ti even run a susdo comand oe even login in some cases.

Good luck and to aave the settings ckick apply and your good to close the windows or embeded terminal after you conplete steps 1 and or steps 2.

Best
Rick


Bookmarks



Who is online

Registered users: bartoloni, Bing [Bot], Google [Bot], Sogou [Bot], Yahoo [Bot]