PDA

View Full Version : lilo do not want to write in hda..



lilliput
04-09-2003, 01:19 PM
So just explain siince the beginning .. I had install knoppix 3.1 on my hd .. working well no problem with my lilo (that change some option and re run without any kind of pb..)
But following a power pb (even witth reiserfs) I had to restore my partition table with gpart (because even with the live cd I couldn't access at any type of partition even ntfs or fat !!) so this big problem solve just reboot and I see that lilo wasn't any more here ..
(say no pb nothing very hard now ..!)

So i boot with the live cd
and write as usual
#sudo su
#mount /dev/hda3 /mnt/hda3 {my / partition in reiserfs}
#chroot /mnt/hda3
#lilo-v

But here i had this error

bash-2.05b# lilo -v
LILO version 22.4.1, Copyright (C) 1992-1998 Werner Almesberger
Development beyond version 21 Copyright (C) 1999-2002 John Coffman
Released 27-Jan-2003 and compiled at 09:45:24 on Feb 27 2003.

Reading boot sector from /dev/hda
Fatal: open /dev/hda: Permission denied

so I just check if my bios was protecting my mbr against some virus
(I have win so can be useful to activated sometimes) but wasn't activat..
so i look after some doc on the man page and see the
install-mbr /dev/hda
we look like to work
(I've seen the "mbr" print on my screen after it and always boot on win .. ;-( )
so I just try again lilo and nothing different .. Grrrr

so here a part of my lilo.conf
################################
vga=791
lba32
boot=/dev/hda
root=/dev/hda3
install=/boot/boot-menu.b
map=/boot/map
prompt
timeout=150

append="hda=scsi hdb=scsi hdc=scsi hdd=scsi hde=scsi hdf=scsi hdg=scsi hdh=scsi nomce"

default=Linux
image=/boot/vmlinuz-2.4.20-xfs
label=Linux
initrd=/boot/initrd.gz
read-only

image=/vmlinuz.old
label=LinuxOLD
read-only
optional
other=/dev/hda1
label="WinXP"


all point of view or comment .. are welcome ..

lilliput
04-15-2003, 04:43 PM
I think i have an idea but do not know how to do !!

when i use the gpart to get back my partitions he had probably rewrite my mbr and change my mbr size so it look like some old system when you want to have a graphique lilo and you haven't the size to write it..

any kind of idea is welcome

Bl4ckm0r3
04-18-2003, 02:43 AM
I've encountered a similiar problem...I solved it using install-mbr, i think that the installation script doesnt work well in some cases(expecially those envolved with the mbr) try that command ( i think it Was install-mbr or something like that).
That's all...let me know if it worked.
Marco

jwilds73
04-20-2003, 08:28 PM
I am having a similar problem now I tried installing Lilo (when I installed the whole thing to my HD) and it didnt work. I'm really new to linux so I have no idea what to do. However I know to ctrl+alt+f1 to go to the terminal and I input "install-mbr --help" to get all the info from here though I'm at a lose. To describe what is happening if I don't have my floppy in it says "L 40 40 40 and just keeps repeating the 40 indefinetly untill I reset it and put the floppy in then it will boot all the way in.

Jwilds

ktheking
04-20-2003, 10:56 PM
be sure you've mounted the partition (where lilo.conf is situated) as root before performing lilo.
mount /dev/hdxx /mnt/hdxx -o uid=root,gid=root

where xx is disk- and partionreference (a1,a2,b1,.;)

greetzzz

xavier
07-22-2003, 09:42 PM
Hello

I have the same

Fatal: open /dev/hda: Permission denied

when I'm trying to run lilo. Let me explain the situation.

- I successfully install knx(3.2) with knx-hdinstall (btw, very effective !)
- failed to reboot, because knx hasn't followed (or asked) for some boot
parameters (in my case, ide0=ata66, ide1=ata66 otherwise boot jam !)
- rebooting on the live-cd, mounting hdaX rw, adding the correct append
line.
- sudo chroot /mnt/hdaX, still ok.
- lilo -v ... and Fatal: open /dev/hda: Permission denied
- tried the proposed install-mbr (don't know why it should change smth, but
as I'm not sure, I try), ok, then again same output of lilo.

So, the question is, within the live-cd, how to rewrite the mbr ?

Thanks

xavier
07-22-2003, 10:31 PM
happily, i found a solution.

Here it is for the sake of completness.

The problem is that chrooting to /mnt/hdaX isolate the pseudo-root, the dev and the proc are not those from the "orignal" working Linux. So obviously lilo won't be able to change the /dev he can't access. So the opposite must be done: bringing on "/" all we need to run the live-cd lilo fct with the lilo.conf config file we want. Note that mine, already located in hdaX, use /vmlinuz and /boot. In the live-cd:


cd /

rm -f /boot
rm -f /etc/lilo.conf
rm -f /vmlinuz

# easy bc knx added a line in fstab
mount /mnt/hdaX

rm -s /mnt/hdaX/boot /boot
rm -s /mnt/hdaX/etc/lilo.conf /etc/lilo.conf
rm -s /mnt/hdaX/vmlinuz /vmlinuz

# this one works.
lilo -v


That was just that. :wq

Perky_Goth
07-27-2003, 02:29 AM
thanks, i forgot it was :wq

anyway, i just picked up mandrake, installed a minimum system, and setup lilo from there.
quite a silly error... i had an instinct on why it was happening, but no knowledge to get there. nice work.

oh wait... those 3 last rm are ln. glad i noticed :D

emitter
07-28-2003, 11:59 AM
Your trick really saved me a lot of work. My boot drive needed a good low-level format and after restorig all data, I spent almost 2 days figuring out how to run lilo.

And since I switched to reiserfs (which I really like), none of those so-called resque-CD's would mount my partitions. By the time I found your workaround, I was reformating my swap partition to an ext2 file system in order to boot that :-)

However, I'm still wondering why "lilo -r ... " dosen't work, since I had my "/dev" in the new root and the majors and minors of the hard disk were the same.

tx
08-19-2003, 05:50 PM
# mount -o dev /dev/hda1 /mnt/hda1; chroot /mnt/hda1
# lilo -v


The key is the -o dev option to mount.

--
.-tx