LinuxQuestions.org
Visit the LQ Articles and Editorials section
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices

Reply
 
Search this Thread
Old 01-10-2003, 10:57 PM   #1
watashiwaotaku7
Member
 
Registered: Oct 2002
Location: wisconsin -- The Badger state
Distribution: gentoo
Posts: 654

Rep: Reputation: 30
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
 
Old 01-11-2003, 12:16 AM   #2
nxny
Member
 
Registered: May 2002
Location: AK - The last frontier.
Distribution: Red Hat 8.0, Slackware 8.1, Knoppix 3.7, Lunar 1.3, Sorcerer
Posts: 771

Rep: Reputation: 30
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
 
Old 01-11-2003, 09:42 AM   #3
watashiwaotaku7
Member
 
Registered: Oct 2002
Location: wisconsin -- The Badger state
Distribution: gentoo
Posts: 654

Original Poster
Rep: Reputation: 30
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?
 
Old 01-11-2003, 01:08 PM   #4
nxny
Member
 
Registered: May 2002
Location: AK - The last frontier.
Distribution: Red Hat 8.0, Slackware 8.1, Knoppix 3.7, Lunar 1.3, Sorcerer
Posts: 771

Rep: Reputation: 30
Quote:
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 )
 
Old 02-27-2004, 02:11 PM   #5
raid517
Member
 
Registered: Feb 2002
Posts: 393

Rep: Reputation: 30
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
 
Old 02-27-2004, 02:45 PM   #6
nxny
Member
 
Registered: May 2002
Location: AK - The last frontier.
Distribution: Red Hat 8.0, Slackware 8.1, Knoppix 3.7, Lunar 1.3, Sorcerer
Posts: 771

Rep: Reputation: 30
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
/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.
 
Old 02-27-2004, 08:14 PM   #7
tincat2
Member
 
Registered: Feb 2002
Location: hills of WV
Distribution: slackware
Posts: 223

Rep: Reputation: 30
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.
 
Old 02-27-2004, 09:16 PM   #8
jong357
Senior Member
 
Registered: May 2003
Location: Columbus, OH
Distribution: DIYSlackware
Posts: 1,914

Rep: Reputation: 52
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.
 
Old 02-28-2004, 09:07 AM   #9
raid517
Member
 
Registered: Feb 2002
Posts: 393

Rep: Reputation: 30
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
 
Old 02-28-2004, 10:52 AM   #10
jong357
Senior Member
 
Registered: May 2003
Location: Columbus, OH
Distribution: DIYSlackware
Posts: 1,914

Rep: Reputation: 52
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

Last edited by jong357; 02-28-2004 at 10:55 AM.
 
Old 02-28-2004, 11:24 AM   #11
/bin/bash
Senior Member
 
Registered: Jul 2003
Location: Indiana
Distribution: Mandrake Slackware-current QNX4.25
Posts: 1,802

Rep: Reputation: 46
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.
 
Old 02-28-2004, 01:38 PM   #12
raid517
Member
 
Registered: Feb 2002
Posts: 393

Rep: Reputation: 30
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
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:

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

GJ
 
Old 02-28-2004, 02:32 PM   #13
dford
Member
 
Registered: May 2003
Location: Kansas
Distribution: RH 9, OpenBSD, FreeBSD
Posts: 60

Rep: Reputation: 19
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.
 
Old 02-28-2004, 05:36 PM   #14
/bin/bash
Senior Member
 
Registered: Jul 2003
Location: Indiana
Distribution: Mandrake Slackware-current QNX4.25
Posts: 1,802

Rep: Reputation: 46
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
        label="Linux"
        root=/dev/hda7
        initrd=/boot/initrd-2.6.3.img
        append="devfs=mount reboot=w panic=10 splash=silent"
        vga=788
        read-only
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 www.bootsplash.org 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.

Last edited by /bin/bash; 02-28-2004 at 05:39 PM.
 
Old 02-28-2004, 06:31 PM   #15
raid517
Member
 
Registered: Feb 2002
Posts: 393

Rep: Reputation: 30
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

Last edited by raid517; 02-28-2004 at 06:47 PM.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
How do I make initrd.img? zahadumy Slackware 2 11-13-2005 09:05 AM
make initrd error imagineaxion Debian 4 02-08-2005 09:29 AM
command to make initrd.img utanja Debian 12 09-06-2004 12:18 PM
New Kernel 2.4.22 won't make initrd jon1591 Linux - Newbie 3 12-13-2003 02:09 PM
How do you make a initrd and vmlinux file? britishnemesis Linux - General 10 11-03-2003 09:30 AM


All times are GMT -5. The time now is 09:10 AM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration