Re: How to edit a read-only file



Jay <jasonanderson042@xxxxxxxxxxxxxxxxxx> wrote:
> I'm trying to boot the latest debian on an acer travelmate laptop. When booting,
> it hangs at hw_random. From google-grouping, a suggestion to add "hw_random" to
> /etx/hotplug/blacklist looks promising so I booted a Knoppix 4 and tried to edit
> that file. I'm just a beginner and can't get by an error dialog "The document
> could not be saved..... Check that you write access to this file or that enough
> disk space is available.

Well, do so. Tell us what the state is.

> I've done right click on desktop icon to add write permissions to the drive.

Eh? "Right click"? What's that? You're not using a mouse and gui, are
you?

> I've also spent time working chmod and chown from a console within root and
> within the directory.

And?

> I managed to save a copy of the file to the desktop so I
> can save items, I just can't edit and save the file at it's appropriate location
> so that the boot can be re-tested.

Why not? Is the partition mounted read only? Or is the FS fubarred? Or
are you not root?

> Owner has read and write access to that text file. How can I become owner?

I don't understand what you mean - any way you like, but why should
you? You are root, no? What have the perms to do with anything? Why
do you think they have anything to do with it?

It seems to me you are woefully confused. Answer these qwuestions:

1) are you working as root?
2) is the FS mounted read-write?
3) is the FS full?
4) is the FS damaged?
5) is the file protected by chattr +i?

If you are working as root (1), the fs is mounted readwrite (2), and
you cannot delete and recreate the file, then the fs is (4) damaged or
(3) full or the file is protected by chattr (5). So tell us which it
is.

And please unconfuse yourself!

If I were you I would run


sudo mount -wno remount /themnt
sudo cp foo /themnt/etc/bar

And tell us about it. You might like to try before that


sudo umount /themnt && sudo fsck -y /dev/hdaWhatever
sudo mount -w /dev/hdaWhatever /themnt

And please do not use a gui - work from a prompt. You need to see what
you are doing, not some gui's febrile imagination.

Peter



.



Relevant Pages

  • Re: Who sets /dev/snd/* owners/perms upon login?
    ... change - they're permanently at 0660, owner root:root - and yet I can play sound from a ssh session as a common user. ... User gabi then becomes able to play sound with aplay, but ONLY from that console; if I log in as gabi from ssh -- even while the same user is logged in from the console -- gabi at ssh can't play and gabi at console can!!! ... # owner: root ...
    (Fedora)
  • Change Permissions on a new hard drive to allow write...Problem Solved
    ... Then I right clicked on the drive, selected "Properties" then "Permissions" and simply checked the boxes for "write" for Owner, Group, and Others. ... I really don't understand why so many people think that logging in as root when needed is such a bad thing, although I can certainly see a better way to accomplish what I needed to do. ... See my other post "Vote for new Ubuntu Feature---Let's try it again". ...
    (Ubuntu)
  • Re: [opensuse] Is ntfs-3g safe?
    ... bring up Konqueror and look. ... Owner and group are still root. ... now I can drag files from my linux account to ...
    (SuSE)
  • Re: owner of dir/files
    ... the file owner. ... Apache runs as user www, so www must be able to read ... Then only root will be able to gain the user mode, ... wheel group will be able to gain the group mode. ...
    (freebsd-questions)
  • Re: Permissions to /dev/cdrom, /dev/dsp etc. problem
    ... even though gus on pts/0 is suppossed to be the owner of those files ... The owner group for those files is root as well and even if it wasn't ... > /dev/dsp is probably group audio, so just stick yourself into the audio ...
    (comp.os.linux.security)