OpenWrt Forum Archive

Topic: Help: extremely bizarre problem with USB storage

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

Hi folks!

I am experiencing some really bizarre problems with my OpenWrt installtion. I am running Barrier Braker on a TP-LINK WDR3600 as a torrent client behind an OpenVPN connection. I used a 32GB USB Stick attached to the second UBS port for storing torrents and a 4GB LG stick attached to the first USB port for overlay and swap.

Couple of days ago the 32GB USB stick failed so today I replaced it with a new 64GB SanDisk. The moment I rebooted the router with the USB in it however, something weird happened - the router was not accessible from my machine. At first I thought it didn't boot properly, but after further inspection it turned out it's booted, but with a completely new root folder, as if the router has been flashed clean. Taking the USB stick out and rebooting the router brings it back to its normal condition.

I have tried using different USB sticks since then, but the same thing always happens. I suspect it has something to do with overlay not functioning properly but I have no idea what it could possibly be, as I haven't changed anything at all, just replaced the USB stick.

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 '15'
        option check_fs '0'

config swap
        option device '/dev/sda2'
        option enabled '0'

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

And here's the system log when booting the router with a USB stick inserted in USB2:

Wed Oct  1 12:01:10 2014 kern.info kernel: [    4.670000] ehci-platform ehci-platform: irq 3, io mem 0x1b000000
Wed Oct  1 12:01:10 2014 kern.info kernel: [    4.700000] ehci-platform ehci-platform: USB 2.0 started, EHCI 1.00
Wed Oct  1 12:01:10 2014 kern.info kernel: [    4.700000] hub 1-0:1.0: USB hub found
Wed Oct  1 12:01:10 2014 kern.info kernel: [    4.710000] hub 1-0:1.0: 1 port detected
Wed Oct  1 12:01:10 2014 kern.info kernel: [    5.030000] usb 1-1: new high-speed USB device number 2 using ehci-platform
Wed Oct  1 12:01:10 2014 kern.info kernel: [    5.180000] hub 1-1:1.0: USB hub found
Wed Oct  1 12:01:10 2014 kern.info kernel: [    5.180000] hub 1-1:1.0: 4 ports detected
Wed Oct  1 12:01:10 2014 kern.info kernel: [    5.470000] usb 1-1.1: new high-speed USB device number 3 using ehci-platform
Wed Oct  1 12:01:10 2014 kern.info kernel: [    5.660000] usb 1-1.2: new high-speed USB device number 4 using ehci-platform
Wed Oct  1 12:01:10 2014 kern.info kernel: [    6.450000] eth0: link up (1000Mbps/Full duplex)
Wed Oct  1 12:01:10 2014 kern.notice kernel: [    8.350000] jffs2: notice: (374) jffs2_build_xattr_subsystem: complete building xattr subsystem, 21 of xdatum (1 unchecked, 20 orphan) and 34 of xref (0 dead, 20 orphan) found.
Wed Oct  1 12:01:10 2014 kern.notice kernel: [    9.020000] SCSI subsystem initialized
Wed Oct  1 12:01:10 2014 kern.info kernel: [    9.030000] usb-storage 1-1.1:1.0: USB Mass Storage device detected
Wed Oct  1 12:01:10 2014 kern.info kernel: [    9.040000] scsi0 : usb-storage 1-1.1:1.0
Wed Oct  1 12:01:10 2014 kern.info kernel: [    9.050000] usb-storage 1-1.2:1.0: USB Mass Storage device detected
Wed Oct  1 12:01:10 2014 kern.info kernel: [    9.050000] scsi1 : usb-storage 1-1.2:1.0
Wed Oct  1 12:01:10 2014 kern.info kernel: [    9.060000] usbcore: registered new interface driver usb-storage
Wed Oct  1 12:01:10 2014 kern.notice kernel: [   10.050000] scsi 0:0:0:0: Direct-Access     SanDisk  Ultra Fit        1.00 PQ: 0 ANSI: 6
Wed Oct  1 12:01:10 2014 kern.notice kernel: [   10.060000] scsi 1:0:0:0: Direct-Access     LG       USB Drive        1100 PQ: 0 ANSI: 0 CCS
Wed Oct  1 12:01:10 2014 kern.notice kernel: [   10.070000] sd 0:0:0:0: [sda] 121438208 512-byte logical blocks: (62.1 GB/57.9 GiB)
Wed Oct  1 12:01:10 2014 kern.notice kernel: [   10.080000] sd 0:0:0:0: [sda] Write Protect is off
Wed Oct  1 12:01:10 2014 kern.debug kernel: [   10.080000] sd 0:0:0:0: [sda] Mode Sense: 43 00 00 00
Wed Oct  1 12:01:10 2014 kern.notice kernel: [   10.080000] sd 0:0:0:0: [sda] Write cache: disabled, read cache: enabled, doesn't support DPO or FUA
Wed Oct  1 12:01:10 2014 kern.notice kernel: [   10.090000] sd 1:0:0:0: [sdb] 7864320 512-byte logical blocks: (4.02 GB/3.75 GiB)
Wed Oct  1 12:01:10 2014 kern.notice kernel: [   10.100000] sd 1:0:0:0: [sdb] Write Protect is off
Wed Oct  1 12:01:10 2014 kern.debug kernel: [   10.110000] sd 1:0:0:0: [sdb] Mode Sense: 43 00 00 00
Wed Oct  1 12:01:10 2014 kern.err kernel: [   10.110000] sd 1:0:0:0: [sdb] No Caching mode page found
Wed Oct  1 12:01:10 2014 kern.err kernel: [   10.110000] sd 1:0:0:0: [sdb] Assuming drive cache: write through
Wed Oct  1 12:01:10 2014 kern.err kernel: [   10.120000] sd 1:0:0:0: [sdb] No Caching mode page found
Wed Oct  1 12:01:10 2014 kern.err kernel: [   10.130000] sd 1:0:0:0: [sdb] Assuming drive cache: write through
Wed Oct  1 12:01:10 2014 kern.info kernel: [   10.140000]  sda: sda1
Wed Oct  1 12:01:10 2014 kern.notice kernel: [   10.150000] sd 0:0:0:0: [sda] Attached SCSI removable disk
Wed Oct  1 12:01:10 2014 kern.info kernel: [   10.180000]  sdb: sdb1 sdb2
Wed Oct  1 12:01:10 2014 kern.err kernel: [   10.190000] sd 1:0:0:0: [sdb] No Caching mode page found
Wed Oct  1 12:01:10 2014 kern.err kernel: [   10.200000] sd 1:0:0:0: [sdb] Assuming drive cache: write through
Wed Oct  1 12:01:10 2014 kern.notice kernel: [   10.200000] sd 1:0:0:0: [sdb] Attached SCSI removable disk
Wed Oct  1 12:01:10 2014 kern.info kernel: [   15.300000] EXT4-fs (sda1): mounted filesystem with ordered data mode. Opts: 
Wed Oct  1 12:01:10 2014 kern.info kernel: [   15.340000] eth0: link down
Wed Oct  1 12:01:10 2014 kern.info kernel: [   16.900000] NET: Registered protocol family 10
Wed Oct  1 12:01:10 2014 kern.info kernel: [   16.920000] nf_conntrack version 0.5.0 (1973 buckets, 7892 max)
Wed Oct  1 12:01:10 2014 kern.info kernel: [   16.930000] ip6_tables: (C) 2000-2006 Netfilter Core Team
Wed Oct  1 12:01:10 2014 kern.info kernel: [   16.940000] Loading modules backported from Linux version master-2014-05-22-0-gf2032ea
Wed Oct  1 12:01:10 2014 kern.info kernel: [   16.950000] Backport generated by backports.git backports-20140320-37-g5c33da0
Wed Oct  1 12:01:10 2014 kern.info kernel: [   16.960000] ip_tables: (C) 2000-2006 Netfilter Core Team
Wed Oct  1 12:01:10 2014 kern.info kernel: [   17.000000] xt_time: kernel timezone is -0000
Wed Oct  1 12:01:10 2014 kern.info kernel: [   17.030000] cfg80211: Calling CRDA to update world regulatory domain
Wed Oct  1 12:01:10 2014 kern.info kernel: [   17.030000] cfg80211: World regulatory domain updated:
Wed Oct  1 12:01:10 2014 kern.info kernel: [   17.040000] cfg80211:  DFS Master region: unset
Wed Oct  1 12:01:10 2014 kern.info kernel: [   17.040000] cfg80211:   (start_freq - end_freq @ bandwidth), (max_antenna_gain, max_eirp), (dfs_cac_time)
Wed Oct  1 12:01:10 2014 kern.info kernel: [   17.050000] cfg80211:   (2402000 KHz - 2472000 KHz @ 40000 KHz), (N/A, 2000 mBm), (N/A)
Wed Oct  1 12:01:10 2014 kern.info kernel: [   17.060000] cfg80211:   (2457000 KHz - 2482000 KHz @ 40000 KHz), (N/A, 2000 mBm), (N/A)
Wed Oct  1 12:01:10 2014 kern.info kernel: [   17.070000] cfg80211:   (2474000 KHz - 2494000 KHz @ 20000 KHz), (N/A, 2000 mBm), (N/A)
Wed Oct  1 12:01:10 2014 kern.info kernel: [   17.080000] cfg80211:   (5170000 KHz - 5250000 KHz @ 160000 KHz), (N/A, 2000 mBm), (N/A)
Wed Oct  1 12:01:10 2014 kern.info kernel: [   17.080000] cfg80211:   (5250000 KHz - 5330000 KHz @ 160000 KHz), (N/A, 2000 mBm), (0 s)
Wed Oct  1 12:01:10 2014 kern.info kernel: [   17.090000] cfg80211:   (5490000 KHz - 5730000 KHz @ 160000 KHz), (N/A, 2000 mBm), (0 s)
Wed Oct  1 12:01:10 2014 kern.info kernel: [   17.100000] cfg80211:   (5735000 KHz - 5835000 KHz @ 80000 KHz), (N/A, 2000 mBm), (N/A)
Wed Oct  1 12:01:10 2014 kern.info kernel: [   17.110000] cfg80211:   (57240000 KHz - 63720000 KHz @ 2160000 KHz), (N/A, 0 mBm), (N/A)
Wed Oct  1 12:01:10 2014 kern.info kernel: [   17.150000] PPP generic driver version 2.4.2
Wed Oct  1 12:01:10 2014 kern.info kernel: [   17.170000] NET: Registered protocol family 24
Wed Oct  1 12:01:10 2014 kern.debug kernel: [   17.230000] ath: EEPROM regdomain: 0x0
Wed Oct  1 12:01:10 2014 kern.debug kernel: [   17.230000] ath: EEPROM indicates default country code should be used
Wed Oct  1 12:01:10 2014 kern.debug kernel: [   17.230000] ath: doing EEPROM country->regdmn map search
Wed Oct  1 12:01:10 2014 kern.debug kernel: [   17.230000] ath: country maps to regdmn code: 0x3a
Wed Oct  1 12:01:10 2014 kern.debug kernel: [   17.230000] ath: Country alpha2 being used: US
Wed Oct  1 12:01:10 2014 kern.debug kernel: [   17.230000] ath: Regpair used: 0x3a
Wed Oct  1 12:01:10 2014 kern.debug kernel: [   17.250000] ieee80211 phy0: Selected rate control algorithm 'minstrel_ht'
Wed Oct  1 12:01:10 2014 kern.info kernel: [   17.250000] ieee80211 phy0: Atheros AR9340 Rev:0 mem=0xb8100000, irq=47
Wed Oct  1 12:01:10 2014 kern.warn kernel: [   17.270000] PCI: Enabling device 0000:00:00.0 (0000 -> 0002)
Wed Oct  1 12:01:10 2014 kern.debug kernel: [   17.280000] ath: EEPROM regdomain: 0x0
Wed Oct  1 12:01:10 2014 kern.debug kernel: [   17.280000] ath: EEPROM indicates default country code should be used
Wed Oct  1 12:01:10 2014 kern.debug kernel: [   17.280000] ath: doing EEPROM country->regdmn map search
Wed Oct  1 12:01:10 2014 kern.debug kernel: [   17.280000] ath: country maps to regdmn code: 0x3a
Wed Oct  1 12:01:10 2014 kern.debug kernel: [   17.280000] ath: Country alpha2 being used: US
Wed Oct  1 12:01:10 2014 kern.debug kernel: [   17.280000] ath: Regpair used: 0x3a
Wed Oct  1 12:01:10 2014 kern.debug kernel: [   17.290000] ieee80211 phy1: Selected rate control algorithm 'minstrel_ht'
Wed Oct  1 12:01:10 2014 kern.info kernel: [   17.290000] ieee80211 phy1: Atheros AR9300 Rev:4 mem=0xb0000000, irq=40
Wed Oct  1 12:01:10 2014 kern.info kernel: [   17.300000] cfg80211: Calling CRDA for country: US
Wed Oct  1 12:01:10 2014 kern.info kernel: [   17.320000] cfg80211: Regulatory domain changed to country: US
Wed Oct  1 12:01:10 2014 kern.info kernel: [   17.330000] cfg80211:  DFS Master region: FCC
Wed Oct  1 12:01:10 2014 kern.info kernel: [   17.330000] cfg80211:   (start_freq - end_freq @ bandwidth), (max_antenna_gain, max_eirp), (dfs_cac_time)
Wed Oct  1 12:01:10 2014 kern.info kernel: [   17.340000] cfg80211:   (2402000 KHz - 2472000 KHz @ 40000 KHz), (N/A, 3000 mBm), (N/A)
Wed Oct  1 12:01:10 2014 kern.info kernel: [   17.350000] cfg80211:   (5170000 KHz - 5250000 KHz @ 80000 KHz), (N/A, 1700 mBm), (N/A)
Wed Oct  1 12:01:10 2014 kern.info kernel: [   17.360000] cfg80211:   (5250000 KHz - 5330000 KHz @ 80000 KHz), (N/A, 2300 mBm), (0 s)
Wed Oct  1 12:01:10 2014 kern.info kernel: [   17.370000] cfg80211:   (5735000 KHz - 5835000 KHz @ 80000 KHz), (N/A, 3000 mBm), (N/A)
Wed Oct  1 12:01:10 2014 kern.info kernel: [   17.380000] cfg80211:   (57240000 KHz - 63720000 KHz @ 2160000 KHz), (N/A, 4000 mBm), (N/A)
Wed Oct  1 12:01:12 2014 user.emerg syslog: 'radio0' is disabled
Wed Oct  1 12:01:12 2014 user.emerg syslog: 'radio1' is disabled
Wed Oct  1 12:01:12 2014 user.emerg syslog: 'radio0' is disabled
Wed Oct  1 12:01:12 2014 user.emerg syslog: 'radio1' is disabled
Wed Oct  1 12:01:14 2014 authpriv.info dropbear[905]: Not backgrounding
Wed Oct  1 12:01:15 2014 user.emerg syslog: setting up led USB1
Wed Oct  1 12:01:15 2014 user.emerg syslog: setting up led USB2
Wed Oct  1 12:01:15 2014 user.emerg syslog: setting up led WLAN2G
Wed Oct  1 12:01:15 2014 user.emerg syslog: - init complete -
Wed Oct  1 12:01:16 2014 kern.info kernel: [   24.930000] IPv6: ADDRCONF(NETDEV_UP): eth0: link is not ready
Wed Oct  1 12:01:16 2014 kern.info kernel: [   24.930000] IPv6: ADDRCONF(NETDEV_UP): eth0.1: link is not ready
Wed Oct  1 12:01:16 2014 kern.info kernel: [   24.950000] device eth0.1 entered promiscuous mode
Wed Oct  1 12:01:16 2014 kern.info kernel: [   24.950000] device eth0 entered promiscuous mode
Wed Oct  1 12:01:16 2014 daemon.notice netifd: Interface 'lan' is enabled
Wed Oct  1 12:01:16 2014 daemon.notice netifd: Interface 'lan' is setting up now
Wed Oct  1 12:01:16 2014 daemon.notice netifd: Interface 'lan' is now up
Wed Oct  1 12:01:16 2014 daemon.notice netifd: Interface 'loopback' is enabled
Wed Oct  1 12:01:16 2014 daemon.notice netifd: Interface 'loopback' is setting up now
Wed Oct  1 12:01:16 2014 daemon.notice netifd: Interface 'loopback' is now up
Wed Oct  1 12:01:16 2014 kern.info kernel: [   24.970000] IPv6: ADDRCONF(NETDEV_UP): br-lan: link is not ready
Wed Oct  1 12:01:16 2014 kern.info kernel: [   24.980000] IPv6: ADDRCONF(NETDEV_UP): eth0.2: link is not ready
Wed Oct  1 12:01:16 2014 daemon.notice netifd: Interface 'wan' is enabled
Wed Oct  1 12:01:16 2014 daemon.notice netifd: Network device 'lo' link is up
Wed Oct  1 12:01:16 2014 daemon.notice netifd: Interface 'loopback' has link connectivity 
Wed Oct  1 12:01:16 2014 user.notice firewall: Reloading firewall due to ifup of lan (br-lan)
Wed Oct  1 12:01:17 2014 kern.info kernel: [   25.780000] eth0: link up (1000Mbps/Full duplex)
Wed Oct  1 12:01:17 2014 daemon.notice netifd: Network device 'eth0' link is up
Wed Oct  1 12:01:17 2014 daemon.notice netifd: VLAN 'eth0.2' link is up
Wed Oct  1 12:01:17 2014 daemon.notice netifd: Interface 'wan' has link connectivity 
Wed Oct  1 12:01:17 2014 daemon.notice netifd: Interface 'wan' is setting up now
Wed Oct  1 12:01:17 2014 daemon.notice netifd: VLAN 'eth0.1' link is up
Wed Oct  1 12:01:17 2014 kern.info kernel: [   25.800000] IPv6: ADDRCONF(NETDEV_CHANGE): eth0: link becomes ready
Wed Oct  1 12:01:17 2014 kern.info kernel: [   25.800000] br-lan: port 1(eth0.1) entered forwarding state
Wed Oct  1 12:01:17 2014 kern.info kernel: [   25.810000] br-lan: port 1(eth0.1) entered forwarding state
Wed Oct  1 12:01:17 2014 kern.info kernel: [   25.820000] IPv6: ADDRCONF(NETDEV_CHANGE): eth0.1: link becomes ready
Wed Oct  1 12:01:17 2014 kern.info kernel: [   25.820000] IPv6: ADDRCONF(NETDEV_CHANGE): eth0.2: link becomes ready
Wed Oct  1 12:01:17 2014 kern.info kernel: [   25.840000] IPv6: ADDRCONF(NETDEV_CHANGE): br-lan: link becomes ready
Wed Oct  1 12:01:17 2014 daemon.notice netifd: Bridge 'br-lan' link is up
Wed Oct  1 12:01:17 2014 daemon.notice netifd: Interface 'lan' has link connectivity 
Wed Oct  1 12:01:17 2014 daemon.notice netifd: wan (1056): udhcpc (v1.22.1) started
Wed Oct  1 12:01:17 2014 daemon.notice netifd: wan (1056): Sending discover...
Wed Oct  1 12:01:17 2014 daemon.notice netifd: wan (1056): Sending select for 192.168.1.3...
Wed Oct  1 12:01:17 2014 daemon.notice netifd: wan (1056): Lease of 192.168.1.3 obtained, lease time 268435455
Wed Oct  1 12:01:17 2014 daemon.notice netifd: Interface 'wan6' is enabled
Wed Oct  1 12:01:17 2014 daemon.notice netifd: Network alias 'eth0.2' link is up
Wed Oct  1 12:01:17 2014 daemon.notice netifd: Interface 'wan6' has link connectivity 
Wed Oct  1 12:01:17 2014 daemon.notice netifd: Interface 'wan6' is setting up now
Wed Oct  1 12:01:17 2014 daemon.notice netifd: Interface 'wan' is now up
Wed Oct  1 12:01:17 2014 daemon.notice odhcp6c[1070]: (re)starting transaction on eth0.2
Wed Oct  1 12:01:17 2014 daemon.notice odhcp6c[1070]: Starting SOLICIT transaction (timeout 4294967295s, max rc 0)
Wed Oct  1 12:01:19 2014 kern.info kernel: [   27.810000] br-lan: port 1(eth0.1) entered forwarding state
Wed Oct  1 12:01:20 2014 daemon.info dnsmasq[1087]: started, version 2.71 cachesize 150
Wed Oct  1 12:01:20 2014 daemon.info dnsmasq[1087]: compile time options: IPv6 GNU-getopt no-DBus no-i18n no-IDN DHCP no-DHCPv6 no-Lua TFTP no-conntrack no-ipset no-auth no-DNSSEC
Wed Oct  1 12:01:20 2014 daemon.info dnsmasq-dhcp[1087]: DHCP, IP range 192.168.1.100 -- 192.168.1.249, lease time 12h
Wed Oct  1 12:01:20 2014 daemon.info dnsmasq[1087]: using local addresses only for domain lan
Wed Oct  1 12:01:20 2014 daemon.info dnsmasq[1087]: reading /tmp/resolv.conf.auto
Wed Oct  1 12:01:20 2014 daemon.info dnsmasq[1087]: using local addresses only for domain lan
Wed Oct  1 12:01:20 2014 daemon.warn dnsmasq[1087]: ignoring nameserver 192.168.1.1 - local interface
Wed Oct  1 12:01:20 2014 daemon.info dnsmasq[1087]: read /etc/hosts - 1 addresses
Wed Oct  1 12:01:20 2014 daemon.info dnsmasq[1087]: read /tmp/hosts/dhcp - 1 addresses
Wed Oct  1 12:01:20 2014 daemon.info dnsmasq-dhcp[1087]: read /etc/ethers - 0 addresses
Wed Oct  1 12:01:21 2014 daemon.info dnsmasq[1087]: exiting on receipt of SIGTERM
Wed Oct  1 12:01:21 2014 daemon.info dnsmasq[1141]: started, version 2.71 cachesize 150
Wed Oct  1 12:01:21 2014 daemon.info dnsmasq[1141]: compile time options: IPv6 GNU-getopt no-DBus no-i18n no-IDN DHCP no-DHCPv6 no-Lua TFTP no-conntrack no-ipset no-auth no-DNSSEC
Wed Oct  1 12:01:21 2014 daemon.info dnsmasq-dhcp[1141]: DHCP, IP range 192.168.1.100 -- 192.168.1.249, lease time 12h
Wed Oct  1 12:01:21 2014 daemon.info dnsmasq[1141]: using local addresses only for domain lan
Wed Oct  1 12:01:21 2014 daemon.info dnsmasq[1141]: reading /tmp/resolv.conf.auto
Wed Oct  1 12:01:21 2014 daemon.info dnsmasq[1141]: using local addresses only for domain lan
Wed Oct  1 12:01:21 2014 daemon.warn dnsmasq[1141]: ignoring nameserver 192.168.1.1 - local interface
Wed Oct  1 12:01:21 2014 daemon.info dnsmasq[1141]: read /etc/hosts - 1 addresses
Wed Oct  1 12:01:21 2014 daemon.info dnsmasq[1141]: read /tmp/hosts/dhcp - 1 addresses
Wed Oct  1 12:01:21 2014 daemon.info dnsmasq-dhcp[1141]: read /etc/ethers - 0 addresses
Wed Oct  1 12:01:21 2014 user.notice firewall: Reloading firewall due to ifup of wan (eth0.2)
Wed Oct  1 12:01:25 2014 daemon.info dnsmasq-dhcp[1141]: DHCPDISCOVER(br-lan) 68:5b:35:d2:b4:1e 
Wed Oct  1 12:01:25 2014 daemon.info dnsmasq-dhcp[1141]: DHCPOFFER(br-lan) 192.168.1.102 68:5b:35:d2:b4:1e 
Wed Oct  1 12:01:26 2014 daemon.info dnsmasq-dhcp[1141]: DHCPREQUEST(br-lan) 192.168.1.102 68:5b:35:d2:b4:1e 
Wed Oct  1 12:01:26 2014 daemon.info dnsmasq-dhcp[1141]: DHCPACK(br-lan) 192.168.1.102 68:5b:35:d2:b4:1e Ivans-MBP-2

And here's dmesg output after booting without the stick inserted:

[    0.000000] Linux version 3.10.49 (bb@builder1) (gcc version 4.8.3 (OpenWrt/Linaro GCC 4.8-2014.04 r42625) ) #3 Wed Oct 1 14:00:51 CEST 2014
[    0.000000] MyLoader: sysp=84c31530, boardp=0065cbe4, parts=195ef6a4
[    0.000000] bootconsole [early0] enabled
[    0.000000] CPU revision is: 0001974c (MIPS 74Kc)
[    0.000000] SoC: Atheros AR9344 rev 2
[    0.000000] Clocks: CPU:560.000MHz, DDR:450.000MHz, AHB:225.000MHz, Ref:40.000MHz
[    0.000000] Determined physical RAM map:
[    0.000000]  memory: 08000000 @ 00000000 (usable)
[    0.000000] Initrd not found or empty - disabling initrd
[    0.000000] Zone ranges:
[    0.000000]   Normal   [mem 0x00000000-0x07ffffff]
[    0.000000] Movable zone start for each node
[    0.000000] Early memory node ranges
[    0.000000]   node   0: [mem 0x00000000-0x07ffffff]
[    0.000000] On node 0 totalpages: 32768
[    0.000000] free_area_init_node: node 0, pgdat 80334b60, node_mem_map 81000000
[    0.000000]   Normal zone: 256 pages used for memmap
[    0.000000]   Normal zone: 0 pages reserved
[    0.000000]   Normal zone: 32768 pages, LIFO batch:7
[    0.000000] Primary instruction cache 64kB, VIPT, 4-way, linesize 32 bytes.
[    0.000000] Primary data cache 32kB, 4-way, VIPT, cache aliases, linesize 32 bytes
[    0.000000] pcpu-alloc: s0 r0 d32768 u32768 alloc=1*32768
[    0.000000] pcpu-alloc: [0] 0 
[    0.000000] Built 1 zonelists in Zone order, mobility grouping on.  Total pages: 32512
[    0.000000] Kernel command line:  board=TL-WDR4300 console=ttyS0,115200 rootfstype=squashfs,jffs2 noinitrd
[    0.000000] PID hash table entries: 512 (order: -1, 2048 bytes)
[    0.000000] Dentry cache hash table entries: 16384 (order: 4, 65536 bytes)
[    0.000000] Inode-cache hash table entries: 8192 (order: 3, 32768 bytes)
[    0.000000] Writing ErrCtl register=00000000
[    0.000000] Readback ErrCtl register=00000000
[    0.000000] Memory: 126052k/131072k available (2369k kernel code, 5020k reserved, 621k data, 272k init, 0k highmem)
[    0.000000] SLUB: HWalign=32, Order=0-3, MinObjects=0, CPUs=1, Nodes=1
[    0.000000] NR_IRQS:51
[    0.060000] Calibrating delay loop... 278.93 BogoMIPS (lpj=1394688)
[    0.070000] pid_max: default: 32768 minimum: 301
[    0.070000] Mount-cache hash table entries: 512
[    0.080000] NET: Registered protocol family 16
[    0.080000] MIPS: machine is TP-LINK TL-WDR3600/4300/4310
[    0.090000] registering PCI controller with io_map_base unset
[    0.310000] bio: create slab <bio-0> at 0
[    0.310000] PCI host bridge to bus 0000:00
[    0.320000] pci_bus 0000:00: root bus resource [mem 0x10000000-0x13ffffff]
[    0.320000] pci_bus 0000:00: root bus resource [io  0x0000]
[    0.330000] pci_bus 0000:00: No busn resource found for root bus, will use [bus 00-ff]
[    0.330000] pci 0000:00:00.0: [168c:0033] type 00 class 0x028000
[    0.330000] pci 0000:00:00.0: invalid calibration data
[    0.340000] pci 0000:00:00.0: reg 10: [mem 0x00000000-0x0001ffff 64bit]
[    0.340000] pci 0000:00:00.0: reg 30: [mem 0x00000000-0x0000ffff pref]
[    0.340000] pci 0000:00:00.0: supports D1
[    0.340000] pci 0000:00:00.0: PME# supported from D0 D1 D3hot
[    0.340000] pci_bus 0000:00: busn_res: [bus 00-ff] end is updated to 00
[    0.340000] pci 0000:00:00.0: BAR 0: assigned [mem 0x10000000-0x1001ffff 64bit]
[    0.340000] pci 0000:00:00.0: BAR 6: assigned [mem 0x10020000-0x1002ffff pref]
[    0.350000] pci 0000:00:00.0: using irq 40 for pin 1
[    0.350000] Switching to clocksource MIPS
[    0.360000] NET: Registered protocol family 2
[    0.360000] TCP established hash table entries: 1024 (order: 1, 8192 bytes)
[    0.360000] TCP bind hash table entries: 1024 (order: 0, 4096 bytes)
[    0.370000] TCP: Hash tables configured (established 1024 bind 1024)
[    0.370000] TCP: reno registered
[    0.370000] UDP hash table entries: 256 (order: 0, 4096 bytes)
[    0.380000] UDP-Lite hash table entries: 256 (order: 0, 4096 bytes)
[    0.390000] NET: Registered protocol family 1
[    0.390000] PCI: CLS 0 bytes, default 32
[    0.410000] squashfs: version 4.0 (2009/01/31) Phillip Lougher
[    0.410000] jffs2: version 2.2 (NAND) (SUMMARY) (LZMA) (RTIME) (CMODE_PRIORITY) (c) 2001-2006 Red Hat, Inc.
[    0.420000] msgmni has been set to 246
[    0.430000] io scheduler noop registered
[    0.430000] io scheduler deadline registered (default)
[    0.440000] Serial: 8250/16550 driver, 16 ports, IRQ sharing enabled
[    0.470000] serial8250.0: ttyS0 at MMIO 0x18020000 (irq = 11) is a 16550A
[    0.470000] console [ttyS0] enabled, bootconsole disabled
[    0.490000] ath79-spi ath79-spi: master is unqueued, this is deprecated
[    0.500000] m25p80 spi0.0: found s25fl064k, expected m25p80
[    0.500000] m25p80 spi0.0: s25fl064k (8192 Kbytes)
[    0.510000] 5 tp-link partitions found on MTD device spi0.0
[    0.510000] Creating 5 MTD partitions on "spi0.0":
[    0.520000] 0x000000000000-0x000000020000 : "u-boot"
[    0.520000] 0x000000020000-0x00000012e5fc : "kernel"
[    0.530000] mtd: partition "kernel" must either start or end on erase block boundary or be smaller than an erase block -- forcing read-only
[    0.540000] 0x00000012e5fc-0x0000007f0000 : "rootfs"
[    0.550000] mtd: partition "rootfs" must either start or end on erase block boundary or be smaller than an erase block -- forcing read-only
[    0.560000] mtd: device 2 (rootfs) set to be root filesystem
[    0.570000] 1 squashfs-split partitions found on MTD device rootfs
[    0.570000] 0x000000350000-0x0000007f0000 : "rootfs_data"
[    0.580000] 0x0000007f0000-0x000000800000 : "art"
[    0.590000] 0x000000020000-0x0000007f0000 : "firmware"
[    0.620000] switch0: Atheros AR8327 rev. 4 switch registered on ag71xx-mdio.0
[    1.840000] libphy: ag71xx_mdio: probed
[    2.390000] ag71xx ag71xx.0: connected to PHY at ag71xx-mdio.0:00 [uid=004dd034, driver=Atheros AR8216/AR8236/AR8316]
[    2.400000] eth0: Atheros AG71xx at 0xb9000000, irq 4, mode:RGMII
[    2.410000] TCP: cubic registered
[    2.410000] NET: Registered protocol family 17
[    2.420000] Bridge firewalling registered
[    2.420000] 8021q: 802.1Q VLAN Support v1.8
[    2.440000] VFS: Mounted root (squashfs filesystem) readonly on device 31:2.
[    2.440000] Freeing unused kernel memory: 272K (8034c000 - 80390000)
[    4.620000] usbcore: registered new interface driver usbfs
[    4.630000] usbcore: registered new interface driver hub
[    4.630000] usbcore: registered new device driver usb
[    4.640000] ehci_hcd: USB 2.0 'Enhanced' Host Controller (EHCI) Driver
[    4.650000] ehci-platform: EHCI generic platform driver
[    4.660000] ehci-platform ehci-platform: EHCI Host Controller
[    4.660000] ehci-platform ehci-platform: new USB bus registered, assigned bus number 1
[    4.670000] ehci-platform ehci-platform: irq 3, io mem 0x1b000000
[    4.700000] ehci-platform ehci-platform: USB 2.0 started, EHCI 1.00
[    4.700000] hub 1-0:1.0: USB hub found
[    4.710000] hub 1-0:1.0: 1 port detected
[    5.030000] usb 1-1: new high-speed USB device number 2 using ehci-platform
[    5.180000] hub 1-1:1.0: USB hub found
[    5.180000] hub 1-1:1.0: 4 ports detected
[    5.470000] usb 1-1.2: new high-speed USB device number 3 using ehci-platform
[    6.410000] eth0: link up (1000Mbps/Full duplex)
[    8.360000] jffs2: notice: (373) jffs2_build_xattr_subsystem: complete building xattr subsystem, 21 of xdatum (1 unchecked, 20 orphan) and 34 of xref (0 dead, 20 orphan) found.
[    9.020000] SCSI subsystem initialized
[    9.040000] usb-storage 1-1.2:1.0: USB Mass Storage device detected
[    9.040000] scsi0 : usb-storage 1-1.2:1.0
[    9.050000] usbcore: registered new interface driver usb-storage
[   10.050000] scsi 0:0:0:0: Direct-Access     LG       USB Drive        1100 PQ: 0 ANSI: 0 CCS
[   10.060000] sd 0:0:0:0: [sda] 7864320 512-byte logical blocks: (4.02 GB/3.75 GiB)
[   10.070000] sd 0:0:0:0: [sda] Write Protect is off
[   10.070000] sd 0:0:0:0: [sda] Mode Sense: 43 00 00 00
[   10.070000] sd 0:0:0:0: [sda] No Caching mode page found
[   10.080000] sd 0:0:0:0: [sda] Assuming drive cache: write through
[   10.090000] sd 0:0:0:0: [sda] No Caching mode page found
[   10.090000] sd 0:0:0:0: [sda] Assuming drive cache: write through
[   10.150000]  sda: sda1 sda2
[   10.160000] sd 0:0:0:0: [sda] No Caching mode page found
[   10.160000] sd 0:0:0:0: [sda] Assuming drive cache: write through
[   10.170000] sd 0:0:0:0: [sda] Attached SCSI removable disk
[   14.400000] EXT4-fs (sda1): recovery complete
[   14.410000] EXT4-fs (sda1): mounted filesystem with ordered data mode. Opts: 
[   14.440000] eth0: link down
[   17.080000] NET: Registered protocol family 10
[   17.090000] NTFS driver 2.1.30 [Flags: R/O MODULE].
[   17.100000] tun: Universal TUN/TAP device driver, 1.6
[   17.110000] tun: (C) 1999-2004 Max Krasnyansky <maxk@qualcomm.com>
[   17.120000] nf_conntrack version 0.5.0 (1973 buckets, 7892 max)
[   17.140000] ip6_tables: (C) 2000-2006 Netfilter Core Team
[   17.150000] fuse init (API version 7.22)
[   17.160000] Loading modules backported from Linux version master-2014-05-22-0-gf2032ea
[   17.170000] Backport generated by backports.git backports-20140320-37-g5c33da0
[   17.180000] ip_tables: (C) 2000-2006 Netfilter Core Team
[   17.220000] xt_time: kernel timezone is -0000
[   17.250000] cfg80211: Calling CRDA to update world regulatory domain
[   17.250000] cfg80211: World regulatory domain updated:
[   17.260000] cfg80211:  DFS Master region: unset
[   17.260000] cfg80211:   (start_freq - end_freq @ bandwidth), (max_antenna_gain, max_eirp), (dfs_cac_time)
[   17.270000] cfg80211:   (2402000 KHz - 2472000 KHz @ 40000 KHz), (N/A, 2000 mBm), (N/A)
[   17.280000] cfg80211:   (2457000 KHz - 2482000 KHz @ 40000 KHz), (N/A, 2000 mBm), (N/A)
[   17.290000] cfg80211:   (2474000 KHz - 2494000 KHz @ 20000 KHz), (N/A, 2000 mBm), (N/A)
[   17.300000] cfg80211:   (5170000 KHz - 5250000 KHz @ 160000 KHz), (N/A, 2000 mBm), (N/A)
[   17.300000] cfg80211:   (5250000 KHz - 5330000 KHz @ 160000 KHz), (N/A, 2000 mBm), (0 s)
[   17.310000] cfg80211:   (5490000 KHz - 5730000 KHz @ 160000 KHz), (N/A, 2000 mBm), (0 s)
[   17.320000] cfg80211:   (5735000 KHz - 5835000 KHz @ 80000 KHz), (N/A, 2000 mBm), (N/A)
[   17.330000] cfg80211:   (57240000 KHz - 63720000 KHz @ 2160000 KHz), (N/A, 0 mBm), (N/A)
[   17.380000] PPP generic driver version 2.4.2
[   17.400000] NET: Registered protocol family 24
[   17.450000] ath: EEPROM regdomain: 0x0
[   17.450000] ath: EEPROM indicates default country code should be used
[   17.450000] ath: doing EEPROM country->regdmn map search
[   17.450000] ath: country maps to regdmn code: 0x3a
[   17.450000] ath: Country alpha2 being used: US
[   17.450000] ath: Regpair used: 0x3a
[   17.460000] ieee80211 phy0: Selected rate control algorithm 'minstrel_ht'
[   17.480000] cfg80211: Calling CRDA for country: US
[   17.480000] cfg80211: Regulatory domain changed to country: US
[   17.490000] cfg80211:  DFS Master region: FCC
[   17.500000] cfg80211:   (start_freq - end_freq @ bandwidth), (max_antenna_gain, max_eirp), (dfs_cac_time)
[   17.500000] cfg80211:   (2402000 KHz - 2472000 KHz @ 40000 KHz), (N/A, 3000 mBm), (N/A)
[   17.510000] cfg80211:   (5170000 KHz - 5250000 KHz @ 80000 KHz), (N/A, 1700 mBm), (N/A)
[   17.520000] cfg80211:   (5250000 KHz - 5330000 KHz @ 80000 KHz), (N/A, 2300 mBm), (0 s)
[   17.530000] cfg80211:   (5735000 KHz - 5835000 KHz @ 80000 KHz), (N/A, 3000 mBm), (N/A)
[   17.540000] cfg80211:   (57240000 KHz - 63720000 KHz @ 2160000 KHz), (N/A, 4000 mBm), (N/A)
[   17.550000] ieee80211 phy0: Atheros AR9340 Rev:0 mem=0xb8100000, irq=47
[   17.550000] PCI: Enabling device 0000:00:00.0 (0000 -> 0002)
[   17.560000] ath: EEPROM regdomain: 0x0
[   17.560000] ath: EEPROM indicates default country code should be used
[   17.560000] ath: doing EEPROM country->regdmn map search
[   17.560000] ath: country maps to regdmn code: 0x3a
[   17.560000] ath: Country alpha2 being used: US
[   17.560000] ath: Regpair used: 0x3a
[   17.580000] ieee80211 phy1: Selected rate control algorithm 'minstrel_ht'
[   17.590000] ieee80211 phy1: Atheros AR9300 Rev:4 mem=0xb0000000, irq=40
[   25.690000] IPv6: ADDRCONF(NETDEV_UP): eth0: link is not ready
[   25.710000] IPv6: ADDRCONF(NETDEV_UP): eth0.1: link is not ready
[   25.710000] device eth0.1 entered promiscuous mode
[   25.720000] device eth0 entered promiscuous mode
[   25.730000] IPv6: ADDRCONF(NETDEV_UP): br-lan: link is not ready
[   25.740000] IPv6: ADDRCONF(NETDEV_UP): eth0.2: link is not ready
[   25.750000] eth0: link up (1000Mbps/Full duplex)
[   25.780000] IPv6: ADDRCONF(NETDEV_CHANGE): eth0: link becomes ready
[   25.830000] br-lan: port 1(eth0.1) entered forwarding state
[   25.840000] br-lan: port 1(eth0.1) entered forwarding state
[   25.840000] IPv6: ADDRCONF(NETDEV_CHANGE): eth0.1: link becomes ready
[   25.850000] IPv6: ADDRCONF(NETDEV_CHANGE): eth0.2: link becomes ready
[   25.910000] IPv6: ADDRCONF(NETDEV_CHANGE): br-lan: link becomes ready
[   27.840000] br-lan: port 1(eth0.1) entered forwarding state
[   28.360000] IPv6: ADDRCONF(NETDEV_UP): wlan0: link is not ready
[   28.380000] IPv6: ADDRCONF(NETDEV_UP): wlan1: link is not ready
[   28.400000] device wlan0 entered promiscuous mode
[   28.410000] device wlan1 entered promiscuous mode
[   28.410000] br-lan: port 3(wlan1) entered forwarding state
[   28.420000] br-lan: port 3(wlan1) entered forwarding state
[   29.530000] br-lan: port 3(wlan1) entered disabled state
[   29.550000] br-lan: port 2(wlan0) entered forwarding state
[   29.560000] br-lan: port 2(wlan0) entered forwarding state
[   29.570000] IPv6: ADDRCONF(NETDEV_CHANGE): wlan0: link becomes ready
[   29.610000] br-lan: port 3(wlan1) entered forwarding state
[   29.610000] br-lan: port 3(wlan1) entered forwarding state
[   29.620000] IPv6: ADDRCONF(NETDEV_CHANGE): wlan1: link becomes ready
[   31.560000] br-lan: port 2(wlan0) entered forwarding state
[   31.610000] br-lan: port 3(wlan1) entered forwarding state

Here's df output without the USB stick inserted:

Filesystem           1K-blocks      Used Available Use% Mounted on
rootfs                  499656    142288    320672  31% /
/dev/root                 2304      2304         0 100% /rom
tmpfs                    63160       404     62756   1% /tmp
/dev/sda1               499656    142288    320672  31% /overlay
overlayfs:/overlay      499656    142288    320672  31% /
tmpfs                      512         0       512   0% /dev

Any help would be greatly appreciated!

(Last edited by el_commandante on 1 Jul 2015, 00:30)

The /dev/sdX assignment is arbitrary and not guaranteed to always come up to the same physical drive.  When you have more than one drive you should always mount them by UUID rather than device name.

Thanks for replying, mk24.

Yeah, I thought about that before posting too. Unfortunately it doesn't help.

Here's my fstab with the USB sticks by UUID:

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 swap
        option device '/dev/sda2'
        option enabled '0'

config mount
        option enabled '1'
        option fstype 'ext4'
        option target '/overlay'
        option enabled_fsck '1'
        option uuid '869a3359-9660-4c50-a392-63977ca60d63'

config mount
        option uuid '064fb626-8e4d-4133-aa3e-5ace761327af'
        option target '/mnt/media'
        option fstype 'ext4'
        option enabled_fsck '1'
        option enabled '1'

Still, if the stick is inserted when I reboot the router boots with a new root sad

I am learning USB and probably in left field, but are you sure the fstab mount section is for the NEW device and not the old device.  If you remove the section for the device will it boot and let you configure the new USB device.

I did not see in your process where you actually configured the new device.  You just inserted and booted.

It does not really answer the problem.  It should boot the same with a new or configured device.

RangerZ

RangerZ wrote:

I am learning USB and probably in left field, but are you sure the fstab mount section is for the NEW device and not the old device.  If you remove the section for the device will it boot and let you configure the new USB device.

I did not see in your process where you actually configured the new device.  You just inserted and booted.

It does not really answer the problem.  It should boot the same with a new or configured device.

RangerZ

What do you mean by "configured"? The stick is formatted and it automouns just fine if I insert it when the router has finished booting. However, if I insert it and reboot, the router recreates the whole root tree on it apparently...

Any ideas anyone? This is really frustrating!

Can you see the files on the 4 GB drive under /overlay ?  It's been a while since I extrooted but I think there are some hidden files that have to match up or it won't work.  Deleting the files makes it regenerate the configuration.

You should pull the 64GB drive out and set it aside until you can get it to boot up and root the old 4 GB one alone.

Also you may want to format your drive ext2 instead of ext4 because that will save flash wear on a system that is constantly writing like a torrent operation.

(Last edited by mk24 on 1 Jul 2015, 02:36)

mk24 wrote:

Can you see the files on the 4 GB drive under /overlay ?  It's been a while since I extrooted but I think there are some hidden files that have to match up or it won't work.  Deleting the files makes it regenerate the configuration.

Yeah, I can see the files under /overlay. Should I delete anything or not, I'm not sure I understood what you meant... It seems that the overlay works fine as long as there's no drive inserted in the second USB port. It shows obviously more free space than I would have on the internal memory and df shows overlayfs as mounted.

As others have pointed out, using "/dev/sdx" was the cause of the problem.

When your router boots, before it has mounted the overlay drive, the files that it sees are those that reside in the router's internal memory; then it goes to "/etc/fstab" (the one that is in the internal memory) and mounts the overlay. Later when you log in, you are editing the "/etc/fstab" file that resides on the overlay, not the one on the internal memory. Thus, your changes are only visible after the overlay has been mounted; i.e., too late in the booting sequence.

See here (http://wiki.openwrt.org/doc/howto/extro … ginal_root) how to access the original root, and then edit the "/overlay-boot/etc/fstab" file.

PS: You should also use a UUID for the swap.

Thanks, eduperez, that was exactly the right solution. Unfortunately I spent about 4 hours digging for it, found and fixed it about an hour before you replied smile But thank you anyway!

I feel like the documentation of OpenWrt is still very lacking, especially for someone like me who has basic understanding of Linux based systems, but doesn't have the extensive knowledge, experience and time to dig further and experiment all day just to get basic functionality working.

Another question: how do I mount the swap partition by UUID? The problem is that it's a partition of the same drive that holds my overlay setup. When I type "mount detect" it shows it by /dev/sdxx and not by uuid...

"block info" will give you the UUID of each block device attached to your router.

eduperez wrote:

"block info" will give you the UUID of each block device attached to your router.

Hey thanks, but that doesn't work, I tried already. It lists the device by /dev/sdxx only. Any other ideas?

Here's the output of block info:

root@OpenWrt:~# block info
/dev/mtdblock2: UUID="1e0c82a7-150c1d32-b3d5c71c-917a14ed" VERSION="4.0" TYPE="squashfs"
/dev/mtdblock3: TYPE="jffs2"
/dev/sda1: UUID="10e082e8-b9b6-429a-b21c-fc401013c0ba" VERSION="1.0" TYPE="ext2"
/dev/sdb1: UUID="869a3359-9660-4c50-a392-63977ca60d63" NAME="EXT_JOURNAL" VERSION="1.0" TYPE="ext4"
/dev/sdb2: VERSION="2" TYPE="swap"

(Last edited by el_commandante on 1 Jul 2015, 18:33)

Have you tried using options "anon_swap" and "auto_swap"?

eduperez wrote:

Have you tried using options "anon_swap" and "auto_swap"?


No, but I'll give it a shot. It must be in the fstab from the original overlay again, right?

el_commandante wrote:
eduperez wrote:

Have you tried using options "anon_swap" and "auto_swap"?

No, but I'll give it a shot. It must be in the fstab from the original overlay again, right?

I guess so.

No difference, still mounts by /dev/sdxx:

/dev/mtdblock2: UUID="1e0c82a7-150c1d32-b3d5c71c-917a14ed" VERSION="4.0" TYPE="squashfs"
/dev/mtdblock3: TYPE="jffs2"
/dev/sda1: UUID="10e082e8-b9b6-429a-b21c-fc401013c0ba" VERSION="1.0" TYPE="ext2"
/dev/sdb1: UUID="869a3359-9660-4c50-a392-63977ca60d63" NAME="EXT_JOURNAL" VERSION="1.0" TYPE="ext4"
/dev/sdb2: VERSION="2" TYPE="swap"

In your case (as it would be with most systems), only one of the drives even has a swap partition-- so you don't have to be concerned with an "incorrect" swap partition being mounted.

Yeah, OK, it wasn't a problem really. Thanks anyway!

The discussion might have continued from here.