I am using ubuntu kernel 4.xx with corresponding ubuntu initrd.img, and it works. But, I want to use a custom initramfs inspired by lfs (linux from scratch) initramfs. The kernel extracts, and runs my init script successfully including mounting sysfs. But /sys doesn't expose any trace to available storage (two disks exist), and therefore it's not possible to initialize the kernel root.

What is the problem?

Does ubuntu add-on to the kernel (/ubuntu directory) dictate any special policy for initrd?


On the working system, look at the device(s) in sysfs, and their device symlink. This points to the parent device - which may in turn have its own parent device, and so on. Write yourself a list of the device and all its parent devices. Then you can check all of them in the initramfs. You might be missing more requirements than just the two disk devices.

Secondly, when you make your list of devices, look at the driver/module for each one and write down what it is. This tells you which kernel module is recognizing the device.

udev is supposed to be loading the kernel modules for you.

Unfortunately, the LFS initramfs takes systemd-udev and tries to run it without systemd. This is unfortunate because using systemd would let systemd-udev log any errors it encountered to the systemd journal. You could then check the journal for errors. I do not know whether udev error logging works in the LFS initramfs.

does ubuntu add-on to the kernel (/ubuntu directory) dictates any special policy for initrd?


  • i'm discussing steps prior to udev initialization, it doesn't work as expected, so what is missing in the device tree, taking sda as an example, following (find /sys -name sda) trees on both systems, the only missing part is the leaf sda, everything have a directory, and sda is missing! – Error Nov 15 '18 at 12:04
  • in that scenario udev can't function, i shouldn't do kernel work in initramfs, the storage is expose nowhere, therefore it don't exist as kobject – Error Nov 15 '18 at 12:22
  • 1
    @Error sda is only loaded prior to udev if all the code for sda is built in to the kernel! It depends on how the kernel was built, and what your device is. If the code is not built-in, then you need udev to modprobe the necessary kernel module(s). – sourcejedi Nov 15 '18 at 12:27
  • didn't thought that, i will consider that, and try in an hour, appreciated – Error Nov 15 '18 at 12:29
  • 1
    adding missed pci drivers solves the problem – Error Nov 17 '18 at 7:46

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