LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 11-20-2008, 01:47 PM   #1
OmegaPsi
LQ Newbie
 
Registered: Nov 2008
Posts: 1

Rep: Reputation: 0
Removing hda Write-protection


So I'm currently in the process of dual-booting windowsXP and Linux[Backtrack Distro], and I've hit a problem with my LILO.conf file.
My LILO.conf looks like this:

# LILO configuration file
# generated by 'liloconfig'
#
# Start LILO global section
lba32 # Allow booting past 1024th cylinder with a recent BIOS
boot = /dev/hda
prompt
timeout = 12
change-rules
reset
vga = 0x317
# End LILO global section

# Linux bootable partition config begins
image = /boot/vmlinuz
root = /dev/hda4
label = Linux
read-only
# Linux bootable partition config ends

#Windows boot
other=/dev/hda1
label=Windows
table=/dev/hda1
#Windows end





When I try to execute it after I've edited it, it gives me this message:

Reading boot sector from /dev/hda
"fatal: creat /boot/map~: Read Only File"

Now I also noticed while I was doing my partitions it gave me a similar error.

[Shown with my partition table]

(parted) print list,all
Model: MAXTOR 6L020L1 (ide)
Disk /dev/hda: 20.5GB
Sector size (logical/physical): 512B/512B
Partition Table: msdos

Number Start End Size Type File system Flags
1 32.3kB 10.5GB 10.5GB primary ntfs boot
2 10.5GB 10.6GB 65.8MB primary ext2
3 10.6GB 11.6GB 1020MB primary linux-swap(new)
4 11.6GB 20.5GB 8974MB primary reiserfs


Warning: Unable to open /dev/hdc read-write (Read-only file system). /dev/hdc has been opened
read-only.
Error: Unable to open /dev/hdc - unrecognised disk label.

Error: Unable to open /dev/md/0 - unrecognised disk label.

[Now I realize the /dev/hdc could be the disk drive, but it might be worth mentioning anyways. As a matter of fact I'm pretty confident it is.]

So I figured removing hda write-protection might work so any help would be greatly appreciated.

[Also as another side request, could anyone tell me how to switch the boot flag to partition 4, and how to simply just format a partition in parted?]

-OmegaPsi
 
Old 11-20-2008, 03:22 PM   #2
mjlouis
Member
 
Registered: Nov 2008
Posts: 48

Rep: Reputation: 16
Quote:
Originally Posted by OmegaPsi View Post
<snip>
# Linux bootable partition config begins
image = /boot/vmlinuz
root = /dev/hda4
label = Linux
read-only
# Linux bootable partition config ends
See that read-only line above? You can comment it out by putting a # in front of it.

Quote:
[Also as another side request, could anyone tell me how to switch the boot flag to partition 4, and how to simply just format a partition in parted?]
Setting the default boot is as ease as specifying the label in the global section of lilo.conf, for example:

Code:
Default=Linux
But please check the lilo man pages as it's been a long time since I last used it and I'm sure there are a few steps needed to update a lilo.conf!

If you want to format a partition, normally you would use mkfs (MaKe FileSystem) - see:
Code:
 man mkfs
That'll give you the instructions for whichever filesystem you want to place on the partition. If you want to change the type of filesystem, you'll need to set that with fdisk or cfdisk. Again, read the man page first and as always:

Make a backup of any data you'd hate to lose before you do anything else. This means both on Linux and Windows!
 
Old 11-20-2008, 03:40 PM   #3
Aleks`
LQ Newbie
 
Registered: Sep 2008
Posts: 19

Rep: Reputation: 0
When booting, hit "e" (I think "e" was in LiLo) and edit the boot line, so that you remove the read-only line and then boot it. After that re-edit your lilo conf file and comment it out
 
Old 11-20-2008, 04:07 PM   #4
onebuck
Moderator
 
Registered: Jan 2005
Location: Midwest USA, Central Illinois
Distribution: Slackware®
Posts: 12,603
Blog Entries: 25

Rep: Reputation: 1981Reputation: 1981Reputation: 1981Reputation: 1981Reputation: 1981Reputation: 1981Reputation: 1981Reputation: 1981Reputation: 1981Reputation: 1981Reputation: 1981
Hi,

You don't need to remove the 'read-only' from your 'lilo.conf' file. Your kernel mounts the filesytem initially as 'read-only' then 'read-write'. You should run 'lilo' as root from the cli whenever you make changes to the '/etc/lilo.conf' to update.

Code:
excerpt from 'man lilo.conf'
NAME
       lilo.conf - configuration file for lilo

DESCRIPTION
       This  file,  by  default /etc/lilo.conf, is read by the boot loader installer 'lilo'
       (see lilo(8)).

       It might look as follows:

              # lilo.conf
              #
              #  global options:
              boot=/dev/hda
              prompt
              timeout=150
              lba32
              compact
              vga=normal
              root=/dev/hda1
              read-only
              menu-title=" John's Computer "
              #
              #  bootable kernel images:
              image=/boot/zImage-1.5.99
                   label=try
              image=/boot/zImage-1.0.9
                   label=1.0.9
              image=/tamu/vmlinuz
                   label=tamu
                   initrd=initramdisk.img
                   root=/dev/hdb2
                   vga=ask
              #
              #  other operating systems:
              other=/dev/hda3
                   label=dos
                   boot-as=0x80    # must be C:
              other=/dev/hdb1
                   label=Win98
                   boot-as=0x80    # must be C:
              other=/dev/hdb5
                   label=os2
                   loader=os2_d
                   table=E:   # os2 sees as E:

       This configuration file specifies that lilo uses the Master Boot Record on /dev/hda.
       (For  a  discussion  of the various ways to use lilo, and the interaction with other
       operating systems, see user.tex from the lilo documentation.)

       When booting, the boot loader will issue its boot: prompt and wait for you to  enter
       the  label  of  the kernel (and any options) which you wish to boot. At any time you
       may hit [Tab] to see a list of kernel/other labels.  Alternately, if the  menu  boot
       loader  is  installed,  a menu of boot options will be presented for your selection.
       The title of this menu is overridden with the menu title specification in this  con-
       figuration  file.   If  you  enter nothing, then the default kernel image, the first
...

kernel options;

  read-only
              This specifies that the root file system should be mounted read-only.  It may
              be specified as a global option.  Typically, the system startup procedure re-
              mounts the root file system read-write later (e.g. after fsck'ing it).
You should 'man lilo' and 'man lilo.conf' to get a full understanding.
 
Old 11-20-2008, 04:13 PM   #5
onebuck
Moderator
 
Registered: Jan 2005
Location: Midwest USA, Central Illinois
Distribution: Slackware®
Posts: 12,603
Blog Entries: 25

Rep: Reputation: 1981Reputation: 1981Reputation: 1981Reputation: 1981Reputation: 1981Reputation: 1981Reputation: 1981Reputation: 1981Reputation: 1981Reputation: 1981Reputation: 1981
Hi,

You can do from the cli as root;

Code:
~#lilo -v -t-b /dev/hda         #this will test & now write to MB
~#lilo -v -b  /dev/hda          #this will write to the MBR of /dev/hda
Post any errors that you get.
I suggest that you place any long lists or data within the vbcode tags 'Quote or code'. The # sign at the top of the reply window for code and the Quote is to the left of the #. Makes your posts cleaner and easier to read when diagnosing.
 
Old 11-21-2008, 08:11 PM   #6
mjlouis
Member
 
Registered: Nov 2008
Posts: 48

Rep: Reputation: 16
Quote:
Originally Posted by onebuck View Post
Hi,

You don't need to remove the 'read-only' from your 'lilo.conf' file. Your kernel mounts the filesytem initially as 'read-only' then 'read-write'. You should run 'lilo' as root from the cli whenever you make changes to the '/etc/lilo.conf' to update.
Oh tits. You're quite correct; as I've said, it's been a while since lilo and I've done some more revising of stuff I'd forgotten and I'd like to retract my post as being complete arse (had to happen some time!).

Pardon me, I've got to go RTFM...AGAIN! :-)
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Samba Write Protection amajos Linux - Networking 1 08-11-2005 08:58 PM
write protection speed_viper Linux - Software 5 10-02-2004 01:10 AM
Write-protection in scripts Louis_Carole Linux From Scratch 1 09-03-2004 12:22 AM
Write protection question... floridagators1 Mandriva 5 05-22-2004 10:29 AM
Write Protection mfo6463 Linux - Newbie 5 03-31-2004 04:59 PM


All times are GMT -5. The time now is 08:50 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration