I am developing a device that will run Linux as its operating system. The device is a small form factor X86 device with a flash drive exposed as a SATA-device. So it is not very dissimilar from any other PC running Linux.
For several good reasons I am building my own "distribution", instead of using an existing one.
What confuses me is how mount/umount of the root file system is handled. I boot my kernel with the commandline "root=/dev/sda1 rw" which works fine. But everytime I do poweroff or reboot Busybox complained about no /etc/fstab, so I decided to build one.
Should I have an entry for my root file system? It seems like this is shadowed by the rootfs anyway. I.e. if I have the fstab entry "/dev/sda1 / ext2 1 1" mount still reports
rootfs on / type rootfs (rw) /dev/root on / type ext2 (rw,relatime,errors=continue)
My questions are:
- Do I need to worry? Will the drive be correctly unmounted by the kernel on poweroff/reboot?
- If I want to perform file system checking on boot, can I do that without resorting to an initrd?