OpenWrt Forum Archive

Topic: Yet another overlay issue

The content of this topic has been archived on 25 Mar 2018. There are no obvious gaps in this topic, but there may still be some posts missing at the end.

I upgraded my TP-Link TL-WR1043N/ND v1 to Barrier Breaker and after struggling to get external /overlay working right.

I thought I'd finally gotten it to work right, but it isn't.

Looking at mount and df, it shows /overlay mounted twice:

root@gateway:~# mount
rootfs on / type rootfs (rw)
/dev/root on /rom type squashfs (ro,relatime)
proc on /proc type proc (rw,noatime)
sysfs on /sys type sysfs (rw,noatime)
tmpfs on /tmp type tmpfs (rw,nosuid,nodev,noatime)
/dev/mtdblock3 on /overlay type jffs2 (rw,noatime)
overlayfs:/overlay on / type overlayfs (rw,noatime,lowerdir=/,upperdir=/overlay)
tmpfs on /dev type tmpfs (rw,relatime,size=512k,mode=755)
devpts on /dev/pts type devpts (rw,relatime,mode=600)
/dev/sda1 on /overlay type ext4 (rw,sync,relatime,data=ordered)
/dev/sdb1 on /mnt/sdb1 type ext3 (rw,relatime,data=ordered)
debugfs on /sys/kernel/debug type debugfs (rw,noatime)
root@gateway:~# df
Filesystem           1K-blocks      Used Available Use% Mounted on
rootfs                    4736      1540      3196  33% /
/dev/root                 2304      2304         0 100% /rom
tmpfs                    14428      1164     13264   8% /tmp
/dev/mtdblock3         6061632     13936   5716740   0% /overlay
overlayfs:/overlay        4736      1540      3196  33% /
tmpfs                      512         0       512   0% /dev
/dev/sda1              6061632     13936   5716740   0% /overlay
/dev/sdb1            775130320  19595940 716463500   3% /mnt/sdb1

All of my software updates only go to /dev/mtdblock3 and not /dev/sda1.

Here is my /etc/config/fstab

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

config swap
        option enabled '1'
        option device '/dev/sdb2'
        option uuid '6fc4f67d-a133-4917-8600-dcf13c28d3eb'

config mount
        option device '/dev/sda1'
        option uuid 'a5bbe536-2a68-4e1a-8af5-5aea38726e2a'
        option enabled '1'
        option fstype 'ext4'
        option target 'overlay'
        option  options 'rw,sync'

config mount
        option device '/dev/sdb1'
        option target '/mnt/sdb1'
        option enabled '1'
        option uuid '8723c28e-3db1-4370-8767-bdec0f804f70'
        option fstype 'ext3'

After going back and forth for a while doing the "overlay" vs "/overlay" finally got the external usb to mount on  /overlay, but it's obviously not writing to the usb disk.

I think I've read all the relevant posts and I'm out of ideas. Looking at my dmesg, I didn't see any place that /dev/sda1 was explicitly mounted.

I'm having the the same problem. Overlay mounts twice.

root@machine:~# df
Filesystem           1K-blocks      Used Available Use% Mounted on
rootfs                    2624      1568      1056  60% /
/dev/root                 2560      2560         0 100% /rom
tmpfs                    30720        56     30664   0% /tmp
/dev/mtdblock5         3790720    106300   3491860   3% /overlay
overlayfs:/overlay        2624      1568      1056  60% /
tmpfs                      512         0       512   0% /dev
/dev/sda1            480589524  84039464 372130784  18% /mnt/data
/dev/sdb2              3790720    106300   3491860   3% /overlay
root@machine:~# cat /etc/config/fstab
config 'global'
    option    anon_swap    '0'
    option    anon_mount    '0'
    option    auto_swap    '1'
    option    auto_mount    '1'
    option    delay_root    '90'
    option    check_fs    '0'

config 'mount'
    option    device    '/dev/sdb2'
    option    target    'overlay'
    option    enabled    '1'

config 'mount'
    option    target    '/mnt/data'
    option    uuid    '8f629b92-a2f9-43d8-a38a-a2a4e8ad491f'
    option    enabled    '1'

config 'swap'
    option    device    '/dev/sdb1'
    option    enabled    '1'

When it's like this, /overlay doesn't show the contents of sdb2, but when I unmount and remount it at /mnt/sdb2, everything that's supposed to be there. So it mounts fine. It just doesn't take the place of the initial overlay.

Looking at the post dates, this is very new. This happens to me too on a 1043nd. I had it working before until my flashdrive died. So i replaced it with a new one and did the process again. I'm seeing the same results you do:

Filesystem                Size      Used Available Use% Mounted on
rootfs                    4.6M      4.4M    200.0K  96% /
/dev/root                 2.3M      2.3M         0 100% /rom
tmpfs                    14.1M    360.0K     13.7M   2% /tmp
/dev/mtdblock3           58.0M      9.8M     43.6M  18% /overlay
overlayfs:/overlay        4.6M      4.4M    200.0K  96% /
tmpfs                   512.0K         0    512.0K   0% /dev
/dev/sda1                58.0M      9.8M     43.6M  18% /overlay
/dev/sda2               170.9M      1.5M    156.7M   1% /mnt/sda2

This is extremely annoying, here's my fstab:
config global
        option anon_swap '0'
        option anon_mount '0'
        option auto_swap '1'
        option auto_mount '1'
        option delay_root '20'
        option check_fs '0'

config mount
        option enabled '1'
        option target 'overlay'
        option uuid '9c65f960-7e76-41a6-bad9-ff06350516d1'

config mount
        option target '/mnt/sda2'
        option uuid '5317383f-1c83-49a2-94f8-b708210f8842'
        option enabled '1'
        option fstype 'ext4'


On the other side, I have a 2543nd working ok, and I'm clueless because I can't find any fstab setup corresponding to the df output:
fstab on 2543nd


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

config mount
        option enabled '1'
        option device '/dev/sda2'
        option target '/mnt/sda2'
        option fstype 'ext4'


df -h on 2543nd

Filesystem                Size      Used Available Use% Mounted on
rootfs                  120.0M      5.1M    105.9M   5% /
/dev/root                 2.3M      2.3M         0 100% /rom
tmpfs                    30.0M      1.0M     28.9M   3% /tmp
/dev/sda1               120.0M      5.1M    105.9M   5% /overlay
overlayfs:/overlay      120.0M      5.1M    105.9M   5% /
tmpfs                   512.0K         0    512.0K   0% /dev
/dev/sda2               850.6M    904.0K    789.7M   0% /mnt/sda2


How exactly does overlay gets mounted if it isn't written on fstab? Besides curiosity, I think this may lead to the solution of the above issue.

Both of them are running Barrier Breaker stable relase.
Cheers

Well, I think i managed to get it working. And, effectively, the overlay /etc/config/fstab entry "disappears" after the overlay has been configured correctly and the device is rebooted.
Here is the last /etc/fstab I used (and the one that worked)


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

config mount
        option enabled '1'
        option device '/dev/sda2'
        option target '/mnt/sda2'
        option fstype 'ext4'

config mount
        option device '/dev/sda1'
        option fstype 'ext4'
        option uuid '9c65f960-7e76-41a6-bad9-ff06350516d1'
        option is_rootfs '1'
        option enabled '1'
        option target '/overlay'

Maybe the option "is_rootfs" is redundant, so is the device one, but as this works, I'm not touching it anymore.

Here is what /etc/config/fstab looks like now:

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

config mount
        option target '/mnt/sda2'
        option uuid '5317383f-1c83-49a2-94f8-b708210f8842'
        option enabled '1'
        option fstype 'ext4'


Yet, overlay is working as it should now:

Filesystem                Size      Used Available Use% Mounted on
rootfs                   58.0M      9.8M     43.6M  18% /
/dev/root                 2.3M      2.3M         0 100% /rom
tmpfs                    14.1M    532.0K     13.6M   4% /tmp
/dev/sda1                58.0M      9.8M     43.6M  18% /overlay
overlayfs:/overlay       58.0M      9.8M     43.6M  18% /
tmpfs                   512.0K         0    512.0K   0% /dev
/dev/sda2               170.9M      1.5M    156.7M   1% /mnt/sda2

Huh, OK.

After fiddling with mine, I got it to work too.

I rearranged things to the same order as yours and added the  "option is_rootfs '1'" line as well as changing "option target 'overlay'" to "option target '/overlay'" and now it works.

I'd post my new fstab, but I think it's buried under the new overlay and I only see the one that was copied when I first created it. I'll have to go home and remove the overlay drive sometime and get a new copy of /overlay.

There must be a way to mount the overlayed filesystem somewhere else so I can copy it again.

Thanks.

James

I think you can mount the JFFS2 partition via

config mount
        option  target          /overlay-boot
        option  device          /dev/mtdblock3
        option  fstype          jffs2
        option  options         rw,sync
        option  enabled         1
        option  enabled_fsck    0

as detailed on the wiki (http://wiki.openwrt.org/doc/howto/extro … ginal_root).
Then you could copy the fstab. This also allows you to disable extroot, I think.

Is this what you mean?

(Last edited by lems on 25 Mar 2015, 16:23)

Yes, thank you.

Somehow I didn't think to look there, I just tried doing  a

mount -t jffs /dev/mtdblock3 /mnt/mtdblock3

but it complained about not finding /dev/mtdblock3. Reading the wiki at the link you provided made me realize that it was jffs2 (not jffs).

mount -t jffs2 /dev/mtdblock3 /mnt/mtdblock3

works.

James

Hi,

I'm facing the same problem and have not been able to fix it. I'm using CC r45250 on a WRT1900AC. Trying to get a 8GB USB-stick to act as overlay-system. However, both filesystems show mounted as /overlay. The /overlay-dir shows my USB stick but it's not reflected in the root system (which shows the internal flash)

root@OpenWrt:~# df
Filesystem           1K-blocks      Used Available Use% Mounted on
rootfs                   27180      4080     21676  16% /
/dev/root                 2304      2304         0 100% /rom
tmpfs                   127668        92    127576   0% /tmp
/dev/ubi0_1            7507828     24416   7078984   0% /overlay
overlayfs:/overlay       27180      4080     21676  16% /
ubi1:syscfg              31536       320     29572   1% /tmp/syscfg
tmpfs                      512         0       512   0% /dev
/dev/sda1              7507828     24416   7078984   0% /overlay

root@OpenWrt:~# find / -name "THIS_IS_*"
/overlay/upper/root/THIS_IS_THE_USB_DRIVE_8GB
/root/THIS_IS_THE_INTERNAL_DRIVE_27MB

Output mount:

rootfs on / type rootfs (rw)
/dev/root on /rom type squashfs (ro,relatime)
proc on /proc type proc (rw,noatime)
sysfs on /sys type sysfs (rw,noatime)
tmpfs on /tmp type tmpfs (rw,nosuid,nodev,noatime)
/dev/ubi0_1 on /overlay type ubifs (rw,noatime)
overlayfs:/overlay on / type overlay (rw,noatime,lowerdir=/,upperdir=/overlay/upper,workdir=/overlay/work)
ubi1:syscfg on /tmp/syscfg type ubifs (rw,relatime)
tmpfs on /dev type tmpfs (rw,relatime,size=512k,mode=755)
devpts on /dev/pts type devpts (rw,relatime,mode=600)
/dev/sda1 on /overlay type ext4 (rw,relatime,data=ordered)
debugfs on /sys/kernel/debug type debugfs (rw,noatime)

/etc/config/fstab

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

config 'mount'
    option    target    'overlay'
    option    uuid    '613e7d6f-ff15-4a2a-9896-c23a8c42fe77'
    option    enabled    '1'

I've tried all variations of fstab
- It definitely won't mount with '/overlay' instead of 'overlay'
- I've tried the exact same syntax as the example from maaw above with '/overlay', fstype, device, is_rootfs to no avail

Any ideas? Any help highly appreciated!


btw: My installation has a dead fstab-link in /etc. Is that of any relevance?

root@OpenWrt:~# ls -l /etc/fstab
lrwxrwxrwx    1 root     root            10 Apr  4 06:30 /etc/fstab -> /tmp/fstab
root@OpenWrt:~# ls -l /tmp/fstab
ls: /tmp/fstab: No such file or directory

This is the /etc/config/fstab that works for me:

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

config swap
        option enabled '1'
        option device '/dev/sdb2'
        option uuid '6fc4f67d-a133-4917-8600-dcf13c28d3eb'

config mount
        option device '/dev/sda1'
        option fstype 'ext4'
        option uuid 'a5bbe536-2a68-4e1a-8af5-5aea38726e2a'
        option is_rootfs '1'
        option enabled '1'
        option target '/overlay'
        option options 'rw,sync'

config mount
        option device '/dev/sdb1'
        option target '/mnt/sdb1'
        option enabled '1'
        option uuid '8723c28e-3db1-4370-8767-bdec0f804f70'
        option fstype 'ext3'

I don't think the "device ..." line means anything (especially considering that swap and overlay are on the same disk), but if you have more than one drive attached, I'd remove them and try it with just the overlay device and use that device name. Good luck.

Thanks. I gave it another try but no joy. Copying your exact syntax (with right id), the drive doesn't even mount (due to the '/' in front of overlay). :-(

root@OpenWrt:~# cat /etc/config/fstab
config global
        option anon_swap '0'
        option anon_mount '0'
        option auto_swap '1'
        option auto_mount '1'
        option delay_root '5'
        option check_fs '0'

config mount
        option device '/dev/sda1'
        option fstype 'ext4'
        option uuid '613e7d6f-ff15-4a2a-9896-c23a8c42fe77'
        option is_rootfs '1'
        option enabled '1'
        option target '/overlay'
        option options 'rw,sync'

root@OpenWrt:~# df
Filesystem           1K-blocks      Used Available Use% Mounted on
rootfs                   27180      4536     21220  18% /
/dev/root                 2304      2304         0 100% /rom
tmpfs                   127668        92    127576   0% /tmp
/dev/ubi0_1              27180      4536     21220  18% /overlay
overlayfs:/overlay       27180      4536     21220  18% /
ubi1:syscfg              31536       320     29572   1% /tmp/syscfg
tmpfs                      512         0       512   0% /dev

Seems like a regression from BB? Or has the extroot syntax/mechanism changed?

Look into your dmesg for extroot errors.

Nothing showing in dmesg. However, the dmesg-buffer seems crowded out by a lot of messages from the wireless-driver, would extroot show up before or after loading the wifi-module (mwlwifi)?

If before, is there a way to increase dmesg buffer size over reboot-cycle? Or alternatively a way to disable the wifi-module (tried taking it out of /etc/modules.d but it's on the /rom-partition and I couldn't remount it as rw)?

Thanks and apologies for basic questions...

Ok, figured out the dmesg-problem. When trying to mount my extroot, I get different behaviour/messages depending if I try to mount it (in /etc/config/fstab) as "overlay" or "/overlay".

When mounted with "overlay", my /dev/sda1 drive is mounted to /overlay (and I can access it there) but is not replacing the root-filesystem (/dev/ubi0_1 continues to be mounted and is acting as the upper overlay directory). Relevant dmesg-lines:

[   10.562273] block: extroot: not configured
[   10.594243] mount_root: switching to jffs2 overlay
<...other stuff...>
[   12.718480] EXT4-fs (sda1): mounting ext2 file system using the ext4 subsystem
[   12.759308] EXT4-fs (sda1): mounted filesystem without journal. Opts: 

When mounted with "/overlay", my /dev/sda1 drive is not mounted at all and /dev/ubi0_1 continues to be mounted as overlay-root-fs (as it would be without any extroot). Relevant dmesg-lines:

[   10.705470] EXT4-fs (sda1): mounting ext2 file system using the ext4 subsystem
[   10.730547] EXT4-fs (sda1): mounted filesystem without journal. Opts: 
[   10.737473] block: extroot: unable to lookup root device /dev/mtdblock7
[   10.804481] mount_root: switching to jffs2 overlay

Any pointers? There should be no jff2 involved I think (original overlay is on ubifs)? What's /dev/mtdblock7?

Many thanks!


Below the full dmesg-log from "overlay" for reference. The above is the only difference.

[    0.148372] pci 0000:03:00.0: reg 0x10: [mem 0x00000000-0x000fffff 64bit pref]
[    0.148393] pci 0000:03:00.0: reg 0x18: [mem 0x00000000-0x000fffff 64bit pref]
[    0.148479] pci 0000:03:00.0: supports D1 D2
[    0.148488] pci 0000:03:00.0: PME# supported from D0 D1 D3hot D3cold
[    0.148640] PCI: bus3: Fast back to back transfers disabled
[    0.148653] pci_bus 0000:03: busn_res: [bus 03-ff] end is updated to 03
[    0.148757] pci 0000:00:01.0: BAR 8: assigned [mem 0xf8000000-0xf80fffff]
[    0.148769] pci 0000:00:02.0: BAR 8: assigned [mem 0xf8200000-0xf83fffff]
[    0.148779] pci 0000:00:03.0: BAR 8: assigned [mem 0xf8400000-0xf85fffff]
[    0.148791] pci 0000:01:00.0: BAR 0: assigned [mem 0xf8000000-0xf8007fff 64bit]
[    0.148812] pci 0000:00:01.0: PCI bridge to [bus 01]
[    0.148823] pci 0000:00:01.0:   bridge window [mem 0xf8000000-0xf80fffff]
[    0.148837] pci 0000:02:00.0: BAR 0: assigned [mem 0xf8200000-0xf82fffff 64bit pref]
[    0.148859] pci 0000:02:00.0: BAR 2: assigned [mem 0xf8300000-0xf83fffff 64bit pref]
[    0.148878] pci 0000:00:02.0: PCI bridge to [bus 02]
[    0.148888] pci 0000:00:02.0:   bridge window [mem 0xf8200000-0xf83fffff]
[    0.148902] pci 0000:03:00.0: BAR 0: assigned [mem 0xf8400000-0xf84fffff 64bit pref]
[    0.148921] pci 0000:03:00.0: BAR 2: assigned [mem 0xf8500000-0xf85fffff 64bit pref]
[    0.148938] pci 0000:00:03.0: PCI bridge to [bus 03]
[    0.148948] pci 0000:00:03.0:   bridge window [mem 0xf8400000-0xf85fffff]
[    0.148992] pci 0000:00:01.0: enabling device (0140 -> 0142)
[    0.149014] pci 0000:01:00.0: enabling device (0140 -> 0142)
[    0.149171] mv_xor f1060900.xor: Marvell shared XOR driver 
[    0.171563] mv_xor f1060900.xor: Marvell XOR: ( xor cpy )
[    0.211536] mv_xor f1060900.xor: Marvell XOR: ( xor cpy )
[    0.211628] mv_xor f10f0900.xor: Marvell shared XOR drivabilityer
[    0.251534] mv_xor f10f0900.xor: Marvell XOR: ( xor cpy )
[    0.291533] mv_xor f10f0900.xor: Marvell XOR: ( xor cpy )
[    0.291722] Serial: 8250/16550 driver, 16 ports, IRQ sharing enabled
[    0.293414] console [ttyS0] disabled
[    0.313426] f1012000.serial: ttyS0 at MMIO 0xf1012000 (irq = 20, base_baud = 15625000) is a 16550A
[    0.970224] console [ttyS0] enabled
[    0.974448] pxa3xx-nand f10d0000.nand: This platform can't do DMA on this device
[    0.982066] nand: device found, Manufacturer ID: 0x01, Chip ID: 0xf1
[    0.988439] nand: AMD/Spansion S34ML01G1
[    0.992392] nand: 128MiB, SLC, page size: 2048, OOB size: 64
[    0.998070] pxa3xx-nand f10d0000.nand: ECC strength 16, ECC step size 2048
[    1.005311] Bad block table found at page 65472, version 0x01
[    1.011505] Bad block table found at page 65408, version 0x01
[    1.017480] nand_read_bbt: bad block at 0x000002e40000
[    1.022833] 9 ofpart partitions found on MTD device pxa3xx_nand-0
[    1.028944] Creating 9 MTD partitions on "pxa3xx_nand-0":
[    1.034393] 0x000000000000-0x000000100000 : "u-boot"
[    1.039828] 0x000000100000-0x000000140000 : "u_env"
[    1.045160] 0x000000140000-0x000000180000 : "s_env"
[    1.050467] 0x000000900000-0x000000a00000 : "devinfo"
[    1.055962] 0x000000a00000-0x000003200000 : "kernel1"
[    1.061531] 0x000000d00000-0x000003200000 : "ubi"
[    1.066736] 0x000003200000-0x000005a00000 : "kernel2"
[    1.072305] 0x000003500000-0x000005a00000 : "rootfs2"
[    1.077864] 0x000005a00000-0x000008000000 : "syscfg"
[    1.083875] m25p80 spi0.0: mr25h256 (32 Kbytes)
[    1.089537] libphy: Fixed MDIO Bus: probed
[    1.093803] libphy: orion_mdio_bus: probed
[    1.099173] mvneta f1070000.ethernet eth0: Using random mac address 26:8e:e2:5a:b5:0f
[    1.108228] mvneta f1074000.ethernet eth1: Using random mac address 7a:e4:e8:17:47:d3
[    1.123261] TCP: cubic registered
[    1.126606] NET: Registered protocol family 17
[    1.131133] bridge: automatic filtering via arp/ip/ip6tables has been deprecated. Update your scripts to load br_netfilter if you need this.
[    1.143881] Bridge firewalling registered
[    1.147923] 8021q: 802.1Q VLAN Support v1.8
[    1.152286] Registering SWP/SWPB emulation handler
[    1.159930] UBI: auto-attach mtd5
[    1.163354] UBI: attaching mtd5 to ubi0
[    1.729811] UBI: scanning is finished
[    1.757412] UBI: attached mtd5 (name "ubi", size 37 MiB) to ubi0
[    1.763506] UBI: PEB size: 131072 bytes (128 KiB), LEB size: 126976 bytes
[    1.770322] UBI: min./max. I/O unit sizes: 2048/2048, sub-page size 2048
[    1.777094] UBI: VID header offset: 2048 (aligned 2048), data offset: 4096
[    1.784043] UBI: good PEBs: 295, bad PEBs: 1, corrupted PEBs: 0
[    1.789988] UBI: user volume: 2, internal volumes: 1, max. volumes count: 128
[    1.797196] UBI: max/mean erase counter: 7/3, WL threshold: 4096, image sequence number: 1946813262
[    1.806322] UBI: available PEBs: 0, total reserved PEBs: 295, PEBs reserved for bad PEB handling: 19
[    1.815598] UBI: background thread "ubi_bgt0d" started, PID 321
[    1.822381] UBI: ubiblock0_0 created from ubi0:0(rootfs)
[    1.827734] ubiblock: device ubiblock0_0 (rootfs) set to be root filesystem
[    1.835884] mvsw61xx 1000000003.mvsw61xx: Found MV88E6172 at f1072004.mdio-mi:10
[    1.843373] mvsw61xx 1000000003.mvsw61xx: Using direct addressing
[    1.849612] drivers/rtc/hctosys.c: unable to open rtc device (rtc0)
[    1.867980] VFS: Mounted root (squashfs filesystem) readonly on device 254:0.
[    1.875514] Freeing unused kernel memory: 204K (c03fd000 - c0430000)
[    2.568325] init: failed to symlink /tmp -> /var
[    2.573207] init: Console is alive
[    3.912837] usbcore: registered new interface driver usbfs
[    3.918435] usbcore: registered new interface driver hub
[    3.923960] usbcore: registered new device driver usb
[    3.934576] SCSI subsystem initialized
[    3.941022] ehci_hcd: USB 2.0 'Enhanced' Host Controller (EHCI) Driver
[    3.948379] ehci-platform: EHCI generic platform driver
[    3.954653] ehci-orion: EHCI orion driver
[    3.958918] orion-ehci f1050000.usb: EHCI Host Controller
[    3.964430] orion-ehci f1050000.usb: new USB bus registered, assigned bus number 1
[    3.972176] orion-ehci f1050000.usb: irq 26, io mem 0xf1050000
[    3.991598] orion-ehci f1050000.usb: USB 2.0 started, EHCI 1.00
[    3.998540] hub 1-0:1.0: USB hub found
[    4.002469] hub 1-0:1.0: 1 port detected
[    4.012542] libata version 3.00 loaded.
[    4.014234] sata_mv f10a0000.sata: version 1.28
[    4.014484] sata_mv f10a0000.sata: slots 32 ports 1
[    4.020423] scsi host0: sata_mv
[    4.023970] ata1: SATA max UDMA/133 irq 29
[    4.371598] ata1: SATA link down (SStatus 0 SControl F300)
[    4.380394] xhci_hcd 0000:01:00.0: xHCI Host Controller
[    4.385742] xhci_hcd 0000:01:00.0: new USB bus registered, assigned bus number 2
[    4.394470] hub 2-0:1.0: USB hub found
[    4.398338] hub 2-0:1.0: 2 ports detected
[    4.402945] xhci_hcd 0000:01:00.0: xHCI Host Controller
[    4.408228] xhci_hcd 0000:01:00.0: new USB bus registered, assigned bus number 3
[    4.416741] hub 3-0:1.0: USB hub found
[    4.420600] hub 3-0:1.0: 2 ports detected
[    4.438777] usbcore: registered new interface driver usb-storage
[    4.582513] init: - preinit -
[    4.761693] usb 2-2: new high-speed USB device number 2 using xhci_hcd
[    4.968794] usb-storage 2-2:1.0: USB Mass Storage device detected
[    4.975661] scsi host1: usb-storage 2-2:1.0
[    4.987532] random: procd urandom read with 106 bits of entropy available
[    5.941258] random: nonblocking pool is initialized
[    5.974133] scsi 1:0:0:0: Direct-Access     Mass     Storage Device        PQ: 0 ANSI: 0 CCS
[    5.986698] sd 1:0:0:0: [sda] 15523839 512-byte logical blocks: (7.94 GB/7.40 GiB)
[    5.995319] sd 1:0:0:0: [sda] Write Protect is off
[    6.000172] sd 1:0:0:0: [sda] Mode Sense: 03 00 00 00
[    6.002024] sd 1:0:0:0: [sda] No Caching mode page found
[    6.007393] sd 1:0:0:0: [sda] Assuming drive cache: write through
[    6.041785]  sda: sda1
[    6.047009] sd 1:0:0:0: [sda] Attached SCSI removable disk
[    9.240738] UBIFS: background thread "ubifs_bgt0_1" started, PID 459
[    9.359938] UBIFS: recovery needed
[    9.707169] UBIFS: recovery completed
[    9.710964] UBIFS: mounted UBI device 0, volume 1, name "rootfs_data"
[    9.717487] UBIFS: LEB size: 126976 bytes (124 KiB), min./max. I/O unit sizes: 2048 bytes/2048 bytes
[    9.726722] UBIFS: FS size: 30855168 bytes (29 MiB, 243 LEBs), journal size 1523712 bytes (1 MiB, 12 LEBs)
[    9.736458] UBIFS: reserved for root: 1457365 bytes (1423 KiB)
[    9.742384] UBIFS: media format: w4/r0 (latest is w4/r0), UUID 63508186-72F7-47FD-A164-E3BF7EF1BF26, small LPT model
[    9.779387] mount_root: loading kmods from internal overlay
[   10.541285] block: attempting to load /tmp/ubifs_cfg/upper/etc/config/fstab
[   10.562273] block: extroot: not configured
[   10.594243] mount_root: switching to jffs2 overlay
[   10.901140] UBI: attaching mtd8 to ubi1
[   11.471583] UBI: scanning is finished
[   11.497727] UBI warning: print_rsvd_warning: cannot reserve enough PEBs for bad PEB handling, reserved 2, need 12
[   11.509519] UBI: attached mtd8 (name "syscfg", size 38 MiB) to ubi1
[   11.515871] UBI: PEB size: 131072 bytes (128 KiB), LEB size: 126976 bytes
[   11.522745] UBI: min./max. I/O unit sizes: 2048/2048, sub-page size 2048
[   11.529633] UBI: VID header offset: 2048 (aligned 2048), data offset: 4096
[   11.536582] UBI: good PEBs: 296, bad PEBs: 8, corrupted PEBs: 0
[   11.542573] UBI: user volume: 1, internal volumes: 1, max. volumes count: 128
[   11.549740] UBI: max/mean erase counter: 13/10, WL threshold: 4096, image sequence number: 1344184781
[   11.559047] UBI: available PEBs: 0, total reserved PEBs: 296, PEBs reserved for bad PEB handling: 2
[   11.568241] UBI: background thread "ubi_bgt1d" started, PID 473
[   11.598573] UBIFS: background thread "ubifs_bgt1_0" started, PID 478
[   11.946644] UBIFS: mounted UBI device 1, volume 0, name "syscfg"
[   11.952739] UBIFS: LEB size: 126976 bytes (124 KiB), min./max. I/O unit sizes: 2048 bytes/2048 bytes
[   11.961954] UBIFS: FS size: 35680256 bytes (34 MiB, 281 LEBs), journal size 1777664 bytes (1 MiB, 14 LEBs)
[   11.971687] UBIFS: reserved for root: 1685265 bytes (1645 KiB)
[   11.977552] UBIFS: media format: w4/r0 (latest is w4/r0), UUID 74FC1652-AEE4-415E-A3DD-C3A6E6830FA9, small LPT model
[   12.006853] procd: - early -
[   12.718480] EXT4-fs (sda1): mounting ext2 file system using the ext4 subsystem
[   12.726788] procd: - ubus -
[   12.759308] EXT4-fs (sda1): mounted filesystem without journal. Opts: 
[   13.735561] procd: - init -
[   14.854082] NET: Registered protocol family 10
[   14.872783] tun: Universal TUN/TAP device driver, 1.6
[   14.877873] tun: (C) 1999-2004 Max Krasnyansky <maxk@qualcomm.com>
[   14.887594] ip6_tables: (C) 2000-2006 Netfilter Core Team
[   14.901881] Loading modules backported from Linux version master-2015-03-09-0-g141f155
[   14.909837] Backport generated by backports.git backports-20150129-0-gdd4a670
[   14.926170] cfg80211: Calling CRDA to update world regulatory domain
[   14.932786] cfg80211: World regulatory domain updated:
[   14.937958] cfg80211:  DFS Master region: unset
[   14.942447] cfg80211:   (start_freq - end_freq @ bandwidth), (max_antenna_gain, max_eirp), (dfs_cac_time)
[   14.952305] cfg80211:   (2402000 KHz - 2472000 KHz @ 40000 KHz), (N/A, 2000 mBm), (N/A)
[   14.960368] cfg80211:   (2457000 KHz - 2482000 KHz @ 40000 KHz), (N/A, 2000 mBm), (N/A)
[   14.968444] cfg80211:   (2474000 KHz - 2494000 KHz @ 20000 KHz), (N/A, 2000 mBm), (N/A)
[   14.976526] cfg80211:   (5170000 KHz - 5250000 KHz @ 80000 KHz), (N/A, 2000 mBm), (N/A)
[   14.984613] cfg80211:   (5250000 KHz - 5330000 KHz @ 80000 KHz, 160000 KHz AUTO), (N/A, 2000 mBm), (0 s)
[   14.994178] cfg80211:   (5490000 KHz - 5730000 KHz @ 160000 KHz), (N/A, 2000 mBm), (0 s)
[   15.002342] cfg80211:   (5735000 KHz - 5835000 KHz @ 80000 KHz), (N/A, 2000 mBm), (N/A)
[   15.010379] cfg80211:   (57240000 KHz - 63720000 KHz @ 2160000 KHz), (N/A, 0 mBm), (N/A)
[   15.020164] i2c /dev entries driver
[   15.112211] ip_tables: (C) 2000-2006 Netfilter Core Team
[   15.127952] nf_conntrack version 0.5.0 (3989 buckets, 15956 max)
[   16.221585] rtc-mv f1010300.rtc: internal RTC not ticking
[   16.268330] xt_time: kernel timezone is -0000
[   16.283069] PPP generic driver version 2.4.2
[   16.288739] NET: Registered protocol family 24
[   17.301585] rtc-mv f1010300.rtc: internal RTC not ticking
[   18.341585] rtc-mv f1010300.rtc: internal RTC not ticking
[   19.381584] rtc-mv f1010300.rtc: internal RTC not ticking
[   23.451957] device eth0 entered promiscuous mode
[   23.458288] br-lan: port 1(eth0) entered forwarding state
[   23.463800] br-lan: port 1(eth0) entered forwarding state
[   23.483986] IPv6: ADDRCONF(NETDEV_UP): eth1: link is not ready
[   24.432113] br-lan: port 1(eth0) entered disabled state
[   25.441610] mvneta f1070000.ethernet eth0: link up
[   25.446464] br-lan: port 1(eth0) entered forwarding state
[   25.451981] br-lan: port 1(eth0) entered forwarding state
[   25.481642] mvneta f1074000.ethernet eth1: link up
[   25.486492] IPv6: ADDRCONF(NETDEV_CHANGE): eth1: link becomes ready
[   27.451534] br-lan: port 1(eth0) entered forwarding state

Ok, after reading through block.c in fstools I might have found the problem, even if I'm not sure how to fix it.

check_extroot() calls find_block_mtd() which looks for a "rootfs" in /proc/mtd. However, to my understanding the WRT1900AC has always 2 images, one acting as backup. Hence my /proc/mtd looks like this

root@OpenWrt:~# cat /proc/mtd
dev:    size   erasesize  name
mtd0: 00100000 00020000 "u-boot"
mtd1: 00040000 00020000 "u_env"
mtd2: 00040000 00020000 "s_env"
mtd3: 00100000 00020000 "devinfo"
mtd4: 02800000 00020000 "kernel1"
mtd5: 02500000 00020000 "ubi"
mtd6: 02800000 00020000 "kernel2"
mtd7: 02500000 00020000 "rootfs2"
mtd8: 02600000 00020000 "syscfg"
mtd9: 00008000 00008000 "spi0.0"

mtd7 ("rootfs2") is the stock Linksys-firmware which is still in the backup-partition, even if I don't use it (my root is in /dev/mtd5). block is finding it and seems to be getting confused.

I neither have full understanding of this nor the compile-environment to test but could it be that it should be like this?

--- block.c    2015-04-09 12:36:09.000000000 +0100
+++ block-new.c    2015-04-09 12:37:07.000000000 +0100
@@ -969,7 +969,7 @@
     char devpath[32];
 
 #ifdef UBIFS_EXTROOT
-    if (find_block_mtd("rootfs", devpath, sizeof(devpath))) {
+    if (find_block_mtd("ubi", devpath, sizeof(devpath))) {
         int err = -1;
         libubi_t libubi;

I'm guessing here from reading the source, could somebody with better understanding weigh in? Thanks!

Ok, recompiled fstools and managed to get it working. The above patch is obviously wrong, here's what made it work for me:

--- block.c    2015-04-09 12:36:09.000000000 +0100
+++ block-new.c    2015-04-09 14:46:00.000000000 +0100
@@ -969,7 +969,7 @@
     char devpath[32];
 
 #ifdef UBIFS_EXTROOT
-    if (find_block_mtd("rootfs", devpath, sizeof(devpath))) {
+    if (find_block_mtd("rootfs\"", devpath, sizeof(devpath))) {
         int err = -1;
         libubi_t libubi;

Maybe not the most clean solution and should potentially be changed in more places but works now. Will try to file a ticket, so someone with more knowledge of fstools can fix this properly.

root@OpenWrt:~# df
Filesystem           1K-blocks      Used Available Use% Mounted on
rootfs                 7507828     25360   7078040   0% /
/dev/root                 2304      2304         0 100% /rom
tmpfs                   127668        92    127576   0% /tmp
/dev/sda1              7507828     25360   7078040   0% /overlay
overlayfs:/overlay     7507828     25360   7078040   0% /
ubi1:syscfg              31536       320     29572   1% /tmp/syscfg
tmpfs                      512         0       512   0% /dev

Can I fix this bug without recompiling?  (or how I can recompile it on my router?)
On the trunk and barrier_breaker 14.07 versionI have same bug.
Do same steps like http://wiki.openwrt.org/doc/howto/extro … ot_overlay
and get same result (like in howto):

Filesystem           1K-blocks      Used Available Use% Mounted on
rootfs                   27180      7796     17964  30% /
...... cut.......
overlayfs:/overlay       27180      7796     17964  30% /
/dev/sda1              1998672      8056   1869376   0% /overlay

(Last edited by intention on 10 Apr 2015, 12:50)

I put my updated block-mount here (http://wikisend.com/download/160738/blo … _mvebu.ipk). You could try installing that one (it's against CC v45250, you might have to force dependencies).

The fix has now also gone into trunk (https://dev.openwrt.org/changeset/45341), so should be in tomorrow's snapshot image as well.

btw: The CC-section in the wiki states that you need to mount to "overlay" in fstab which seems wrong, since only "/overlay" works (as in AA and BB).

Does this fix only apply to mvebu or ar71xx as well?

The discussion might have continued from here.