LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices


Reply
  Search this Thread
Old 07-15-2011, 06:47 AM   #1
benav
Member
 
Registered: Sep 2009
Location: Canada
Distribution: Slackware 14.0
Posts: 36

Rep: Reputation: 1
How to recover from botched mkinitrd?


Trying to install Slackware 13.37. After installation I ran mkinitrd (I'm sorry, I can't remember what options I used, but they were based pretty closely on the examples in /boot/README.initrd), edited /etc/lilo.conf accordingly, and reinstalled LILO. On boot, I get this:
Quote:
/boot/initrd.gz: Loading kernel modules from initrd image:
mount: mountint /dev/sdb3 on /mnt failed: No such file or directory
ERROR: No /sbin/init found on rootdev (or not mounted). Trouble ahead.
You can try to fix it. Type 'exit' when things are done.
I don't know what to do, so I just type exit, and then I get a kernel panic and can't do anything but hit the power button.

Clearly, I did something wrong with mkinitrd, but now I can't figure out how to recover. I can boot from the DVD, and edit /etc/lilo.conf, but after that I'm lost. I can't figure out how to reinstall LILO so I could boot from the huge.s kernel again (mounting the drives and running sbin/liloconfig tells me "cannot install LILO"), and the setup program won't let me use its CONFIGURE option.

Any suggestions?
 
Old 07-15-2011, 07:14 AM   #2
SeRi@lDiE
Member
 
Registered: Jun 2006
Location: /dev/null
Distribution: Slackware 13.1, Slackware 13.37, aptosid, rhel
Posts: 547
Blog Entries: 7

Rep: Reputation: 55
Quote:
Originally Posted by benav View Post
Trying to install Slackware 13.37. After installation I ran mkinitrd (I'm sorry, I can't remember what options I used, but they were based pretty closely on the examples in /boot/README.initrd), edited /etc/lilo.conf accordingly, and reinstalled LILO. On boot, I get this:

I don't know what to do, so I just type exit, and then I get a kernel panic and can't do anything but hit the power button.

Clearly, I did something wrong with mkinitrd, but now I can't figure out how to recover. I can boot from the DVD, and edit /etc/lilo.conf, but after that I'm lost. I can't figure out how to reinstall LILO so I could boot from the huge.s kernel again (mounting the drives and running sbin/liloconfig tells me "cannot install LILO"), and the setup program won't let me use its CONFIGURE option.

Any suggestions?
you need to chroot your self before you run lilo again.
once you chroot your self than you can dit lilo.conf and re run lilo.

once your back in init3 to create a proper initrd file run:

/usr/share/mkinitrd/mkinitrd_command_generator.sh

that will generate the correct command you need to run for creating a proper initrd file.

Look here for more information...

http://genek.net/LinuxAdventures/sys...ackconfig.html

Scroll down to "create an initrd.gz file"

good luck.
 
Old 07-15-2011, 07:15 AM   #3
Robert.Thompson
Member
 
Registered: Nov 2009
Location: Montreal, Quebec, Canada
Distribution: LinuxMint 20 Cinnamon
Posts: 589

Rep: Reputation: 49
Hello:

If you decide to re-install, read Gene's short tutorial - it really helped me:

http://genek.net/LinuxAdventures/sys...allation1.html

http://genek.net/LinuxAdventures/sys...ackconfig.html

HTH,
 
Old 07-15-2011, 07:26 AM   #4
benav
Member
 
Registered: Sep 2009
Location: Canada
Distribution: Slackware 14.0
Posts: 36

Original Poster
Rep: Reputation: 1
Quote:
Originally Posted by SeRi@lDiE View Post
you need to chroot your self before you run lilo again.
once you chroot your self than you can dit lilo.conf and re run lilo.
I did this:
Code:
$ mkdir /mnt/root
$ mount /dev/sda3 /mnt/root
$ chroot /mnt/root
$ liloconfig
$
Running liloconfig there does nothing. No error messages at all. What did I do wrong?
 
Old 07-15-2011, 07:27 AM   #5
wildwizard
Member
 
Registered: Apr 2009
Location: Oz
Distribution: slackware64-14.0
Posts: 875

Rep: Reputation: 282Reputation: 282Reputation: 282
Did you read the first screen you get when you boot the install disk?

Quote:
In a pinch, you can boot your system from here with a command like:

boot: huge.s root=/dev/sda1 rdinit= ro
Once you boot like that you can reinstall lilo
 
Old 07-15-2011, 07:34 AM   #6
SeRi@lDiE
Member
 
Registered: Jun 2006
Location: /dev/null
Distribution: Slackware 13.1, Slackware 13.37, aptosid, rhel
Posts: 547
Blog Entries: 7

Rep: Reputation: 55
Quote:
Originally Posted by benav View Post
I did this:
Code:
$ mkdir /mnt/root
$ mount /dev/sda3 /mnt/root
$ chroot /mnt/root
$ liloconfig
$
Running liloconfig there does nothing. No error messages at all. What did I do wrong?
wildwizard gave you a good suggestion.

Also dont run liloconfig but instead edit your lilo.conf again to boot from the huge kernel and run lilo not liloconfig.
 
Old 07-15-2011, 07:38 AM   #7
benav
Member
 
Registered: Sep 2009
Location: Canada
Distribution: Slackware 14.0
Posts: 36

Original Poster
Rep: Reputation: 1
Quote:
Originally Posted by wildwizard View Post
Did you read the first screen you get when you boot the install disk?



Once you boot like that you can reinstall lilo
Thanks!
 
  


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
sudo mkinitrd -o /boot/initrd.img-2.6.32.9 2.6.32.9 sudo: mkinitrd: command not foun vishwas181 Linux - Newbie 1 02-27-2010 01:16 AM
Help! I botched LVM and botched most of system!!! Labyrinth Linux - Newbie 7 01-08-2008 04:50 AM
HOWTO: Recover from botched upgrade rworkman Slackware 1 04-06-2007 03:15 PM
Sarge botched boot bretticus Debian 2 07-26-2005 04:14 PM
Botched kernel compile, recover from CD? Zb7 Slackware 9 09-02-2003 09:32 PM

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

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