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 ?

  • 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

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.

  • 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. – LawrenceC Aug 10 '12 at 21:16
  • 3
    You can boot from USB without an initramfs by using PARTUUID= and rootwait. See kernel-parameters.txt and Why can't I specify my root fs with a UUID? and What's the point of rootwait/rootdelay? – bain Jan 28 '16 at 14:51

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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