LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Debian
User Name
Password
Debian This forum is for the discussion of Debian Linux.

Notices


Reply
  Search this Thread
Old 11-24-2004, 04:06 PM   #1
JohnKFisher
LQ Newbie
 
Registered: Nov 2004
Posts: 2

Rep: Reputation: 0
apt-get'd my kernel, now LILO gives an error.


Short version:

Code:
debian:/home/jkfisher# lilo
Fatal: open /initrd.img: No such file or directory
Long Version:


Hiya. Sorry for the probably newbie question. I used apt-get (actually wajig, but who's counting?) to update, incl. my kernel, which I've done many times before, but for the first time I've seen, LILO is throwing an error now, and I'm afraid to restart, in case it doesn't come back up.

Helpe moi, sil vous plait?

Code:
Preparing to replace kernel-image-2.6.8-1-686 2.6.8-5 (using .../kernel-image-2.6.8-1-686_2.6.8-9_i386.deb) ...
The directory /lib/modules/2.6.8-1-686 still exists. Continuing as directed.
Unpacking replacement kernel-image-2.6.8-1-686 ...
The link /initrd.img is a dangling link
Removing symbolic link /initrd.img 
Unless you used the optional flag in lilo,  you may need to re-run lilo
Code:
Setting up kernel-image-2.6.8-1-686 (2.6.8-9) ...

 You are attempting to install a kernel version that is the same as
 the version you are currently running (version 2.6.8-1-686). The modules
 list is quite likely to have been changed, and the modules dependency
 file /lib/modules/2.6.8-1-686/modules.dep needs to be re-built. It can
 not be built correctly right now, since the module list for the
 running kernel are likely to be different from the kernel installed.
 I am creating a new modules.dep file, but that may not be
 correct. It shall be regenerated correctly at next reboot.

 I repeat: you have to reboot in order for the modules file to be
 created correctly. Until you reboot, it may be impossible to load
 some modules. Reboot as soon as this install is finished (Do not
 reboot right now, since you may not be able to boot back up until
 installation is over, but boot immediately after). I can not stress
 that too much. You need to reboot soon.

Please Hit return to continue.  
Not touching initrd symlinks since we are being reinstalled (2.6.8-5)
Not updating image symbolic links since we are being updated (2.6.8-5)
A new kernel image has been installed, and usually that means  
that some action has to be taken to make sure that the new     
kernel image is used next time the machine boots. Usually,     
this entails running a ``bootloader'' like SILO, loadlin, LILO,
ELILO, QUIK, VMELILO, ZIPL, or booting from a floppy.   (Some  
boot loader, like grub, for example, do not need to be run on  
each new image install, so please ignore this if you are using 
such a boot loader).

A new kernel image has been installed at /boot/vmlinuz-2.6.8-1-686
 (Size: 1136kB)


 Initial rootdisk image: /boot/initrd.img-2.6.8-1-686 (Size: 4540kB)

Symbolic links, unless otherwise specified, can be found in /

LILO sets up your system to boot Linux directly from your hard
disk, without the need for booting from a boot floppy.


WARNING
If you are keeping another operating system or another version
of Linux on a separate disk partition, you should not have LILO
install a boot block now. Wait until you read the LILO documentation.
That is because installing a boot block now might make the other
system un-bootable. If you only want to run this version of Linux,
go ahead and install the boot block here. If it does not work, you
can still boot this system from a boot floppy.

You already have a LILO configuration in /etc/lilo.conf
Install a boot block using the existing /etc/lilo.conf? [Yes] 
Testing lilo.conf ... 
An error occurred while running lilo in test mode, a log is
available in /var/log/lilo_log.17311. Please edit /etc/lilo.conf
manually and re-run lilo, or make other arrangements to boot 
your machine. 
         Please hit return to continue
Code:
debian:/home/jkfisher# cat /var/log/lilo_log.17311
Fatal: open /initrd.img: No such file or directory

debian:/home/jkfisher# lilo
Fatal: open /initrd.img: No such file or directory
Thanks in advance

Last edited by JohnKFisher; 11-24-2004 at 04:11 PM.
 
Old 11-24-2004, 05:42 PM   #2
macondo
Senior Member
 
Registered: Jul 2003
Location: Central America
Distribution: Slackwre64-current Devuan
Posts: 1,034

Rep: Reputation: 62
"The link /initrd.img is a dangling link
Removing symbolic link /initrd.img
Unless you used the optional flag in lilo, you may need to re-run lilo"

Did you?

You don't say, so i speculate that you dist-upgraded from Woody. If so, did you do before and after the dist-ugrade:

#apt-get update
#apt-get dist-upgrade

sometimes it's necesary. I have never had a problem with installing a kernel-image with LILO or GRUB, (i prefer GRUB, but i chose XFS with the net installer, and only works with LILO) you might have answered a question wrongly. To play it safe, install 'synaptic' look for the new kernel, if it's there, delete it. (it should be under All or Installed.

Then get rid of LILO:

#dpkg --purge lilo
#apt-get clean

#apt-get update
#apt-get install grub
#grub-install /dev/hda (if you only have one hd)
#update-grub

Then start again:

#apt-get install kernel-image-<whatever>

there will be no questions, it will upgrade grub menu list automatically. At the end, at the prompt:

#reboot

and that's it.
 
Old 11-24-2004, 06:22 PM   #3
JohnKFisher
LQ Newbie
 
Registered: Nov 2004
Posts: 2

Original Poster
Rep: Reputation: 0
Thanks

Well, i still wish i knew what went wrong in the first place, but hey, grub is working fine, so thanks!
 
Old 12-07-2004, 11:50 AM   #4
xucaen
Member
 
Registered: Feb 2004
Location: Boston
Distribution: Kubuntu 22.04
Posts: 101

Rep: Reputation: 16
Hi, This same thing happened to me the other day. I casually did a dist-upgrade and everything went to HEC. I got the same messages that said rebooting would rebuild the module dependencies, but it didn't boot at all! The only difference with my scenario is that instead of it complaining about initrd.img, I got a message saying that root was invalid.
I've spent the last two days trying to rebuild my boot record and manually installing a new kernel image using several boot CD's that I've downloaded from the web but so far nothing has worked. I'm not sure what to do now.. I can't boot so I can't apt-get install grub or a new kernel image. Any tips that can help me?

I'm thinking of booting a cd, then monting /dev/hda1 (my boot partition), then I will have to mount all my other partitions.. I have several for home, proc, usr, etc.., then I can do a chroot to hda1 and maybe from there I can run apt-get. I haven't tried this yet, but I can't think of any other way to get apt-get to work. Does this sound like it might work?

Any suggestions would be greatly appreciated!
Thanks!

Jim




Quote:
Originally posted by macondo
"The link /initrd.img is a dangling link
Removing symbolic link /initrd.img
Unless you used the optional flag in lilo, you may need to re-run lilo"

Did you?

You don't say, so i speculate that you dist-upgraded from Woody. If so, did you do before and after the dist-ugrade:

#apt-get update
#apt-get dist-upgrade

sometimes it's necesary. I have never had a problem with installing a kernel-image with LILO or GRUB, (i prefer GRUB, but i chose XFS with the net installer, and only works with LILO) you might have answered a question wrongly. To play it safe, install 'synaptic' look for the new kernel, if it's there, delete it. (it should be under All or Installed.

Then get rid of LILO:

#dpkg --purge lilo
#apt-get clean

#apt-get update
#apt-get install grub
#grub-install /dev/hda (if you only have one hd)
#update-grub

Then start again:

#apt-get install kernel-image-<whatever>

there will be no questions, it will upgrade grub menu list automatically. At the end, at the prompt:

#reboot

and that's it.

Last edited by xucaen; 12-07-2004 at 12:03 PM.
 
Old 12-07-2004, 07:30 PM   #5
Draygo
Member
 
Registered: May 2004
Location: Frisco, TX
Distribution: Debian Unstable
Posts: 73

Rep: Reputation: 15
Had this happen to me too. For some reason the kernel install went borked. You can fix it really easily. Just recreate the /initrd.img link.

ln -s /boot/initrd.img-2.6.8-1-686 /initrd.img

after this rerun lilo

I the 2.6.8-1-686 kernel package was borked when made.
 
Old 12-07-2004, 10:29 PM   #6
xucaen
Member
 
Registered: Feb 2004
Location: Boston
Distribution: Kubuntu 22.04
Posts: 101

Rep: Reputation: 16
Quote:
Originally posted by Draygo
Had this happen to me too. For some reason the kernel install went borked. You can fix it really easily. Just recreate the /initrd.img link.

ln -s /boot/initrd.img-2.6.8-1-686 /initrd.img

after this rerun lilo

I the 2.6.8-1-686 kernel package was borked when made.
Thanks, now I get the kernel to boot.. but it panics.. error says

VFS: Cannot open root device "301" or unknown-block(3,1)
Please append a correct "root=" boot option
Kernel panic: VFS: Unable to mount root fs on unknown-block(3,1)

I have no idea what this means, but this is as close as I've come to getting this resolved.

in my lilo.conf, I have
boot=/dev/hda
root=/dev/hda1

I have run lilo, and I get my lilo boot menu (I have kernel-image-2.6.8-1-k7 as well as my old kernel-image-2.4.24-1-k6) both kernels give me the same panic, almost the exact message. The k6 message differs only slightly where the k7 says 'device "301" ' the k6 error says 'device "" '
it also has a different block() number..

jim
 
Old 12-08-2004, 09:57 AM   #7
xucaen
Member
 
Registered: Feb 2004
Location: Boston
Distribution: Kubuntu 22.04
Posts: 101

Rep: Reputation: 16
I finally fixed my boot problems. I posted to the deboian user forum but since I had asked questions here I wanted to follow up here as well in case anyone lse ever runs into this problem. Hope this helps!

begin
--------------

I was finally able to get lilo working again,
but
kernel panics (image 2.6.8-1-k7)

VFS: Cannot open root device "301" or
unknown-block(3,1)
Please append a correct "root=" boot option
Kernel panic: VFS: Unable to mount root fs on
unknown-block(3,1)

I have no idea what this means, but this is as
close as I've come to getting this resolved.

in my lilo.conf, I have
boot=/dev/hda
root=/dev/hda1

What I did was this:

Booting to knoppix cd, I was able to mount all
of
my partitions, then I did chroot to my hda1
partition. doing this was able to do apt-get
install --reinstall kernel-image-2.6.8-1-k7 (I
still have the .deb in my apt cache) and it did
go thru the install and it asked me all kinds
of
lilo questions. It created a new lilo.conf
which
looks drammitacally different (it only hase one
image= defined) but for some reason I still get
my old lilo boot menu as if it were getting it
from somewhere else!

Being fed up with this, I did apt-get remove
lilo
and did apt-get install grub

when that was done I did grub-install /dev/hda.
I rebooted and I got the grub prompt:
grub>

so I did
grub> kernel /vmlinuz
(vmlinuz is symlink to kernel-2.6.7-1-k7)

grub> initrd /initrd.img

grub> root
(grub uses (hd0,0) )

grub> boot

the kernel begins to boot and it gets to a new
and completely different kernel panic:

pivot_root: No such file or directory
/sbin/init: 426: connot open dev/console: No
such
file
Kernel panic: Attempted to kill init!


I figured out that that basically root
needs to be defined twice.. not sure if that's
the correct terminology or not...

I created a /boot/grub/menu.lst file and here it
is in case anyone else ever needs it. and I will
never again do a dist-upgrade with out a full
backup of everything. I never want to go thru
this again.


menu.lst:
------------------
default 0

color cyan/blue white/blue

title Kernel 2.6.7-1-k7
root (hd0,0)
kernel /boot/vmlinuz-2.6.7-1-k7 root=/dev/hda1 ro
initrd /boot/initrd.img-2.6.7-1-k7
savedefault
boot
-------------------
 
Old 01-03-2005, 10:26 AM   #8
skiflyer
LQ Newbie
 
Registered: Jan 2005
Posts: 13

Rep: Reputation: 0
Exact same issue

Xucean... I'm having the exact same issue with Grub that you had, getting the Kernel Panic trying to kill INIT error right now.

I want to try your menu.lst, with some minor modifications for my system, but I can't even get to a place to edit the menu.lst... how did you manage this? Right now I'm downloading Knoppix and hoping I can about it that way.

Also, once I modify the file, do I need to run anything, as with modifying lilo.conf needing to run lilo

Please, this system is driving me insane, I would love any help, as it stands I'm about 10 minutes from just installing redhat and being done with it... I love debian, but this machine is just not playing right with it (HP DL360 with a SCSI Raid Controller in it)
 
Old 01-04-2005, 01:52 PM   #9
xucaen
Member
 
Registered: Feb 2004
Location: Boston
Distribution: Kubuntu 22.04
Posts: 101

Rep: Reputation: 16
Hi, menu.lst does not exist until you create it and it must reside in directory /boot/grub.
You can copy and paste my example menu.lst (see my other post above) beginning at "default" and ending at "boot" then you need to make the appropriate changes for your system. I've never configured raid before so I don't know what specific settings you need to put in. I have a 2gb ide drive as my boot drive and it is /dev/hda1 so root=/dev/hda1 and my kernel image name is vmlinuz-2.6.7-1-k7 and resides in /boot.
The line which reads "root (hd0,0)" has special meaning and the man page can explaine it better than I can. All I know is hd0,0 is basically the same thing as hda1.
You do not have to run anything like lilo does. grub simply reads in the menu.lst when it boots.

here is a link to grub info page:
This is an html version of the same document I used to help me configure my menu.lst
http://docs.biostat.wustl.edu/cgi-bi...)Configuration


Let me know if this helps you.

Jim
 
Old 01-04-2005, 01:54 PM   #10
skiflyer
LQ Newbie
 
Registered: Jan 2005
Posts: 13

Rep: Reputation: 0
I'm sure it would've helped me... but I finally gave up and stuck with lilo. Dryago's advice above solved the lilo problems I was having, and I've pretty much run out of time to tinker and just need to get the box out the door.. so lilo it is.

Perhaps once I'm confident in my boot floppies and the like I'll tinker more with grub since I prefer it, but this raid controller just doesn't seem to want to play nicely with it.

Thanks for the information though, I'm sure it will help me down the line at the very least.
 
Old 01-04-2005, 02:02 PM   #11
xucaen
Member
 
Registered: Feb 2004
Location: Boston
Distribution: Kubuntu 22.04
Posts: 101

Rep: Reputation: 16
Re: Exact same issue

Quote:
Originally posted by skiflyer
I want to try your menu.lst, with some minor modifications for my system, but I can't even get to a place to edit the menu.lst... how did you manage this? Right now I'm downloading Knoppix and hoping I can about it that way.
I'm slow, I just figured out what you meant. Yes, I used a knoppix cd, mounted my hda1 partition and created my menu.lst.

Jim
 
  


Reply



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
apt error, messed up after tried installing kernel-source-2.6.8 microsoft/linux Debian 1 06-17-2005 12:38 AM
kernel compilation error : '/etc/lilo' not found suryap Red Hat 2 11-24-2004 12:22 AM
Upgraded kernel, lilo.conf, didn't run /sbin/lilo dtashima Linux - Newbie 4 10-18-2004 11:21 AM
apt-get error installing xlibs 4.2.1-14, apt-get won't work at all now pib Debian 1 12-10-2003 11:39 PM
new kernel causes lilo crash; /sbin/lilo = Warning: device 0x0305 exceeds 1024 cylind dandysf Linux - Software 0 08-26-2003 04:50 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Debian

All times are GMT -5. The time now is 08:44 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
Open Source Consulting | Domain Registration