5

During the Ubuntu Server setup, I was given a choice to install a 'targeted' initrd with only the modules my computer needs. I chose the other option, 'generic'. How can I install a 'targeted' initrd now that I've already installed my system?

3 Answers 3

8

Edit /etc/initramfs-tools/initramfs.conf and change

MODULES=most

to

MODULES=dep

then run

update-initramfs -u
1
  • For reference (couldn't find this elsewhere), my initrd went from 13M to 3.5M by doing this and, on a slow system, pretty significantly improved boot speed.
    – Luc
    Jul 17, 2014 at 23:12
3

Switching initrd type

As you correctly pointed out yourself, change the initramfs-tools MODULE= setting from most to dep or the other way around, depending on your wishes.

Note, however, that hooks in /etc/initramfs-tools/conf.d overrule the setting from /etc/initramfs-tools/initramfs.conf. A file driver-policy is created there when choosing a targeted initrd, at least on Debian (Jessie), that has MODULES=dep.

Reasons for generic initrd

You might be interested in going the other way around (towards generic initrd) if you miss USB keyboard support for your LUKS password on boot. It seems the dep option fails to detect the necessity for keyboard support.

Report examples:

If you like your lean targeted initrd, you might want to include modules hid_generic and usbhid in /etc/initramfs-tools/modules for USB keyboards to work in initrd. Might be xhci_hcd is also required if you use a USB3.0 controller to connect your keyboard

-1

You probably want to install the linux-image-server package.

3
  • I already have this installed. Dec 3, 2010 at 10:26
  • I am not aware of any other kernel flavor, never heard of a "targeted" kernel. Both the generic and server kernels contain the core drivers built-in, drivers for additional hardware is available from modules which are only loaded if required. Dec 3, 2010 at 10:30
  • The option to choose between a 'generic' and 'targeted' kernel is given only if 'Export mode' is enabled in the setup. Dec 3, 2010 at 10:31

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .