LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
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 09-17-2004, 05:39 PM   #1
short101
Member
 
Registered: May 2004
Location: Aust.
Distribution: Debian
Posts: 424

Rep: Reputation: 30
Kernel recompile-kernel panic.


Just recently did a very silly thing (think it was my fault) I just did a recompile of my kernel and didnt append a version to it, cause last time it just called it custom. So after installing the kernel image with dpkg, and rebooting,,firstly I notice that there isnt a new line in grub when the machine reboots. (on previous compiles grub was updated automagically) Then when I try and load kernel, I get the dreaded kernel panic notice and everything grinds to a halt. The original kernel I had was a 2.6.7 from the install cd and the new one is also a 2.6.7 but custom. When it boots now I get "unable to mount root file sysstem on (hd0,0) I didnt make an initrd image and I think that the old kernel is being booted and is panicing because it doesnt have the file system built in to the kernel. I have tried editing the grub lines but dont seem to be having any luck. Can I get into my files using the install cd and delete my custom kernel so that I can get the old one working again?.I dont have a rescue disk because I dont have a floppy drive. I tried using the install cd and loaded thhe kernel and the exicuted a shell, but I dont know how to access the file system. I did, look in /dev/discs/disc0 and there was a few things in that ( disc part1 part2 part3 etc) but couldnt get into any thing. Can I just install the old kernel from the cd? I have just upgraded a lot of stuff and was hoping to not have to re-install, cause I cant get on a broadband connection for a while now.
 
Old 09-17-2004, 08:21 PM   #2
ToniT
Senior Member
 
Registered: Oct 2003
Location: Zurich, Switzerland
Distribution: Debian/unstable
Posts: 1,357

Rep: Reputation: 47
You sould be able to mount your hd eg. with commands
Code:
mkdir /amountpoint
mount /dev/hda1 /amountpoint
(if your linux root device is on first partition of your first disk).
Now to get into your system, you can change your fs root (called chrootting):
Code:
chroot /amountpoint
Now you can copy files around, install the previous kernel with dpkg, etc., whatever is necessary to get your system to a bootable state.
 
Old 09-18-2004, 01:18 AM   #3
short101
Member
 
Registered: May 2004
Location: Aust.
Distribution: Debian
Posts: 424

Original Poster
Rep: Reputation: 30
Thanks ToniT. Tried what you suggested, but couldnt get it to work. I tried a few different mount points (tried just / then I tried /dev/hda2) when I try and mount it it says "mounting /dev/hda2 on / failed. Block device required" If I just tried to mount /dev/hda2 then I get "cant find /dev/hda2 in fstab" I managed to dig up an old morphix cd and can mount the filesystem and look at stuff, and I found that my new kernel hasnt been installed (looked everywhere for it), but more strangely dpkg has deleted the initrd image of the old kernel. I tried to run dpkg from inside morphix, to install the new kernel again, but the filesystem is marked read only. I tried to change permissions for it, but it didnt seem to work. Any advice appreciated. I'm thinking maybe I wasn't putting in the right mount point? Please keep it basic cause this is the first time that this has happened and I'm a little over my head I think. To execute a shell, I put the install cd in, typed linux26 and waited for the kernel to load and then skipped down the list to "execute a shell"
 
Old 09-18-2004, 02:47 AM   #4
short101
Member
 
Registered: May 2004
Location: Aust.
Distribution: Debian
Posts: 424

Original Poster
Rep: Reputation: 30
O.k Just tried it again with mkdir /, mkdir /etc, mkdir /bin etc and every time I try to mount it with "mount /dev/hda2 /whatever" I get the message "cant mount /dev/hda2 on whatever. No such file or directory" when I use the mkdir command it doesnt give me any errors, so any idea why its not working? This is all with nano, which is the shell you get with the installer at the bottom of the install list. I've tried googling about this for about 4 hrs now and cant seem to be able to find a way to re-install my kernel without a floppy.
 
Old 09-18-2004, 06:34 AM   #5
ToniT
Senior Member
 
Registered: Oct 2003
Location: Zurich, Switzerland
Distribution: Debian/unstable
Posts: 1,357

Rep: Reputation: 47
Problem 1: morphix and readonliness.
The morphix mounts partitions as readonly by default.
Either: Right-click on the icon of the partition and wander through the settings to find where the read-only flag.
Or: run
Code:
sudo mount -o remount -o rw /dev/hda1
(or whatever the partition is).
Now you should be able to access the system.

You should be able to chroot into it again.

Problem 2: The mounting from install disk.
Did you try literally create a directory called "/amountpoint" (any unexisting string should do)
and mount /dev/hda1 /amountpoint (later referring to an existing directory that is not in use).
 
Old 09-18-2004, 10:45 PM   #6
short101
Member
 
Registered: May 2004
Location: Aust.
Distribution: Debian
Posts: 424

Original Poster
Rep: Reputation: 30
Yep. Did actually try "/amountpoint" also" /linux" and all the others previously mentioned. With morphix, i looked at the permissions, and the permissions for the whole partition it said were unattainable or something like that, and the partitions for the files and folders were read only. Will try it with the code suggested.
 
Old 09-19-2004, 12:11 AM   #7
short101
Member
 
Registered: May 2004
Location: Aust.
Distribution: Debian
Posts: 424

Original Poster
Rep: Reputation: 30
Tnx again ToniT. Tried Morphix again and still no luck with the code suggested. Went back to trying my luck with the install cd. Interesting thing is, when I "mkdir" anything and then type ls, then the new directory shows up. Then when I try to mount /dev/hda2 on the new ditectory, iy says it cant cause there is no such file or directory. If I try just "mount /dev/hda2" then it tells me there is no line in fstab. So then I entered /dev/hda2 into fstab with nano, with the directory that I made in the second column and it still says no such file or directory. When I type ls at the command prompt it shows all the usual directories such as bin, etc, usr etc, but if I try and mount on any of them then it tells me that there is no such file or directory. Funny thing is though, that when I type "rmdir" then it removes the directotry that I just made. So on one hand its making and removing directories, but it wont let me mount anything because they arent directories. Any ideas why this is happening anyone?
 
Old 09-19-2004, 03:26 AM   #8
short101
Member
 
Registered: May 2004
Location: Aust.
Distribution: Debian
Posts: 424

Original Poster
Rep: Reputation: 30
Finally got that part solved
mkdir linux
mount /dev/ide/host0/bus0/target0/lun0/part2 /linux
cd /linux
I thought it was talking about /linux not being a directory. Wrong again. Tried to find dpkg and its not in /bin. Anyone know where it is? Looked at the man page and it doesnt give the path for it. Its not in /bin or a couple of others I looked at. I cant seem to be able to run it to try and re-install my custom kernel, so I copied the initrd image from the install cd to /boot and am still getting kernel panic. (added it to the grub list) I think its because when I installed the custom kernel, I renamed the old kernel modules to .old, and I cant rename the directory with nano. I dunno, its starting to get messier as I go. Can I just maybe download a kernel image (with winblows ) and copy it to /boot and get up and running or I suppose I need dpkg to install that as well. Any help appreciated.

Last edited by short101; 09-19-2004 at 04:34 AM.
 
Old 09-19-2004, 03:31 PM   #9
ToniT
Senior Member
 
Registered: Oct 2003
Location: Zurich, Switzerland
Distribution: Debian/unstable
Posts: 1,357

Rep: Reputation: 47
dpkg is in /usr/bin/ (well, before chrooting it is in /linux/usr/bin)

If you just chroot into your system you should be able to use the system as if it would be booted up normally.

You should be able to rename directories with mv.

Even if you don't have dpkg, you can open debian package anyways.
See thread about libc6 for reference.
 
Old 09-20-2004, 03:48 AM   #10
short101
Member
 
Registered: May 2004
Location: Aust.
Distribution: Debian
Posts: 424

Original Poster
Rep: Reputation: 30
Just visited the thread in the previous post. Intersting about that thread, I think I'm going to be reffering to it a bit Thing is, I have only now just read it, after playing today. Firstly chrooted into my existing directory and tried to re-install my custom kernel. Dpkg tried and then failed telling me that it depended on coreutils and fileutils. The funny thing is, that dpkg didnt complain about that the first time that I installed the kernel, when everything was working. So back to winblows and download the both of them. Back into linux and try to install both and then get dependancy problems saying that I need amongst other things, libc6. Now I go back and download more stuff and back to linux and try and install it all. Then more dependancy problems, libc6 wont install because libdb1-compat isnt installed. Then try and install that and it wont install because libc6 isnt configured properly. So try and run dpkg-reconfigure libc6 in the blind hope that it will work. No joy. So thinking that I'm spiralling into dependancy hell, I remove libc6, in the hope that re-installing it will get it all up and running. Then, as I have just read and learned and experienced, dpkg no longer works. So like Torriate, I thought maybe a reboot will help, thinking that seeing as my kernel is in ram, installing again might help. Then much to my dismay, am no longer able to chroot into my linux partition. Can still mount it and cd into it, but no chroot. Then back to here and reread ToniT's post and had a look at the referred page and discover that I have just dug my hole another 6 foot deep. So now it looks like I'll be a little bit busier over the next couple of days. One thing, that bothers me though, is that if libc6 was already installed, then why was dpkg telling me that I needed to get it? Maybe just a newer version, I suppose. Dunno. Anyway, at least I am learning something, albeit slowly and painfully. Luckily I am not very busy at the moment and this is certainly giving me something to do. By the way, dpkg didnt ask me if I knew what I was doing, when I removed libc6. I wish it had!

Last edited by short101; 09-20-2004 at 04:15 AM.
 
Old 09-21-2004, 03:57 AM   #11
short101
Member
 
Registered: May 2004
Location: Aust.
Distribution: Debian
Posts: 424

Original Poster
Rep: Reputation: 30
Dont know whether to put this in this thread, or the one that ToniT linked to. Anyway, I'm trying to re-install libc6. I booted the install cd mounted my linux partition on /linux.
cp /lib/lib.so.6 /linux/lib
chroot /linux /sbin/ldconfig few seconds and back at command prompt
chroot /linux
chroot: cannot execute /bin/sh no such file or directory
ok. Try this
chroot /linux /linux/sbin/ldconfig
chroot: cannot execute /linux/sbin/ldconfig no such file or directory
cd /linux/sbin
ls
and ldconfig is in there. I guess it wont work like everything else cause no libc6.
Also tried
/bin/busybox -chroot /linux /linux/sbin/ldconfig
also when linking
chroot /linux /sbin/ldconfig -v
got a list of files that were linked but libc6 must have been at the top and went to fast to see it.
I dont think that libc6 is getting linked properly when I run ldconfig. Any ideas?
 
  


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
Kernel 2.4 in Zipslack (Waring: unable to open an initial console | Kernel Panic...) kurtamos Linux - General 2 05-10-2006 12:58 PM
Kernel panic after recompile, have tried everything else. j4mes Slackware 10 09-22-2005 03:31 AM
Kernel panic after recompile in FC4 litlmary Fedora 3 07-28-2005 06:17 PM
kernel panic: try passing init= option to kernel...installation with Red Hat 9 kergen Linux - Hardware 1 09-30-2004 03:28 AM
kernel recompile error (kernel panic) tombaaaaa Linux - Newbie 4 08-04-2004 04:32 PM

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

All times are GMT -5. The time now is 08:07 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