Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Is it possible to boot a Linux kernel (say 2.6.35) without initrd these days? I seem to remember that this is possible before (early 2.6.x and 2.4). I mean, in theory, if a kernel has all hardware support built-in (no modules), it doesn't need an early user space, right?

share|improve this question
1  
You could, at least in 2007 and in 2008. I'd say so, as long as you have all the necessary filesystem and hardware drivers built in. –  new123456 Oct 15 '11 at 23:40
    
If I remember correctly, I booted Gentoo fine using latest stable kernel with no modules or initrd few months ago, so it should be working now too. –  AndrejaKo Oct 15 '11 at 23:53
    
@AndrejaKo: I tried but the kernel could never find /dev/sda1 device although I compiled in SATA support. If there is no initrd (mdev or udev as a result), who is responsible for creating those devices? –  lang2 Oct 16 '11 at 0:04
    
@lang2 Did you compile in filesystem drivers too? That's what I used to get when I forgot them. –  AndrejaKo Oct 16 '11 at 0:08

1 Answer 1

up vote 7 down vote accepted

I don't use initrd. All that needs to happen is that you have all the drivers needed to boot your system compiled into the kernel rather than as modules.

If you use gentoo, then building your kernel and drivers is part of the installation process, it becomes second nature if you are going to add boot dependent hardware into your system that you first add the driver to the kernel. It also becomes second nature to disable anything you don't need - because there is no point compiling a bunch of drivers even as modules if you are never going to use them.

This process is conceptually more difficult on a distro like ubuntu, where the kernel is managed as a package and has everything modularised (it has to, to work successfully on many different systems out of the box). It often isn't worth the bother.

share|improve this answer
    
thanks. I still would like to understand in this case who creates the /dev/sda device file. –  lang2 Oct 16 '11 at 14:00
    
The kernel will, provided it has the correct drivers for the hard disk type and model. It has to be the kernel as there is nothing else - once the kernel has loaded, the first thing it needs to do is access inittab (depending on distro) from /dev/sda1 (if that is the root partition) –  Paul Oct 16 '11 at 21:16

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.