Read-only disc

Asked by peter

Hi

I tryed to edit the file /etc/sudoers as recomend in http://www.fs-security.com/docs/faq.php#trayicon (Giving the user permission to launch Firestarter without the root password).

But I can't save the file. I'll get the following message:

Could not save the file /etc/sudoers.
You are trying to save the file on a read-only disk. Please check that you typed the location correctly and try again.

What do I have to do to change the read-only disc to a writable disc? And what are the consequences?

Thanks.
Peter

Question information

Language:
English Edit question
Status:
Solved
For:
Ubuntu Edit question
Assignee:
No assignee Edit question
Solved by:
peter
Solved:
Last query:
Last reply:
Revision history for this message
peter (peter-neuweiler) said :
#1

And it's strange: if I click the right mouse button on the dir. /etc and choose Properties > Permissions, root will be able to create and delete files. And I'm logged in as root. But: it's a read-only disc.
Peter

Revision history for this message
kernowyon (kernowyon) said :
#2

Is this a live cd? That would be read-only.

If this is an installed Ubuntu, then try editing the file by prefacing the command with sudo

i.e
sudo nano /etc/sudoers <press enter>

( I used nano as the editor, but any other editor would work fine)

Revision history for this message
peter (peter-neuweiler) said :
#3

No, it's an installed system.

I tryed sudo gedit /etc/sudoers. But it doesn't work. In nano I can't save the file.
Peter

Revision history for this message
kernowyon (kernowyon) said :
#4

Ah - you need to use the visudo command according to the file itself.

For details on using visudo, the man page (man visudo) gives the basic syntax.

It will open a tmp file for you to edit, then save the changes - checking the syntax of your changes.

Revision history for this message
peter (peter-neuweiler) said :
#5

Hi kernowyon

Thanks for your hint.

I entered visudo and I got the file /etc/sudoers. But I can't save it. What do I have to do? Thanks!
Peter

Revision history for this message
peter (peter-neuweiler) said :
#6

visudo opens in a Termial. How can I modify the file /etc/sudoers? Thanks.
Peter

Revision history for this message
kernowyon (kernowyon) said :
#7

I expect visudo will use the standard Vi commands.

Revision history for this message
peter (peter-neuweiler) said :
#8

Yea, but also with vi I can't modify the file. It's not possible to enter text. What do I have to do? Thanks.
Peter

Revision history for this message
kernowyon (kernowyon) said :
#9

If I call the visudo command like this -

sudo visudo

I get nano opening with the sudoers file (suffixed with .tmp)ready for editing.

I haven't attempted to edit the file (I have no reason to do so and I don't want to mess), but it should be possible to edit the file as needed and then save it. If it has opened in nano, then saving is a simple case of Ctrl+x, then saying "yes" to the various questions (although you need to check the filename it wants to save the file as - make sure it is /etc/sudoers without the tmp I expect)

Revision history for this message
Philip Wyett (philwyett) said :
#10

The Ubuntu community docs on the subject.

https://help.ubuntu.com/community/Sudoers

Revision history for this message
peter (peter-neuweiler) said :
#11

The problem has solved. Thanks a lot.
Peter