I wish to auto-mount an image file at system start-up using UnionFS and overlay settings files (e.g. /etc/network/interfaces) on top of the stock /etc directory files allowing for user customisation.I'm using an embedded Linux distro (Kernel 3.14.28, just in case you were wondering) and can manually achieve the desired result after the system reaches the login prompt. I now wish to automate the process during system start-up.My thinking was that /etc/fstab would provide all the functionality required to achieve this. However, I'm experiencing difficulty with auto-mounting the FAT partition and subsequent UnionFS mount during system boot.My /etc/fstab can be seen below:# start: /etc/fstab file/dev/root   /               auto       defaults              1  1proc        /proc           proc       defaults              0  0devpts      /dev/pts        devpts     mode=0620,gid=5       0  0usbdevfs    /proc/bus/usb   usbdevfs   noauto                0  0tmpfs       /run            tmpfs      mode=0755,nodev,nosuid,strictatime 0  0tmpfs       /var/volatile   tmpfs      defaults              0  0# mount the user data image and then mount the unionfs user setting overlays/dev/mmcblk2p1/userdata.img      /userdata       vfat    loop,auto,rw,exec                               0       0/userdata/etc               /etc            unionfs    dirs=/userdata/etc=rw:/etc=ro,auto   0       0# end: /etc/fstab fileDuring boot I see:...EXT3-fs (mmcblk2p3): mounted filesystem with ordered data modeVFS: Mounted root (ext3 filesystem) readonly on device 179:11.devtmpfs: mountedFreeing unused kernel memory: 352K (80e3b000 - 80e93000)INIT: version 2.88 bootingunionfs: error accessing lower directory '/userdata/etc' (error -2)unionfs: read_super: error while parsing options (err = -2)Starting udevudevd[187]: starting version 182EXT3-fs (mmcblk2p5): using internal journalEXT3-fs (mmcblk2p5): mounted filesystem with ordered data modeFAT-fs (mmcblk1p1): Volume was not properly unmounted. Some data may be corrupt. Please run fsck.EXT3-fs (mmcblk1p2): warning: mounting fs with errors, running e2fsck is recommendedEXT3-fs (mmcblk1p2): using internal journalEXT3-fs (mmcblk1p2): mounted filesystem with ordered data modeFAT-fs (mmcblk2p1): Volume was not properly unmounted. Some data may be corrupt. Please run fsck.EXT3-fs (mmcblk2p2): using internal journalEXT3-fs (mmcblk2p2): mounted filesystem with ordered data modeEXT3-fs (mmcblk2p3): using internal journal...It appears that the system is trying to perform the UnionFS mount before the mount-point (/userdata) is ready. My understanding was that partitions listed in /etc/fstab are mounted sequentially. If this is not the case please educate me;)So, my question is : How can I change the /etc/fstab (and any other files) to get the auto-mount effect that I want? Thanks in advance
Automount image file as UnionFS overlay
linux