Can't get an initrd to work with my Slack12 installation
SlackwareThis Forum is for the discussion of Slackware Linux.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
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
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:
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.
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)
(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.
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).
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
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).
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
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.)
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
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.
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.
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).
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.