-   Linux - General (
-   -   initrd how to make one? (

watashiwaotaku7 01-10-2003 10:57 PM

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? how do i create an initrd.img?


nxny 01-11-2003 12:16 AM

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

watashiwaotaku7 01-11-2003 09:42 AM

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?

nxny 01-11-2003 01:08 PM


Originally posted by watashiwaotaku7
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?
Edit lilo.conf and remove the initrd line from under your 'new' kernel image. Then rerun the map installer ( /sbin/lilo )

raid517 02-27-2004 02:11 PM

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?


nxny 02-27-2004 02:45 PM

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

/sbin/modprobe module-a
/sbin/modprobe module-b

to the said file and that's all you have to do.

That is pretty much all what an initrd does, if you split one open and peek inside.

tincat2 02-27-2004 08:14 PM

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.

jong357 02-27-2004 09:16 PM

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.

raid517 02-28-2004 09:07 AM

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.


jong357 02-28-2004 10:52 AM

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 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

/bin/bash 02-28-2004 11:24 AM

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.

raid517 02-28-2004 01:38 PM

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:


mkinitrd /boot/initrd-2.63
where the only thing I changed was the number to represent my initrd and kernel version.

But when I did this and hit enter I got:


/boot/linux-2.6.3/var/tmp is not a directory
What does this mean and how do I fix it?


dford 02-28-2004 02:32 PM

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.

/bin/bash 02-28-2004 05:36 PM

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:


        append="devfs=mount reboot=w panic=10 splash=silent"

BTW if you didn't apply the bootsplash patch to the 2.6.3 kernel sources then you won't have bootsplash. The patch is at but it's for 2.6.0-test9. It works for most 2.6.X kernels except you get some errors patching and have to do some of the work by hand. I havent got it to work for 2.6.3 yet.

raid517 02-28-2004 06:31 PM

Thanks man. But I'm still getting that crazy error message about var/tmp not being a directory. What is it going on about?


All times are GMT -5. The time now is 03:09 PM.