X86 - overlay not working

Build: Reboot (SNAPSHOT, r5198-471d5dc6e3)
Hardware: VirtualBox 5.2.0 (1 CPU / 64MB RAM)
Disk 1: lede-x86-generic-combined-squashfs.img converted to vdi
Disk 2: vdi with ext4 / f2fs and swap partition

compiled with build system with:
Target Images -> Pad images to filesystem size (for JFFS2) set to yes

Same "dmesg" on every reboot. system never using configured partition as overlay.

/etc/config/fstab

config global
	option anon_swap '0'
	option anon_mount '0'
	option auto_swap '1'
	option auto_mount '1'
	option delay_root '15'
	option check_fs '0'

config mount
	option target '/mnt/loop0'
	option uuid '569c6576-a9ea-47a0-a0d9-33a4eba7bc85'
	option enabled '0'

config mount
	option target '/mnt/sda1'
	option uuid '57f8f4bc-abf4-655f-bf67-946fc0f9f25b'
	option enabled '0'

config mount
	option target '/mnt/sda2'
	option uuid 'af21cd8d-574cb928-df242868-55b974f1'
	option enabled '0'

config mount
	option target '/mnt/sdb1'
	option uuid '6c3323be-53bd-4860-aa96-0dfd38b3979d'
	option enabled '0'

config mount
	option uuid '2f6299fc-917b-4fe6-a3a5-8c9e21442635'
	option target '/overlay'
	option device '/dev/sdb2'
	option fstype 'f2fs'
	option enabled '1'

config swap
	option uuid '2830b8c7-ffe5-4536-b366-6421dd586ded'
	option enabled '0'

block info:

/dev/loop0: UUID="569c6576-a9ea-47a0-a0d9-33a4eba7bc85" VERSION="1.9" MOUNT="/overlay" TYPE="f2fs"
/dev/sda1: UUID="57f8f4bc-abf4-655f-bf67-946fc0f9f25b" VERSION="1.0" MOUNT="/boot" TYPE="ext4"
/dev/sda2: UUID="af21cd8d-574cb928-df242868-55b974f1" VERSION="4.0" MOUNT="/rom" TYPE="squashfs"
/dev/sdb1: UUID="6c3323be-53bd-4860-aa96-0dfd38b3979d" LABEL="service-data" VERSION="1.0" TYPE="ext4"
/dev/sdb2: UUID="2f6299fc-917b-4fe6-a3a5-8c9e21442635" VERSION="1.7" TYPE="f2fs"
/dev/sdb3: UUID="2830b8c7-ffe5-4536-b366-6421dd586ded" LABEL="swap" VERSION="1" TYPE="swap"

dmesg:

[    0.926887] ata1.00: ATA-6: VBOX HARDDISK, 1.0, max UDMA/133
[    0.928467] ata1.00: 558080 sectors, multi 128: LBA 
[    0.929951] ata1.01: ATA-6: VBOX HARDDISK, 1.0, max UDMA/133
[    0.931499] ata1.01: 16777216 sectors, multi 128: LBA 
[    0.933681] ata1.00: configured for UDMA/100
[    0.935454] ata1.01: configured for UDMA/100
[    0.936974] scsi 0:0:0:0: Direct-Access     ATA      VBOX HARDDISK    1.0  PQ: 0 ANSI: 5
[    0.939668] sd 0:0:0:0: [sda] 558080 512-byte logical blocks: (286 MB/273 MiB)
[    0.942132] sd 0:0:0:0: [sda] Write Protect is off
[    0.943577] sd 0:0:0:0: [sda] Mode Sense: 00 3a 00 00
[    0.943652] scsi 0:0:1:0: Direct-Access     ATA      VBOX HARDDISK    1.0  PQ: 0 ANSI: 5
[    0.946737] sd 0:0:0:0: [sda] Write cache: enabled, read cache: enabled, doesn't support DPO or FUA
[    0.949539] sd 0:0:1:0: [sdb] 16777216 512-byte logical blocks: (8.59 GB/8.00 GiB)
[    0.952042] sd 0:0:1:0: [sdb] Write Protect is off
[    0.953518] sd 0:0:1:0: [sdb] Mode Sense: 00 3a 00 00
[    0.953892]  sda: sda1 sda2
[    0.954539] sd 0:0:0:0: [sda] Attached SCSI disk
[    0.955157] sd 0:0:1:0: [sdb] Write cache: enabled, read cache: enabled, doesn't support DPO or FUA
[    0.956542]  sdb: sdb1 sdb2 sdb3
[    0.957205] sd 0:0:1:0: [sdb] Attached SCSI disk
[    0.958856] VFS: Mounted root (squashfs filesystem) readonly on device 8:2.
[    0.959625] Freeing unused kernel memory: 564K
[    0.960247] Write protecting the kernel text: 6192k
[    0.960890] Write protecting the kernel read-only data: 3008k
[    0.961540] NX-protecting the kernel data: 4048k
[    1.009677] init: Console is alive
[    1.045214] kmodloader: loading kernel modules from /etc/modules-boot.d/*
[    1.053365] pps_core: LinuxPPS API ver. 1 registered
[    1.054013] pps_core: Software ver. 5.3.6 - Copyright 2005-2007 Rodolfo Giometti <giometti@linux.it>
[    1.055165] PTP clock support registered
[    1.056319] Button Hotplug driver version 0.4.1
[    1.056952] kmodloader: done loading kernel modules from /etc/modules-boot.d/*
[    1.063443] init: - preinit -
[    1.131942] random: jshn: uninitialized urandom read (4 bytes read)
[    1.134537] random: jshn: uninitialized urandom read (4 bytes read)
[    1.136003] random: jshn: uninitialized urandom read (4 bytes read)
[    1.138657] random: jshn: uninitialized urandom read (4 bytes read)
[    1.140334] random: jshn: uninitialized urandom read (4 bytes read)
[    1.142016] random: jshn: uninitialized urandom read (4 bytes read)
[    1.144540] random: jshn: uninitialized urandom read (4 bytes read)
[    1.385777] tsc: Refined TSC clocksource calibration: 3399.116 MHz
[    1.387464] clocksource: tsc: mask: 0xffffffffffffffff max_cycles: 0x30ff0b5a858, max_idle_ns: 440795290718 ns
[    4.159177] random: jshn: uninitialized urandom read (4 bytes read)
[    4.181678] mount_root: loading kmods from internal overlay
[    4.183669] kmodloader: loading kernel modules from //etc/modules-boot.d/*
[    4.184729] kmodloader: done loading kernel modules from //etc/modules-boot.d/*
[    4.552387] block: attempting to load /etc/config/fstab
[    4.553933] block: unable to load configuration (fstab: Entry not found)
[    4.554815] block: no usable configuration
[    4.560417] random: procd: uninitialized urandom read (4 bytes read)
[    5.043301] block: attempting to load /etc/config/fstab
[    5.044839] block: unable to load configuration (fstab: Entry not found)
[    5.046539] block: no usable configuration
[    5.048121] mount_root: switching to f2fs overlay
[    5.079369] EXT4-fs (sda1): mounted filesystem without journal. Opts: (null)
[    5.082206] urandom-seed: Seeding with /etc/urandom.seed
[    5.101576] procd: - early -
[    5.610768] procd: - ubus -
[    5.632502] random: ubusd: uninitialized urandom read (4 bytes read)
[    5.666605] procd: - init -

Valid for OpenWrt 18.06.1 and snapshot as well:
https://bugs.openwrt.org/index.php?do=details&task_id=2273

i met this in 21.02-rc4 that is installed in kvm.

1 Like

Do you find a way out of this? I met this on stable release of 21.02

1 Like

I'm failing to use extroot (this guide) on my x86 router (APU3D4). I configured sda4 as /overlay but kernel logs:

[    8.500753] block: attempting to load /etc/config/fstab
[    8.506189] block: unable to load configuration (fstab: Entry not found)
[    8.512947] block: no usable configuration
[    8.517913] mount_root: switching to f2fs overlay

The proper /etc/config/fstab is on both the original, /dev/loop0, overlay, as well as the new /dev/sda4 overlay.

1 Like

## FS#2231 - fstools: PREINIT calling of block extroot doesn't acknowledge non-MTD rootfs overlays

This is a bug and not fixed yet.

2 Likes

It is not a solution (as solved !) because the fix is not upstream and the bug remains unfixed in 21.02.0 !

I have tired to patch the source code and compile the firmware. But it can not fix this issue.

I get some success with ext4 firmware and f2fs overlay…
For me the overlay issue appears only with squashfs firmware !

It is easy to change root partition with ext4 firmware. Overlay is not necessary.
But the root partition of squashfs firmeare is so small, so an overlay fs is needed to extend root partion to intall more softwares.

1 Like

squashfs do not work with overlay on other storage devices than MTD !

Yes, but it is also so easy to crash it...
So extroot or overlay is a good enhancement, also for ext4 firmware !

1 Like

Hi @erdoukki !

Seems we are facing the same issue, but I will let you confirm.

Still with a raspberry and SD card.
With squashfs (on /dev/mmcblk0p2), the "external" (/dev/mmcblk0p3) partition never mounts on /overlay.
/etc/config/fstab from f2fs located on /dev/mmcblk0p2 and also from /dev/mmcblk0p3 are not used.

But : if a create a custom build image with fstab containing the "external" overlay, it works.
Here is my /etc/config/fstab content built in custom squashfs image:

config global
        option anon_swap '0'
        option anon_mount '0'
        option auto_swap '1'
        option auto_mount '1'
        option check_fs '1'

config mount 'overlay'
        option enabled '1'
        option device '/dev/mmcblk0p3'
        option target '/overlay'
        option fstype 'ext4'
        option enabled_fsck '1'

So, I looked a /etc/uci-defaults/10-fstab:

[ ! -f /etc/config/fstab ] && ( block detect > /etc/config/fstab )
exit 0

and thought that the problem is because I don't have fstab file, so it get generated at boot.

Then I created an empty fstab in my custom image: no success.
Then I created a fstab file with only global parameters: no success.

Is it what we are talking about here or should I open a new thread ?

1 Like

@orfait

Yes, it look like very closed to the issue were facing here...

I will look closer to your specifics tests !
Thanks for the advice.

In facts the problem seem to be more general than only x86, I have on ARM64.
I think it is a problem on MMC/uSD devices with squashfs+overlayfs !?