Why would a linux system mount partitions from fstab with one kernel config, but not another?

0

I have a linux ROM image made by Buildroot with BusyBox init and eudev. The image has an /etc/fstab, which mounts /dev/mmcblk0p1 at /boot, and /dev/mmcblk0p2 at /mnt/var.rw (the upper filesystem for /var), and /var as a writable unionfs.

I customized the kernel config to remove features I don't need, including device mapper, some random drivers, (filesystems I'm not using, networking, wireless, IOMMU... quite a few), and now when I boot the device, /boot and the other filesystem are not mounted. If I run mount -a, they are mounted properly.

I rebuilt the kernel with the board's defconfig, with nothing else changed, and the partitions mount successfully on boot again.

Nothing in dmesg seems to indicate a failure to mount any filesystems. Also, the overlayfs mounts in the absence of the mounted upper filesystem, so I know that fstab is being read.

What kernel config option could possibly cause this behavior?

EDIT: Narrowing down the problem more, I've found that it was caused by building UnionFS into the kernel. Building it as a module eliminates the behavior. Could anyone explain what might cause this behavior?

jakogut

Posted 2016-08-05T01:03:34.743

Reputation: 101

So you already have the answer, but just haven't bothered to compare the .config files of the "board's defconfig" and your custom version? – sawdust – 2016-08-05T01:41:19.897

@sawdust: I have compared the configs, I've found nothing that would obviously cause the behavior. It's an odd problem to begin with, because the filesystems mount fine, just not at boot. This, to me, would suggest a problem other than the kernel, though testing indicates it is. Furthermore, the amount of features that were stripped out makes the cause a needle in a haystack. – jakogut – 2016-08-05T02:18:15.930

Put both kernels in your boot menu (old and new) and see if both have the same problem, which I suspect. That'll at least tell you where to look. – Julie Pelletier – 2016-08-06T05:05:29.043

2"Building it as a module eliminates the behavior." -- A built-in module executes its init routine before there is a rootfs. A loadable module executes its init routine after the rootfs has been mounted and userspace is active. Apparently UnionFS has a hidden dependency on the rootfs and/or a userspace application. – sawdust – 2016-08-07T22:44:11.337

No answers