Trying to modify /etc/fstab getting save error

So: you do have sudo access and have had it.

I consider the above a valid test. :wink:

The command:
groups
will tell you whether you are a member of group ā€œwheelā€
if you are - you have sudo access

[demo@manjaro ~]$ groups demo
wheel lp sys network power demo

is that the default in KDE?

Iā€™m in a few more (Xfce in a VM):

groups
sys network power video storage lp input audio wheel nachlese

but at least you are in wheel ā€¦ which we knew already :wink:

In other distros I have used sometime trying a new user might work and then I would know if it is a user problem.
Iā€™m new here. How do I create a new user? Is there a gui tool for making a new user?

I just checked my KDE machine:

groups
sys network power lp wheel nachlese

This is pretty much an untouched default installation.
So it seems everything is ok there.
Looks the same here as it does for you.

Besides:

To use a graphical tool to create a new user
you do need admin rights - the thing that doesnā€™t seem to work.
Kind of like a chicken and egg problem - or catch 22 :man_shrugging:

I created a new user in KDE Users . Made him administrator and tried the same thing.
Got the same result.

To do that, youā€™d have to have supplied your admin password at some point.
So that worked.

But the same thing doesnā€™t work when you try to edit a file and need to save it ā€¦
that is strange ā€¦ and Iā€™m positive that I donā€™t know where to even begin to look to investigate that.
:man_shrugging:

It worked at one time. I donā€™t know what I did to cause this problem.

:thinking: ā€¦ is /etc/fstab a symlink or otherwise locked or bound ?

ls -la /etc/fstab
[demo@manjaro ~]$ ls -la /etc/fstab
-rw-r--r-- 1 root root 816 Jan 22 10:12 /etc/fstab

To narrow it down a bit more - because your info on that was not very precise ā€¦
Please answer these questions:

Can you open the file via Dolphin in Kate as your editor?
yes/no

Can you edit the file?
yes/no

To test that
only add a new line to it which starts with #
like this:
# this is a test

The # (hash) at the beginning of the line is important.
It will not mess with the functionality of the file
as the # denotes that everything after it is considered a comment
This ensures that the file will still work after the edit.

Can you then save the altered file?
yes/no

When in that process does any error occur?

Also please tell exactly what the error message says!

What exactly is the error message?

Answers to the questions below:

To narrow it down a bit more - because your info on that was not very precise ā€¦
Please answer these questions:

Can you open the file via Dolphin in Kate as your editor?
yes

Can you edit the file?
yes

To test that
only add a new line to it which starts with #
like this:
# this is a test

The # (hash) at the beginning of the line is important.
It will not mess with the functionality of the file
as the # denotes that everything after it is considered a comment
This ensures that the file will still work after the edit.

Can you then save the altered file?
no

When in that process does any error occur?
As soon as I press Save I get the error.

Also please tell exactly what the error message says!

Error:
The Document could not be saved, as it was not possible to write to /etc/fstab.
Check that you have write access to this file or that enough disk space is available.
The original file may be lost or damaged. Donā€™t quit the application until the file is successfully written.

There is only an OK button available.

ok - thank you

There should have been a popup
asking for the admin password
in order to save the altered file.

Apparently you where not asked for that password.
And, because there was no admin access asked for and granted
the ā€œsave the fileā€ operation failed.

That seems to narrow it down to:
why is that "asking for admin permission for the action"
not triggered in that particular case?

ā€¦ but you where able to create a new user account earlier ā€¦
there must have been such a popup, asking for the admin password
to actually create a new user account
and it worked ā€¦

very selective ā€¦
new account: yes
save a root owned file: no

ā€¦

ā€¦ the message contained:

of course you do not have write access to the file - only after having been prompted for the admin password would you have had that write access
ā€¦ but that prompt did not happen ā€¦
Iā€™m going to assume that ā€œnot enough disk spaceā€ is not the actual problem here.

I know that it does work on my machine - I tested it in just the exact way I proposed here - and it worked.

I also know that I would never have noticed it not working (like you did)
because I would always have used the command line to make changes
instead of using Dolphin and Kate.

strange failure mode ā€¦

I wonder if it has to do with the version of kde I am on:

Operating System: Manjaro Linux
KDE Plasma Version: 5.24.80
KDE Frameworks Version: 5.91.0
Qt Version: 5.15.2
Kernel Version: 5.16.2-1-MANJARO (64-bit)
Graphics Platform: X11
Processors: 8 Ɨ IntelĀ® Coreā„¢ i7-10510U CPU @ 1.80GHz
Memory: 15.3 GiB of RAM
Graphics Processor: Mesa IntelĀ® UHD Graphics

How did you produce that data set in your post above?

I know that Iā€™m on ā€œstableā€
and I know that that is not the version Iā€™m running.
5.23.4-1 is what I have here ā€¦

In KDE System Settings there is a About screen and in that screen there is a copy to clipboard button.

yep - thanks

as I said:
Iā€™m on Manjaro stable
and my KDE Plasma Version isnā€™t 5.24.80 - (but 5.23.4)
and my KDE Frameworks Version isnā€™t 5.91.0 - (but 5.89.0)

You are not running the stable version.

1 Like

Right I know that but where would I look to see if this problem has to do with that?

I found this in the Manjaro wiki:

Editing files requiring privilege escalation
WarningNever use sudo to run a graphical text editor. This can have unintended consequences or break the permission to configuration files that should not be owned by root.

Many of the graphical text editors will automatically ask for privilege escalation when they detect that you cannot write to a file.

If they don't, you can save a copy of the file to your home folder and move it into place using sudo. For example, if you edit your fstab and then saved a copy to your home folder, you could then move it to the proper location with sudo:
user $ sudo mv ~/fstab /etc/fstab 

But it doesnā€™t tell him what to look for if this doesnā€™t work as described.