busybox mount does not use fstab mount options for root partition

Andreas Hilse andreas.hilse at ipcomm.de
Thu Mar 5 11:05:21 UTC 2020


I took a look at mount.c

As root partition is already mounted, 'mount -a' does nothing with it.
https://git.busybox.net/busybox/tree/util-linux/mount.c#n2364

When remounting, mtab is always favored instead of fstab so no option change
possible.
https://git.busybox.net/busybox/tree/util-linux/mount.c#n2291
	// Open either fstab or mtab
	if (cmdopt_flags & MS_REMOUNT) {
		// WARNING. I am not sure this matches util-linux's
		// behavior. It's possible util-linux does not
		// take -o opts from mtab (takes only mount source).
		fstabname = bb_path_mtab_file;
	}
	fstab = setmntent(fstabname, "r");

>From my understanding it is currently not possible in a standard
buildroot/busybox environment that mount options from /etc/fstab for the
root partition are taken into consideration.
The only option I see right now is manually adding the mount options to
either kernel command line or e.g. the 
mount commands in /etc/inittab.
Please correct me if I'm wrong. I'd also be happy for any suggestions.

Taking a quick glance at mount.c in util-linux there is some merging of
fstab/mtab flags going on.

Thanks & best regards
Andreas Hilse
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 5767 bytes
Desc: not available
URL: <http://lists.busybox.net/pipermail/busybox/attachments/20200305/23ce0f3b/attachment.p7s>


More information about the busybox mailing list