Re: How to edit a read-only file



On Tue, 3 Jan 2006 23:25:36 +0100, "Peter T. Breuer" <ptb@xxxxxxxxxxxxxxx>
wrote:

<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.

Peter, this is a difficult posting for a NuBe! I think you are referring to read
only as compared to read-write.

<> 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?

Both gui and console. The goal of this exercise is just to add a single line to
a text file. I can't boot the debian 3.1 distro but it hangs. To edit this file,
I booted the laptop w knoppix cd 4.0.2 I've been learning the console today. So
I am using the console and met an old friend today ed(lin) although this one
didn't behave quite the way I remembered.

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

I didn't want to write paragraphs on the first shot. I don't want any potential
responders nodding off before they post ;-)

<> 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?

The partition is read-write. I have copied a file, written, to desktop and
copied a file to blacklist.d I can't write to mnt/hda4/etc/hotplug

I don't know how to determine who I am. I can't identify who is root or how to
become it. I'm trying to get that down now. Made another post asking for help in
that area. Need an example.

<> 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?

The file properties allow owner to have write access to the doc-file I crave.
Users and others don't can't modify. I don't understand root yet. I'm using
perms as synonym to ability to modify.

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

< 1) are you working as root?

Don't know.
< 2) is the FS mounted read-write?

Yes. read-write. Have done writes. Have been denied.
< 3) is the FS full?

28Gb partition( 1/2 of a dual boot) w a hanging debian 3.1 distro only. Gots to
have room.
< 4) is the FS damaged?
No. Done writes.
< 5) is the file protected by chattr +i?
I can't run lsattr in the hotplug directory. So I don't know for sure. Is the
immutable property indicated any other way than lsattr? Is that info shown by ls
-al? Can I get the info from chattr? If yes can I get an eg?

<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.

Instead of deleting, I tried to save as, or otherwise, ctrl+c - ctrl+v, make a
copy, but I can't write to the hotplug directory. I don't want to delete the
file. Even though I somehow managed to make a copy to blacklist.d,... I just
want to del it as a test.

Thanks for responding. Maybe the file is immutable. I hope to be able to
determine that, but suspect it's not because to make this particular edit, to
add to the blacklist on a hanging installation, is probably a common thing? NO?

<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
I'm looking up the commands now. thanks for your time!

-jay.
.



Relevant Pages

  • Re: Waiting for root file system... ...
    ... I am trying to make a smooth transition fom windows to Debian in my work PC. ... I am only able to boot Windows. ... wrong place to mount the root file system. ...
    (Debian-User)
  • Re: 3 OS on 2 Hard Disks and Grub
    ... > root fs ". ... I don't understand, because with the debian boot disk, the system ... Regardless of you changing root drives, ...
    (linux.redhat.install)
  • Re: Root Mail was Fwd: Re: Postfix, Mutt And No Root Mail?
    ... My experience with Debian was just opposite. ... console, once I signed in as user, then I got a ... message "You have mail" and mutt would read it. ... logged in as root or did a su after login, ...
    (Ubuntu)
  • Kernel Panic: VFS: Unable to mount root fs on unknown-block(0,0)
    ... I installed debian SARGE with grub and everything works fine. ... I downloaded the latest stable kernel, ... Root ... When i reboot my system i can choose to boot the debian2.6.5 but in the ...
    (Debian-User)
  • Re: Login Restrictions / Trusted System
    ... by creating a /etc/securettyfile that doesn't contain "console". ... Then root ... it is boot the maintenace disk and see if you can hack the password files. ...
    (comp.sys.hp.hpux)