Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

Is it possible to boot linux without a initrd.img ? I am planning to add default drivers as a part-of-kernel itself and avoid initrd completely.

What are the modules that should be made part-of-the-kernel instead of loadable modules ?

share|improve this question
1  
What ever is needed for the kernel to see your boot media (hard disk/raid driver/volume manager) and the root filesystem. –  forcefsck Mar 17 '11 at 11:59
add comment

1 Answer

up vote 9 down vote accepted

It is, unless your root volume is on an LVM, on a dmcrypt partition, or otherwise requires commands to be run before it can be accessed.

I haven't used an initrd on my server in years. You need at a minimum these modules built in:

  • the drivers of whatever controller where your root volume disk lives
  • the drivers necessary to "get to" that like PCI, PCIe support, USB support, etc.
  • the modules that run the filesystem mounted on it

    It's also a very good idea to build in your network card drivers as well.

    I've found that lspci/lsmod can help you here from your currently running kernel, look at what's there and use the make menuconfig search option before compiling to find where to enable the modules.

share|improve this answer
    
UPDATE: Linux needs a user-space program to boot off of a volume by uuid. You will almost always want to boot by uuid if A) you are trying to boot off of USB and B) there's a possibility that other mass-storage devices may be connected - Linux doesn't always assign your boot-time USB partitions /dev/sd*. So you will want to specify a uuid. And you need an initrd that contains the script that mounts the root volume by uuid, the kernel can't do it. –  ultrasawblade Aug 10 '12 at 21:16
add comment

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.