Салют!
Господа, поделитесь опытом настройки OverlayFS или подскажите, что у меня не так. Почитал про каскадно-объединенное монтирование и заинтересовался этой темой. Круто же делать Factory Reset, не снося при этом всю систему, а лишь потерев overlay. В качестве эксперимента выбрал OpenWRT. В данной ОС присутствует поддержка UBIFS(что круто для NAND с ее бэдблоками) и OverlayFS. Поставил все галки в менюконфиг:
CONFIG_MTD_NAND=y
CONFIG_MTD_UBI=y
CONFIG_UBIFS_FS=y
CONFIG_UBIFS_FS_ADVANCED_COMPR=y
CONFIG_UBIFS_FS_LZO=y
CONFIG_UBIFS_FS_ZLIB=y
CONFIG_UBIFS_FS_XZ=y
CONFIG_OVERLAY_FS=y
console=ttyAPP4,115200 rootfstype=ubifs ubi.mtd=5 root=ubi0:rootfs rw mtdparts=gpmi-nand:10m(bootloader)ro,256k(environment),128k(fdt),5m(kernel),40m(test)ro,100m(rootfs),-(rootfs_data)
...
[ 1.134122] 7 cmdlinepart partitions found on MTD device gpmi-nand
[ 1.140343] Creating 7 MTD partitions on "gpmi-nand":
[ 1.145561] 0x000000000000-0x000000a00000 : "bootloader"
[ 1.153670] 0x000000a00000-0x000000a40000 : "environment"
[ 1.161652] 0x000000a40000-0x000000a60000 : "fdt"
[ 1.168998] 0x000000a60000-0x000000f60000 : "kernel"
[ 1.176687] 0x000000f60000-0x000003760000 : "backupfs"
[ 1.184829] 0x000003760000-0x000009b60000 : "rootfs"
[ 1.193124] mtd: device 5 (rootfs) set to be root filesystem
[ 1.198907] 0x000009b60000-0x000010000000 : "rootfs_data"
...
[ 1.394409] ubi0: attaching mtd5
[ 1.667582] random: nonblocking pool is initialized
[ 2.470717] ubi0: scanning is finished
[ 2.496300] ubi0: attached mtd5 (name "rootfs", size 100 MiB)
[ 2.502217] ubi0: PEB size: 131072 bytes (128 KiB), LEB size: 126976 bytes
[ 2.509126] ubi0: min./max. I/O unit sizes: 2048/2048, sub-page size 2048
[ 2.516023] ubi0: VID header offset: 2048 (aligned 2048), data offset: 4096
[ 2.523097] ubi0: good PEBs: 800, bad PEBs: 0, corrupted PEBs: 0
[ 2.529133] ubi0: user volume: 1, internal volumes: 1, max. volumes count: 128
[ 2.536456] ubi0: max/mean erase counter: 2/1, WL threshold: 4096, image sequence number: 0
[ 2.544911] ubi0: available PEBs: 0, total reserved PEBs: 800, PEBs reserved for bad PEB handling: 40
[ 2.554302] hctosys: unable to open rtc device (rtc0)
[ 2.566705] ubi0: background thread "ubi_bgt0d" started, PID 398
[ 2.576833] UBIFS (ubi0:0): background thread "ubifs_bgt0_0" started, PID 400
[ 2.755247] UBIFS (ubi0:0): UBIFS: mounted UBI device 0, volume 0, name "rootfs"
[ 2.762823] UBIFS (ubi0:0): LEB size: 126976 bytes (124 KiB), min./max. I/O unit sizes: 2048 bytes/2048 bytes
[ 2.772864] UBIFS (ubi0:0): FS size: 94597120 bytes (90 MiB, 745 LEBs), journal size 9023488 bytes (8 MiB, 72 LEBs)
[ 2.783403] UBIFS (ubi0:0): reserved for root: 0 bytes (0 KiB)
[ 2.789282] UBIFS (ubi0:0): media format: w4/r0 (latest is w4/r0), UUID 17C375ED-CDDF-48C4-8838-65C460D470B7, small LPT model
[ 2.804563] VFS: Mounted root (ubifs filesystem) on device 0:11.
[ 2.811284] Freeing unused kernel memory: 132K (c03e1000 - c0402000)
[ 3.236962] init: Console is alive
...
[ 4.249978] init: - preinit -
Press the [f] key and hit [enter] to enter failsafe mode
Press the [1], [2], [3] or [4] key and hit [enter] to select the debug level
[ 7.769877] mount_root: loading kmods from internal overlay
[ 7.857823] blk_update_request: I/O error, dev mtdblock0, sector 0
[ 7.869474] blk_update_request: I/O error, dev mtdblock0, sector 0
[ 7.875708] Buffer I/O error on dev mtdblock0, logical block 0, async page read
[ 8.069201] block: attempting to load /etc/config/fstab
[ 8.091549] block: extroot: not configured
[ 8.097882] mount_root: no usable overlay filesystem found, using tmpfs overlay
And as result overlay is mounted at ram(/tmp). But I expected, that it was in /overlay.
root@OpenWrt:/# mount
ubi0:rootfs on /rom type ubifs (rw,relatime)
proc on /proc type proc (rw,nosuid,nodev,noexec,noatime)
sysfs on /sys type sysfs (rw,nosuid,nodev,noexec,noatime)
devpts on /rom/dev/pts type devpts (rw,nosuid,noexec,noatime,mode=600)
overlayfs:/tmp/root on / type overlay (rw,noatime,lowerdir=/,upperdir=/tmp/root/upper,workdir=/tmp/root/work)
devpts on /dev/pts type devpts (rw,nosuid,noexec,relatime,mode=600)
debugfs on /sys/kernel/debug type debugfs (rw,noatime)
root@OpenWrt:/# df -h
Filesystem Size Used Available Use% Mounted on
ubi0:rootfs 82.8M 2.8M 80.0M 3% /rom
overlayfs:/tmp/root 82.8M 2.8M 80.0M 3% /