What is default "fstab" file in Android? As I known, in Android 9, system and vendor are mounted in the first stage of init by parsing fstab from device tree. But, there is another fstab parsed in init process, it is device default fstab, which is parsed by ReadDefaultFstab function below. I am facing to a error " failed to find device default fstab " in boot log. Can anyone explain for me this default fstab file? What is it and it's role?

// Loads the fstab file and combines with fstab entries passed in from device tree.
bool ReadDefaultFstab(Fstab* fstab) {
    Fstab dt_fstab;
    ReadFstabFromDt(&amp;dt_fstab, false);

    *fstab = std::move(dt_fstab);

    std::string default_fstab_path;
    // Use different fstab paths for normal boot and recovery boot, respectively
    if (access("/system/bin/recovery", F_OK) == 0) {
        default_fstab_path = "/etc/recovery.fstab";
    } else {  // normal boot
        default_fstab_path = GetFstabPath();
    }

    Fstab default_fstab;
    if (!default_fstab_path.empty()) {
        ReadFstabFromFile(default_fstab_path, &amp;default_fstab);
    } else {
        LINFO &lt;&lt; __FUNCTION__ &lt;&lt; "(): failed to find device default fstab";
    }

    for (auto&amp;&amp; entry : default_fstab) {
        fstab-&gt;emplace_back(std::move(entry));
    }

    return !fstab-&gt;empty();
}
It can be in / (ramdisk), /odm/etc/ or /vendor/etc/.

Android Storage Configuration:


  For Android releases 4.3 and later, the various fstab files used by init, vold and recovery were unified in the /fstab.&lt;device&gt; file


Next change occured with Treble when vendor/SoC specific code was separated from Generic AOSP code. So fstab was moved to /odm or /vendor.

default_fstab_path reads GetFstabPath():

// Identify path to fstab file. Lookup is based on pattern fstab.&lt;hardware&gt;,
// fstab.&lt;hardware.platform&gt; in folders /odm/etc, /vendor/etc, or /.


Commit states:


  fstab contains device- and soc- specific content that should reside in
  /odm or /vendor partition. This change searches the fstab.${ro.hardware}
  file from /odm/etc, /vendor/etc and /, then use the first one found.


fstab contains entries for all filesystems to be mounted on boot or in recovery from partitions including system, vendor, userdata, cache, misc, persist, modem, dsp etc. See details in Android Partitions and Filesystems.

Some of the entries of fstab are moved to DTB. See "WHERE FSTAB IS?" in How to disable dm-verity on Android?