LinuxQuestions.org
Help answer threads with 0 replies.
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 08-25-2007, 06:32 PM   #1
TSquaredF
Member
 
Registered: Dec 2005
Location: "The South Coast of Texas"
Distribution: Slackware64-current
Posts: 564

Rep: Reputation: Disabled
Can't get an initrd to work with my Slack12 installation


I have been following the stickied "12.0 & HAL" thread with some interest, primarily because of the discussion there about using an initrd. I have tried using the smp kernel (not the huge) on this machine, with an initrd, several times & have always failed.
My machine has several distros on it & I have a separate boot partition (hda2) that holds all my kernels. I discovered, back in the version 9 or 10 days that the default kernel came with the ext2 filesystem compiled in, but all the others as modules & that if my boot partition were ext2, my root partition could be ext3 & the system would boot without an initrd. Side note: I use GRUB, if that makes any difference.
When 12.0 came out & I decided to do a clean install of it, I discovered that all the filesystems were as modules, so I booted from the DVD, built an initrd that had ext2 in it, rebooted from the HDD & had a kernel panic. I rebooted from the DVD, built an initrd that had both ext2 & ext3 filesystems in it, rebooted from the HDD & had a kernel panic. I finally decided that I wanted to use the system, not build initrds, so I rebooted from the DVD, compiled ext[23] filesystems into the kernel, rebooted from the HDD & have been running fine since. The only change I made to the kernel was the addition of the filesystems.
I don't like having failed on a project, so have revisited this issue twice, with the same results. I can get the initrd to work if I move my kernel to /boot in my root partition & build an initrd with just ext3 support in it, but not if it is a separate ext2 partition. I haven't tried a separate ext3 partition, because, to my mind, a 50MB ext3 partition might just as well be in the root partition.
I have tried initrds with just an ext2 module & with both ext2 & ext3 modules. Same results.
Here is my boot stanza from GRUB:
Quote:
title Slackware-12.0
kernel (hd0,1)/vmlinuz-generic-smp-2.6.21.5-smp root=/dev/hdb7 ro 4
This is not a burning issue, but I would like to know why it doesn't work (What have I done wrong?). Anybody have any ideas?
Regards,
Bill
 
Old 08-25-2007, 06:52 PM   #2
forrest44
Member
 
Registered: May 2004
Location: In the staple gun
Distribution: slackware4life
Posts: 119

Rep: Reputation: 15
What commands do you use to make the initrd?
It should be something like:
cd /boot
mkinitrd -c -k 2.6.21.5-smp -m ext3:jfs -r /dev/hdb7 -f ext3

Then you should refer to the initrd image in your boot line thing.
eg if you are using lilo, the entry in your /etc/lilo.conf should look something like this:

label slack11
image = /boot/vmlinuz-generic-2.6.21.5-smp
initrd = /boot/initrd.gz
root = /dev/hdb7
read-only

I'm not so sure about grub though.


ext2 is built into the kernel. The initrd image itself is an ext2 filesystem, so if the kernel did not have ext2 built in, you could not use an initrd.

What is the output from the kernel panics?

Last edited by forrest44; 08-25-2007 at 06:55 PM.
 
Old 08-25-2007, 11:44 PM   #3
acummings
Member
 
Registered: Jul 2004
Distribution: Slackware
Posts: 615

Rep: Reputation: 50
hig is my alias for: 'history | grep'

boot partition is ext 2; / is ext3

initrd made from the next command works for me on Slack 12.0

Code:
root@AB60R:~# df
Filesystem           1K-blocks      Used Available Use% Mounted on
/dev/sda3             16824740   4051584  11918500  26% /
/dev/sda1                77749     19962     53773  28% /boot
root@AB60R:~# hig mkinit
   73  mkinitrd -c -k 2.6.21.5-smp -m ext3:scsi_transport_spi:aic7xxx -f ext3 -r /dev/sda3
root@AB60R:~#
--
Alan.
 
Old 08-26-2007, 12:07 PM   #4
TSquaredF
Member
 
Registered: Dec 2005
Location: "The South Coast of Texas"
Distribution: Slackware64-current
Posts: 564

Original Poster
Rep: Reputation: Disabled
A Little More Data

Thanks for the replies. Here's what I have managed to do today:
1) Reinstalled kernel-generic-smp-2.6.21.5_smp-i686-2.tgz
2) Booted w/o an initrd, knowing it would fail.
3) Got the following kernel panic message:
Quote:
No filesystem could mount root, tried:
Unable to mount root fs on unknown-block(3,71)
4) Made an initrd with the following:
Quote:
mkinitrd -c -k 2.6.21.5-smp -m ext2 -f ext2 -r /dev/hdb2
5) Rebooted & got the same kernel panic message as in #3 above.
I will redo my initrd based on acumming's post & report back.
Regards,
Bill
 
Old 08-26-2007, 12:35 PM   #5
Alien Bob
Slackware Contributor
 
Registered: Sep 2005
Location: Eindhoven, The Netherlands
Distribution: Slackware
Posts: 8,559

Rep: Reputation: 8106Reputation: 8106Reputation: 8106Reputation: 8106Reputation: 8106Reputation: 8106Reputation: 8106Reputation: 8106Reputation: 8106Reputation: 8106Reputation: 8106
Two comments on that:

(1) In your first post your grub stanza mentions /dev/hdb7 as your root partition, but in your latest grub example you use /dev/hdb2 . I hope you changed your disk partitioning in the meantime, or this is wrong and causes a panic at boot.

(2) I miss another grub line that goes like this:
Code:
initrd /boot/initrd.gz
Without this, your initrd will never be used.

Eric
 
Old 08-26-2007, 12:50 PM   #6
acummings
Member
 
Registered: Jul 2004
Distribution: Slackware
Posts: 615

Rep: Reputation: 50
I don't know that much about it.

I got some help some time back on Slack 10.2 or 11 in order for me to succeed with an initrd.

I've an Adaptec scsi adapter and a scsi HD which is why the extra modules (each module is separated by a colon) in my initrd.

Code:
mkinitrd -c -k 2.6.21.5-smp -m ext3:scsi_transport_spi:aic7xxx -f ext3 -r /dev/sda3
Code:
mkinitrd -c -k 2.6.21.5-smp -m ext3 -f ext3 -r /dev/sda3
For an ext2 boot partition and an ext3 / partition, wouldn't the OP need like the 2nd mkinitrd above? (except of course for the sda3 part of it)

I'm unaware if it's needed both -m ext3 and -f ext3

But, doesn't that tell it to load the ext3 module so as to (provide) support the ext file sys and doesn't the -f ext3 specify that the partition *is* ext3

Nonetheless, as it stands, mine has been working just fine (I'm using lilo, not grub).

--
Alan.
 
Old 08-26-2007, 02:52 PM   #7
gnashley
Amigo developer
 
Registered: Dec 2003
Location: Germany
Distribution: Slackware
Posts: 4,928

Rep: Reputation: 612Reputation: 612Reputation: 612Reputation: 612Reputation: 612Reputation: 612
As Alien Bob pointed out, you are missing the line in your grub menu.lst which specifies the initrd. No initrd is going to work without it.
 
Old 08-26-2007, 03:46 PM   #8
TSquaredF
Member
 
Registered: Dec 2005
Location: "The South Coast of Texas"
Distribution: Slackware64-current
Posts: 564

Original Poster
Rep: Reputation: Disabled
Tying The Ribbons On This One...

OK, I've gotten my system to work with the initrd. Using this initrd command:
Quote:
mkinitrd -c -k 2.6.21.5-smp -m ext3 -f ext3 -r /dev/hdb7
& this GRUB boot stanza
Quote:
title Slackware-12.0
kernel (hd0,1)/vmlinuz-generic-smp-2.6.21.5-smp root=/dev/hdb7 ro 4
initrd=(hd0,1)/initrd.gz
got the job done.
A couple of comments: First, one post says that the ext2 filesystem is compiled in the generic-smp kernel. It is not. If it were, one could run an ext2 filesystem without an initrd. One must have an initrd to run any filesystem with the generic-smp kernel. Second: I want to reassure everyone that I was using an initrd line in my boot stanza. That was not the issue.
I think I was so obsessed with the fact that my /boot partition was ext2 that I thought I had to load the ext2 module in the initrd. I don't know enough about GRUB to explain why it works without the module, but it does. If someone could explain it to me, I would truly appreciate it.
Lastly, I thank all who posted here. I've solved a lot of my problems by just lurking/reading/searching on this forum. Please keep up the good work.
Regards,
Bill
 
Old 08-26-2007, 04:55 PM   #9
acummings
Member
 
Registered: Jul 2004
Distribution: Slackware
Posts: 615

Rep: Reputation: 50
Quote:
I think I was so obsessed with the fact that my /boot partition was ext2 that I thought I had to load the ext2 module in the initrd. I don't know enough about GRUB to explain why it works without the module, but it does.
Though I use Lilo, mine works too, in same manner (recall my partitions, thus:

Code:
root@AB60R:~# df
Filesystem           1K-blocks      Used Available Use% Mounted on
/dev/sda3             16824740   4051584  11918500  26% /
/dev/sda1                77749     19962     53773  28% /boot
sda1 is ext2 and sda3 is ext3

I suspect that why it works is due to that ext2 support is compiled into the kernel.
--

FWIW on Slack 11 on my laptop where I have only a swap partition and a big ext3 partition

(/boot in this case is on the big ext3 partition)

I went to go to using from Slack 11 /extra (or wherever the generic 2.6 was stored) the generic 2.6.blah.blah kernel (in place of the 2.4 kernel if I remember right)

I had not created an initrd when I first fired up such generic 2.6

It *did* boot and run though it had some sort of error reported during booting.

On forums I found that error was due to ext3 support was not in the kernel. I needed an initrd (provide ext3 support). In this case I made an initrd, just as your last mkinitrd command.

And then, no more error, all is fine. (but my mentioned Slack 11 laptop previously had run even though the error).

You said yours wouldn't run minus ext3 support (I can only guess that a later 2.6 kernel makes a difference and/or when it's a two partition /boot on ext2 and / on ext3 makes it different than my laptop that's with only one huge ext3 partition).

--
Alan.
 
Old 08-26-2007, 05:36 PM   #10
TSquaredF
Member
 
Registered: Dec 2005
Location: "The South Coast of Texas"
Distribution: Slackware64-current
Posts: 564

Original Poster
Rep: Reputation: Disabled
For acummings:
Well, as I mentioned before, I used a generic kernel in Slack 9 or 10, had an ext2 /boot partition & booted with no problems. I assumed (but you know what that means!) that the kernel was booting the ext3 fs as ro ext2 in the initial boot, then when it was ready to change to rw, it was able to load the ext3 module, but I don't really know. I now assume that it is booting properly because grub/lilo will read ext2 filesystems, but again I haven't a clue. Maybe somebody smart will read this & enlighten me.
Thanks again for posting your mkinitrd command, that got me moving in the right direction.
Regards,
Bill
 
Old 08-27-2007, 01:39 AM   #11
gnashley
Amigo developer
 
Registered: Dec 2003
Location: Germany
Distribution: Slackware
Posts: 4,928

Rep: Reputation: 612Reputation: 612Reputation: 612Reputation: 612Reputation: 612Reputation: 612
Grub does not read the filesystem at all. It just uses a block list so any drive recognized by the BIOS can be accessed without any file system support. Also, the ext2 driver may be able to access ext3 partitions( without journalling capability.)
 
Old 08-27-2007, 08:58 AM   #12
TSquaredF
Member
 
Registered: Dec 2005
Location: "The South Coast of Texas"
Distribution: Slackware64-current
Posts: 564

Original Poster
Rep: Reputation: Disabled
gnashley wrote:
Quote:
Grub does not read the filesystem at all.
My kernel is mounted on an ext2 fs. How is it read if there is no filesystem support at all?
Quote:
Also, the ext2 driver may be able to access ext3 partitions( without journalling capability.)
I figured that might be the case.
The way I'm currently set up, I have ext3 support in the initrd & my kernel is on an ext2 partition. I'm not sure why it's working, but it is. Mine "not to reason why", right?
Regards,
Bill
 
Old 08-27-2007, 02:21 PM   #13
Alien Bob
Slackware Contributor
 
Registered: Sep 2005
Location: Eindhoven, The Netherlands
Distribution: Slackware
Posts: 8,559

Rep: Reputation: 8106Reputation: 8106Reputation: 8106Reputation: 8106Reputation: 8106Reputation: 8106Reputation: 8106Reputation: 8106Reputation: 8106Reputation: 8106Reputation: 8106
Quote:
Originally Posted by gnashley View Post
Grub does not read the filesystem at all. It just uses a block list so any drive recognized by the BIOS can be accessed without any file system support.
Actually, it is LILO which knows nothing about filesystems and stores a block list to retrieve kernel and chainloaders.
GRUB is able to read all common UNIX filesystems, and FAT/NTFS too.

Eric
 
Old 08-27-2007, 03:49 PM   #14
rworkman
Slackware Contributor
 
Registered: Oct 2004
Location: Tuscaloosa, Alabama (USA)
Distribution: Slackware
Posts: 2,559

Rep: Reputation: 1351Reputation: 1351Reputation: 1351Reputation: 1351Reputation: 1351Reputation: 1351Reputation: 1351Reputation: 1351Reputation: 1351Reputation: 1351
On the subject of ext2 being built into the generic kernel, someone already corrected that - it is not. It *was* compiled into the generic kernels in Slackware 11.0, but it is not in 12.0.
This is because mkinitrd that shipped in 11.0 used an ext2 filesystem for the initrd, but 12.0's mkinitrd uses a cpio archive, so the ext2 support is no longer necessary.
 
Old 08-28-2007, 04:40 AM   #15
gnashley
Amigo developer
 
Registered: Dec 2003
Location: Germany
Distribution: Slackware
Posts: 4,928

Rep: Reputation: 612Reputation: 612Reputation: 612Reputation: 612Reputation: 612Reputation: 612
On the subject of filesystem support, I pulled this from the GRUb docs:

Stage 1 is only used to load Stage 2. If Stage 2 can be loaded in some other manner in a compatible fashion, then Stage 1 is unnecessary, and doesn't need to be used.

On a floppy, there is generally only one possible boot area, the first boot sector. The Stage 1 portion would go there.

On a hard disk, Stage 1 can be part of the MBR block or part of the first block of some partition.

Stage 1 "knows" where Stage 2 is by entries in a block-list loading table embedded in it. It loads the lists of blocks off of the booting drive, then jumps to a specified CS:IP in 16-bit real mode. These are described in the page on embedded data. It queries the BIOS for the disk geometry, and maps the linear block numbers there to C:H:S addresses used by the INT 13h BIOS interface.

And then this:
Stage 2
This component is the GRUB proper.

It gets most of the information about the machine and the boot state from the BIOS and information passed into it at starting time, except that it contains embedded data on where to look for the install partition and the configuration file.

The first action of the Stage 2 is to look for it's configuration file. If one is not found, then it drops into the command-line interface. If one is found, the full menu interface is activated containing whatever entries were found in the file (the command-line is still available via a command from the menu interface).


***********
The embedded data is blocklist information in both stage1 and stage2. stage2 contains the filesystem drivers and needs them in order to access it's menu -otherwise the internal one is used(if compiled in).
 
  


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
Merge INITRD images in Slack12 ?? orbit Slackware 35 05-08-2008 05:58 PM
Slack12 install cd doesn't work on old pc! linuxhippy Slackware 15 09-03-2007 01:14 PM
epson stylus photo rx420 wont work in slack12 Carpo Slackware 3 08-20-2007 03:51 AM

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

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