initrd how to make one?
ive just compiled a kernel (2.4.20) and bleieve it is completely ready for use the only problem is i have no initrd.img and dont know what it is or where to get it...i still have one from 2.4.19-9mdk but im assuming this does me no good wiht the new kernel?...so how do i create an initrd.img?
-thanks |
Initrd stands for INITial Ram Disk. This is a tiny root filesystem that's loaded into the memory for booting systems that need modules that cannot be accessed at boot time otherwise.
You probably wont need an initrd for the kernel if ext3 support is compiled in( as opposed to modules) Assuming you're not using raid/LVM for the root filesystem and if you are you have the necessary options compiled in. If this is the case you may safely boot the kernel without the initrd. Mandrake is based on RedHat., I hear. See mkinitrd manpage. If you are using raid for the root fs and dont have the mkinitrd script, you may create your own initrd. You may find some hints at http://www.tldp.org/HOWTO/Root-RAID-HOWTO.html |
then i most likely dont need one...but when i try to configure lilo it tells me that there is no initrd.img and that it cant continue without one should i just put the old image in to appease it?
|
Quote:
|
Yeah but how do you do it? I have a bunch of modules that weren't loaded in my Suse 9.0 kernel 2.6.2 install and I know for a fact that there were loaded when I did use an initrd.
I've been looking for days to try to find a way to make one - I have searched hundreds of Google pages - and its always the same anser. "You probably don't need one". Well I have no network, no sound and no 3D acceleration - which kind of makes me think that maybe I do need one. If I could work out some other way to load the modules I need at boot time then I guess I would be good to go. But Suse doesn't seem to have a /etc/modules file like debian, nor does it have an ./etc/init.d/Kernel-version file like Gentoo. I'm beginning to think that this is some kind of big Linux secret only known to true gurus. Lol. :) Comeon guys, can you just explain this to me, please? GJ |
From your post, it sounds like you want to load a few modules( that do get loaded at boot-time when you boot using an initrd) automatically, even without an initrd.
Do you have an rc.local of some sort in SuSE? If yes, you can append Code:
/sbin/modprobe module-a That is pretty much all what an initrd does, if you split one open and peek inside. |
do you have an /etc/rc.d//rc.modules-this script loads the modules for sound, network cards and agp support-xf86config plus your drivers should get your 3d going-if you're just plugging in a new kernel and have done 'make modules', what you need should be there.
|
Yea... An initrd.img is pointless.... I dont use one on Redaht or Suse even tho they start you out with one. I've got a custom compiled kernel specific to my machine and I have alot of stuff hard-wired in as well... Your either missing something in your kernel or your not deleting the initrd line from your bootloader config file. Trust me.... Ditch it.
|
Thanks guys, but SuSe doesn't seem to have an etc/rc.d//rc.modules or rc.local file. Does anybody know how I can get the modules I need to load automatically at boot time in Suse without an initrd? You guys seem to think an initrd is a bad idea so I am happy to try another method.
Any ideas? So far there is no /etc/modules, no /etc/init.d/kernel-version, no /etc/rc.local, no etc/rc.d//rc.modules and nothing else resembling that that I can see. I would be happy to live without an initrd entry - but I do need my drivers to be automatically loaded at boot time so I don't have to modprobe them by hand every time my PC starts. GJ |
Recompile your kernel. DO NOT use modules for a file system. Especially not your root file system. That is a really illogical thing to do. I never use modules for important KEY functions. All file systems and devices I hardwire into the kernel. The only thing I use modules for is ipv6 and various other "less important stuff". My kernel image still stays under 1.5mb. If all that is built in, and your kernel config is just the way you want it, do a
make bzImage modules modules_install move your new System.map and bzImage to your boot folder and readjust your grub or lilo config file. Ditch the initrd line as well... Boot up. (I also move the vmlinux to /boot as well just to keep that stuff together.) Your kernel will know what modules to load by looking at config files in /lib/modules/uname -r |
The answer to the question is:
mkinitrd /boot/initrd-x.y.z x.y.z Where x.y.z is the kernel version. Having an initrd is perfectly acceptible. If you choose to build a modular kernel then go ahead, and don't let anyone tell you it is wrong to do. I have a reiserfs filesystem and always build reiserfs as a module with no problems. And yes there are some things that CAN NOT be built into the kernel and therefore require an initrd. The one thing I know of is the pictures for bootsplash require an initrd to pass them to the kernel. The one filesystem you have to build into the kernel is ext2 because the initrd image is made using ext2 filesystem. |
Thanks man, I was begining to wonder if making an initrd was some kind of Linux secret - and yes I do want to use bootsplash. The only problem is I did exactly what you said. I opened a command window on the desktop and typed:
Code:
mkinitrd /boot/initrd-2.63 But when I did this and hit enter I got: Code:
/boot/linux-2.6.3/var/tmp is not a directory GJ |
mkinitrd is just a shell script, perhaps you might look through it to see where the problem is occurring. Offhand in my version, I don't see where that message would come from, but I'm using RedHat. One thing to be aware of is that it does a loopback mount of the initrd-2.6.3 file and creates a directory structure under it. It is possible that is what it is referring to.
|
To make initrd for 2.6.3 kernel do exactly this. <edit> Of course you must be root to do this.
mkinitrd /boot/initrd.2.6.3.img 2.6.3 NOTE: The initrd.2.6.3.img is just a filename and you can name it anything you want but the rest is necessary. Make sure the entry in /etc/lilo.conf matches, for example: Code:
image=/boot/vmlinuz-2.6.3 |
Thanks man. But I'm still getting that crazy error message about var/tmp not being a directory. What is it going on about?
GJ |
Quote:
Quote:
Because I haven't ever used SUSE, the following is speculation based on experience with Redhat. If SUSE has a /bin/installkernel or /sbin/installkernel, and you've done all the other steps in the kernel install process (make bzImage, make modules, make modules_install), then I think doing a "make install" in the kernel directory might do all the right things - such as making an initrd, and installing the kernel. But for all I know this might be a really bad thing to do on SUSE. |
good point /bin/bash..... I tend to think rather linear when it comes to giving advice. I.E - I have no need for it so why should you? But honestly, what other practical use is there to using an initrd image besides having a "pretty" background to your bootloader? If that was a concern for me, I suppose I would be booting into a runlevel 5 with flowers and cute pictures of teddy bears as well insted of init3.... There are a few other uses for initrd that are on the tip of my mind, but again, are they really necessary? It just seems really silly to rely upon external modules when the middleman can be kicked to the curb completely.... Your just increasing the complexity of your boot process and increasing the risk of your system not booting.... I'm all for simplicity I guess.... I also like it when I can consistently boot into any new kernel that I compile without a hitch.... :) Well, good post. I might have to expierment with using initrd just to learn some new stuff.....
|
As was posted earlier mkinitrd is a script. And Suse may have their own version of that script. If you just type mkinitrd without parameters it should spit out some usage help, if you could do that and post it here. It looks to me like it is thinking /boot/initrd.2.6.3.img is the path to a /var/tmp directory instead of the name of the initrd file. Maybe Suse has the parameters in a different order. With Mandrake it is:
mkinitrd [options] <initrd.img> <kernel ver> Quote:
Since you asked...
Well thats just a couple instances I thought of off the top of my head, and probably there are many other. Using initrd is just another choice you have in Linux, it's there if you want to/need to use it. |
Hey bin/bash, would u take a look at my post, for I need an initrd for custom dsdt so I can fine tune acpi!
Thanks...2.6.4 acpi patch in debian... http://www.linuxquestions.org/questi...hreadid=158824 |
All times are GMT -5. The time now is 10:13 AM. |