OpenWrt Forum Archive

Topic: USB 3G modem with microSD card as extroot overlay (pivot overlay)

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

I am trying to set up a microSD card installed in a usb hspa modem as an external storage and use one of the partitions as pivot overlay.

Used Hardware:
Router: TP-Link MR3220
OpenWrt built: ATTITUDE ADJUSTMENT (Bleeding Edge, r32775)
HSPA modem: ZTE Vodafone K3765-Z + 2GB microSD card

I have installed all the prerequisites for USB storage including the needed stuff for the 3g connectivity.

Just to note that my configuration is working fine with a USB flash drive, 2GB featuring the same partition table and file systems, etc as the microSD card.
Here is the output with a successfully mounted usb flash drive partition as an extroot overlay:

[root@OpenWrt:/root]# df -h
Filesystem                Size      Used Available Use% Mounted on
rootfs                  504.4M     17.0M    461.8M   4% /
/dev/root                 2.8M      2.8M         0 100% /rom
tmpfs                    14.4M     76.0K     14.3M   1% /tmp
tmpfs                   512.0K         0    512.0K   0% /dev
/dev/sda1               504.4M     17.0M    461.8M   4% /overlay
overlayfs:/overlay      504.4M     17.0M    461.8M   4% /
/dev/sda3                 1.3G     36.3M      1.2G   3% /mnt/storage

sda2 is set as a swap partition.

Unfortunately when trying the same with the microSD card installed in the hspa modem, sda1 is not mounted as extroot overlay.

BusyBox v1.19.4 (2012-08-02 02:04:49 EEST) built-in shell (ash)
Enter 'help' for a list of built-in commands.

  _______                     ________        __
 |       |.-----.-----.-----.|  |  |  |.----.|  |_
 |   -   ||  _  |  -__|     ||  |  |  ||   _||   _|
 |_______||   __|_____|__|__||________||__|  |____|
          |__| W I R E L E S S   F R E E D O M
 -----------------------------------------------------
 ATTITUDE ADJUSTMENT (Bleeding Edge, r32775)
 -----------------------------------------------------
  * 1/4 oz Vodka      Pour all ingredients into mixing
  * 1/4 oz Gin        tin with ice, strain into glass.
  * 1/4 oz Amaretto
  * 1/4 oz Triple sec
  * 1/4 oz Peach schnapps
  * 1/4 oz Sour mix
  * 1 splash Cranberry juice
 -----------------------------------------------------
[root@sinemorec:/]# df -h
Filesystem                Size      Used Available Use% Mounted on
rootfs                  320.0K    244.0K     76.0K  76% /
/dev/root                 2.8M      2.8M         0 100% /rom
tmpfs                    14.4M    128.0K     14.3M   1% /tmp
tmpfs                   512.0K         0    512.0K   0% /dev
/dev/mtdblock3          559.6M     17.1M    514.1M   3% /overlay
overlayfs:/overlay      320.0K    244.0K     76.0K  76% /
/dev/sda1               559.6M     17.1M    514.1M   3% /overlay
/dev/sda3                 1.1G     35.7M      1.0G   3% /mnt/storage
[root@sinemorec:/]# cat /proc/swaps 
Filename                Type        Size    Used    Priority
/dev/sda2                               partition    131068    0    -1

This is what I can find in the kernel log

[   49.230000] scsi 2:0:0:0: Direct-Access     Vodafone  MMC Storage MMC  Sto PQ: 0 ANSI: 2
[   49.250000] sd 2:0:0:0: [sda] 3842048 512-byte logical blocks: (1.96 GB/1.83 GiB)
[   49.270000] sd 2:0:0:0: [sda] Write Protect is off
[   49.270000] sd 2:0:0:0: [sda] Mode Sense: 0f 0e 00 00
[   49.270000] sd 2:0:0:0: [sda] Write cache: enabled, read cache: enabled, doesn't support DPO or FUA
.........................................
[   49.330000]  sda: sda1 sda2 sda3
[   49.360000] sd 2:0:0:0: [sda] Attached SCSI removable disk
[   51.290000] br-lan: port 2(wlan0) entered forwarding state
[   72.160000] eth0: link down
[   72.160000] br-lan: port 1(eth0) entered disabled state
[   74.660000] eth0: link up (1000Mbps/Full duplex)
[   74.660000] br-lan: port 1(eth0) entered forwarding state
[   74.670000] br-lan: port 1(eth0) entered forwarding state
[   76.670000] br-lan: port 1(eth0) entered forwarding state
[   77.070000] EXT4-fs (sda1): mounting ext3 file system using the ext4 subsystem
[   77.130000] EXT4-fs (sda1): mounted filesystem with ordered data mode. Opts: (null)
[   77.800000] Adding 131068k swap on /dev/sda2.  Priority:-1 extents:1 across:131068k 
[   78.840000] EXT4-fs (sda3): mounting ext3 file system using the ext4 subsystem
[   78.890000] EXT4-fs (sda3): mounted filesystem with ordered data mode. Opts: (null)

Nothing suspicious according to me. As you can see the swap is set up correctly.
This is my fstab configuration in both cases - USB flash drive and microSD card in the modem

root@OpenWrt:/# cat /tmp/rootfs/etc/config/fstab 
config global automount
    option from_fstab 1
    option anon_mount 0
    
config global autoswap
    option from_fstab 1
    option anon_swap 0
    
config mount
    option target /overlay
    option device /dev/sda1
    #option uuid ''   #optional, overrules device statement
    option fstype ext3
    option options rw,sync
    option enabled_fsck 0
    #option is_rootfs 1   # not more needed after r25787, but optional. For trunk versions newer than and including r25787 
    option enabled 1

config mount
    option target /mnt/storage
    option device /dev/sda3
    #option uuid ''   #optional, overrules device statement
    option fstype ext3
    option options rw,sync
    option enabled_fsck 1
    #option label 'Storage_Main'
    option enabled 1

config swap
    option device /dev/sda2
    #option uuid ''   #optional, overrules device statement
    option enabled 1

Just to emphasize that I removed the /.extroot.md5sum after transferring the data from the /overlay to the external storage.

ps.
And this is a full kernel log on how the modem with the microSD card is recognized (the stick is plugged in after the system boot).

Aug  2 18:52:36 kernel: [  286.960000] usb 1-1: new high-speed USB device number 6 using ehci-platform
Aug  2 18:52:36 kernel: [  287.500000] scsi0 : usb-storage 1-1:1.0
Aug  2 18:52:37 usb-modeswitch: 1-1:1.0: Manufacturer=Vodafone_(ZTE) Product=Vodafone_Mobile_Broadband_K3765-Z Serial=P673A1VDF_MS
Aug  2 18:52:37 usb-modeswitch: 1-1:1.0: Selecting /etc/usb_modeswitch.d/19d2:2000 for mode switching
Aug  2 18:52:37 usb_modeswitch: switching device 19d2:2000 on 001/002
Aug  2 18:52:39 kernel: [56296.790000] usb 1-1: USB disconnect, device number 6
Aug  2 18:52:45 kernel: [56302.820000] usb 1-1: new high-speed USB device number 7 using ehci-platform
Aug  2 18:52:45 kernel: [56303.350000] usbserial_generic 1-1:1.0: generic converter detected
Aug  2 18:52:45 kernel: [56303.360000] usb 1-1: generic converter now attached to ttyUSB0
Aug  2 18:52:45 kernel: [56303.370000] usbserial_generic 1-1:1.1: generic converter detected
Aug  2 18:52:45 kernel: [56303.370000] usb 1-1: generic converter now attached to ttyUSB1
Aug  2 18:52:45 kernel: [56303.380000] usbserial_generic 1-1:1.2: generic converter detected
Aug  2 18:52:45 kernel: [56303.390000] usb 1-1: generic converter now attached to ttyUSB2
Aug  2 18:52:45 kernel: [56303.390000] usbserial_generic 1-1:1.3: generic converter detected
Aug  2 18:52:45 kernel: [56303.400000] usb 1-1: generic converter now attached to ttyUSB3
Aug  2 18:52:45 kernel: [56303.400000] usbserial_generic 1-1:1.4: generic converter detected
Aug  2 18:52:45 kernel: [56303.410000] usb 1-1: generic converter now attached to ttyUSB4
Aug  2 18:52:45 kernel: [56303.420000] scsi5 : usb-storage 1-1:1.5
Aug  2 18:52:46 kernel: [56304.420000] scsi 5:0:0:0: Direct-Access     Vodafone  MMC Storage MMC  Sto PQ: 0 ANSI: 2
Aug  2 18:52:46 kernel: [56304.430000] sd 5:0:0:0: [sda] 3842048 512-byte logical blocks: (1.96 GB/1.83 GiB)
Aug  2 18:52:46 kernel: [56304.440000] sd 5:0:0:0: [sda] Write Protect is off
Aug  2 18:52:46 kernel: [56304.450000] sd 5:0:0:0: [sda] Mode Sense: 0f 0e 00 00
Aug  2 18:52:46 kernel: [56304.450000] sd 5:0:0:0: [sda] Write cache: enabled, read cache: enabled, doesn't support DPO or FUA
Aug  2 18:52:46 kernel: [56304.480000]  sda: sda1 sda2 sda3
Aug  2 18:52:46 kernel: [56304.500000] sd 5:0:0:0: [sda] Attached SCSI removable disk
Aug  2 18:53:08 usb-modeswitch: 1-1:1.0: Manufacturer=Vodafone_(ZTE) Product=Vodafone_Mobile_Broadband_K3765-Z Serial=P673A1VDF_MS
Aug  2 18:53:08 usb-modeswitch: 1-1:1.1: Manufacturer=Vodafone_(ZTE) Product=Vodafone_Mobile_Broadband_K3765-Z Serial=P673A1VDF_MS
Aug  2 18:53:08 usb-modeswitch: 1-1:1.2: Manufacturer=Vodafone_(ZTE) Product=Vodafone_Mobile_Broadband_K3765-Z Serial=P673A1VDF_MS
Aug  2 18:53:08 usb-modeswitch: 1-1:1.3: Manufacturer=Vodafone_(ZTE) Product=Vodafone_Mobile_Broadband_K3765-Z Serial=P673A1VDF_MS
Aug  2 18:53:09 usb-modeswitch: 1-1:1.4: Manufacturer=Vodafone_(ZTE) Product=Vodafone_Mobile_Broadband_K3765-Z Serial=P673A1VDF_MS
Aug  2 18:53:09 usb-modeswitch: 1-1:1.5: Manufacturer=Vodafone_(ZTE) Product=Vodafone_Mobile_Broadband_K3765-Z Serial=P673A1VDF_MS
Aug  2 18:53:10 pppd[5940]: pppd 2.4.5 started by root, uid 0

I am just curious if it is possible to use the storage in the usb hspa modem as the root partition to boot OpenWRT. Can you confirm this?

I have the same thing working here. A 3G dongle with a micro SD card and extroot :-) It`s working perfect. I use the usb-modeswitch package.

(Last edited by written_direcon on 13 Sep 2012, 13:51)

written_direcon wrote:

I have the same thing working here. A 3G dongle with a micro SD card and extroot :-) It`s working perfect. I use the usb-modeswitch package.

Cool. Can you please tell use which made/model of the 3G USB dongle you have used?

Any brand/model supported by usb-modeswitch should work!

Btw. I use whole root on extroot.

(Last edited by written_direcon on 13 Sep 2012, 17:19)

written_direcon: is this mod ready to use in your firmwares?

@fobo:

Yes, using it with the image from my firmware downloads on a TL-MR3020.

I'll write a up a page on my Wiki.

(Last edited by written_direcon on 13 Sep 2012, 17:45)

written_direcon wrote:

Any brand/model supported by usb-modeswitch should work!

Thanks.

written_direcon wrote:

I have the same thing working here. A 3G dongle with a micro SD card and extroot :-) It`s working perfect. I use the usb-modeswitch package.

Hi, could you share is there something that I am messing up in my configuration. I am using the usb-modeswitch package too. Probably I am missing something, but what is it?

The first thing I supposed is that the modem is initialized slowly and kernel tends to ignore the extroot options...


ps. to add that usb-modeswitch is also integrated in my image (custom built) and all the needed stuff to get extroot working. I have been doing that hundred of times and am wondering what shall be wrong.

(Last edited by dir2cas on 13 Sep 2012, 23:50)

Still no luck....
I compiled the latest trunk (r33395) and the micro SD card is still not mounted as extroot.
As mentioned in the first post all configurations are done correctly.
here are the packages that are built in

[root@sinemorets:~]# opkg list_installed
base-files - 115-r33395
blkid - 2.21.2-1
block-mount - 0.2.0-9
bluez-libs - 3.36-3
busybox - 1.19.4-3
chat - 2.4.5-6
comgt - 0.32-20
ddns-scripts - 1.0.0-21
dnsmasq - 2.62-2
dropbear - 2011.54-2
firewall - 2-53
gnokii - 0.6.21-3
hotplug2 - 1.0-beta-4
iptables - 1.4.10-4
iw - 3.3-1
jshn - 2012-07-08-cca2ed6c8cdb3555fea43ff63ba1c9905dd7a164
kernel - 3.3.8-1-ee4872bfae8eac5850d5af471923f755
kmod-8021q - 3.3.8-1
kmod-ath - 3.3.8+2012-09-07-2
kmod-ath9k - 3.3.8+2012-09-07-2
kmod-ath9k-common - 3.3.8+2012-09-07-2
kmod-cfg80211 - 3.3.8+2012-09-07-2
kmod-crypto-aes - 3.3.8-1
kmod-crypto-arc4 - 3.3.8-1
kmod-crypto-core - 3.3.8-1
kmod-fs-ext4 - 3.3.8-1
kmod-gpio-button-hotplug - 3.3.8-1
kmod-gre - 3.3.8-1
kmod-ipt-conntrack - 3.3.8-1
kmod-ipt-core - 3.3.8-1
kmod-ipt-nat - 3.3.8-1
kmod-ipt-nathelper - 3.3.8-1
kmod-leds-gpio - 3.3.8-1
kmod-ledtrig-default-on - 3.3.8-1
kmod-ledtrig-netdev - 3.3.8-1
kmod-ledtrig-timer - 3.3.8-1
kmod-ledtrig-usbdev - 3.3.8-1
kmod-lib-crc-ccitt - 3.3.8-1
kmod-lib-crc16 - 3.3.8-1
kmod-mac80211 - 3.3.8+2012-09-07-2
kmod-nls-base - 3.3.8-1
kmod-nls-utf8 - 3.3.8-1
kmod-ppp - 3.3.8-1
kmod-pppoe - 3.3.8-1
kmod-pppox - 3.3.8-1
kmod-scsi-core - 3.3.8-1
kmod-usb-core - 3.3.8-1
kmod-usb-net - 3.3.8-1
kmod-usb-net-cdc-ether - 3.3.8-1
kmod-usb-ohci - 3.3.8-1
kmod-usb-serial - 3.3.8-1
kmod-usb-storage - 3.3.8-1
kmod-usb2 - 3.3.8-1
kmod-wdt-ath79 - 3.3.8-1
libblkid - 2.21.2-1
libblobmsg-json - 2012-07-08-cca2ed6c8cdb3555fea43ff63ba1c9905dd7a164
libc - 0.9.33.2-1
libgcc - 4.6-linaro-1
libip4tc - 1.4.10-4
libiwinfo - 35
libiwinfo-lua - 35
libjson - 0.9-2
liblua - 5.1.4-8
libnl-tiny - 0.1-3
libpcsclite - 1.8.2-1
libpthread - 0.9.33.2-1
librt - 0.9.33.2-1
libubox - 2012-07-08-cca2ed6c8cdb3555fea43ff63ba1c9905dd7a164
libubus - 2012-06-01-a62e2f8c15a65efb1a82404d8f31e3bfc1cbe7d9
libubus-lua - 2012-06-01-a62e2f8c15a65efb1a82404d8f31e3bfc1cbe7d9
libuci - 2012-03-28.1-1
libuci-lua - 2012-03-28.1-1
libusb - 0.1.12-3
libusb-1.0 - 1.0.9-1
libuuid - 2.21.2-1
libxtables - 1.4.10-4
lua - 5.1.4-8
luci - trunk+svn9274-1
luci-app-ddns - trunk+svn9274-1
luci-app-firewall - trunk+svn9274-1
luci-i18n-english - trunk+svn9274-1
luci-lib-core - trunk+svn9274-1
luci-lib-ipkg - trunk+svn9274-1
luci-lib-lmo - trunk+svn9274-1
luci-lib-nixio - trunk+svn9274-1
luci-lib-sys - trunk+svn9274-1
luci-lib-web - trunk+svn9274-1
luci-mod-admin-core - trunk+svn9274-1
luci-mod-admin-full - trunk+svn9274-1
luci-proto-3g - trunk+svn9274-1
luci-proto-core - trunk+svn9274-1
luci-proto-ppp - trunk+svn9274-1
luci-sgi-cgi - trunk+svn9274-1
luci-theme-base - trunk+svn9274-1
luci-theme-openwrt - trunk+svn9274-1
mtd - 18
netifd - 2012-09-13-8a671b56edd90d9b19ea4317ce664793ee324cb4
opkg - 618-2
ppp - 2.4.5-6
ppp-mod-pppoe - 2.4.5-6
swap-utils - 2.21.2-1
swconfig - 10
terminfo - 5.7-5
uboot-envtools - 2012.04.01-1
ubus - 2012-06-01-a62e2f8c15a65efb1a82404d8f31e3bfc1cbe7d9
ubusd - 2012-06-01-a62e2f8c15a65efb1a82404d8f31e3bfc1cbe7d9
uci - 2012-03-28.1-1
uhttpd - 40
usb-modeswitch - 1.2.3-2
usb-modeswitch-data - 20120120-1
usbutils - 005-1
wireless-tools - 29-5
wpad-mini - 20120910-1
zlib - 1.2.7-1
[root@sinemorets:~]# uname -a
Linux sinemorets 3.3.8 #1 Fri Sep 14 17:02:16 EEST 2012 mips GNU/Linux
[root@sinemorets:~]# dmesg | head -n1
[    0.000000] Linux version 3.3.8 (dir2cas@wrt) (gcc version 4.6.3 20120201 (prerelease) (Linaro GCC 4.6-2012.02) ) #1 Fri Sep 14 17:02:16 EEST 2012

Any suggestions?

written_direcon wrote:

@fobo:

Yes, using it with the image from my firmware downloads on a TL-MR3020.

I'll write a up a page on my Wiki.

Hello @written_direcon,

Could you please paste the list of the packages installed/integrated in your firmware right before setting up the extroot. I want to see if I am missing a packages (ex. kmod-usb-storage-extras, since I have only kmod-usb-storage included in my image insted).

BR,
dir2cas

I guess he was either lucky or didn't really had it working. Extroot on usb dongles has been a problem for a long time, even if it works successfully in preinit it could get messed up later when modeswitch kicks in. I don't think its a matter of missing packages or wrong configuration.

Thank you very much jow, that was one of my suggestions as well...

However, should this setup be somehow possible in the future?

@dir2cas: try this:

opkg install http://ecco.selfip.net/backfire/ar71xx/packages/block-extroot-usb-modeswitch_1_all.ipk

this is call usb-modeswitch to switch modem before mount extroot. Works with Huawei E3131.

(Last edited by obsy on 19 Sep 2012, 11:53)

Thanks obsy,

should I remove the standard block-mount packages (used in the trunk branch to provide extroot features as well), because block-moun is integrated in my image?

No. It only extends script. block-mount (-extroot in backfire) is still required.

(Last edited by obsy on 19 Sep 2012, 13:44)

Hi All,
  Attempting the same using MR3020 and Novatel MC760 with 2GB micro SD.  Some questions and observations:
1.  can someone explain at a very high level what the boot sequence is when using extroot?  I searched but found no clear description.  Best I can tell is it first boots from the local flash and at some point mounts USB flash as rootfs and switches to using that?  If I have that right, then how are packages with kernel mods that are installed after the extroot process included in the boot sequence?  I assume that they are installed to the extroot file system which, if above assumption is correct, is not the filesystem used during "phase 1" of boot process.
2.  do you have to install usb-modeswitch before or after enabling extroot or does it not matter?  I had usb-modeswitch working great before I tried extroot, then tried switching to extroot from a clean install and enabled extroot before I installed usb-modeswitch and now usb-modeswitch is not working.
3. I am not sure extroot is working.  On the one hand if I pull the USB stick /usr/bin commands are not found (indicates they are coming from the USB's flash, no?) but on the other hand df/kernel log/mount all show its mounted but the size reported in df is too small, its the size of the native root fs
4.  There are some od delays in the kernel log and the eth link goes up, down then up again.

BusyBox v1.19.4 (2012-08-28 23:48:59 EDT) built-in shell (ash)
Enter 'help' for a list of built-in commands.

  _______                     ________        __
 |       |.-----.-----.-----.|  |  |  |.----.|  |_
 |   -   ||  _  |  -__|     ||  |  |  ||   _||   _|
 |_______||   __|_____|__|__||________||__|  |____|
          |__| W I R E L E S S   F R E E D O M
 -----------------------------------------------------
 ATTITUDE ADJUSTMENT (Bleeding Edge, r33288)
 -----------------------------------------------------
  * 1/4 oz Vodka      Pour all ingredients into mixing
  * 1/4 oz Gin        tin with ice, strain into glass.
  * 1/4 oz Amaretto
  * 1/4 oz Triple sec
  * 1/4 oz Peach schnapps
  * 1/4 oz Sour mix
  * 1 splash Cranberry juice
 -----------------------------------------------------
Booted from internal rom
root@OpenWrt:~# dmesg
[    0.000000] Linux version 3.3.8 (openwrt@callisto.lab.bufferbloat.net) (gcc v
ersion 4.6.3 20120201 (prerelease) (Linaro GCC 4.6-2012.02) ) #1 Thu Aug 30 06:3
6:56 EDT 2012
[    0.000000] MyLoader: sysp=7ab7c29c, boardp=07ac6486, parts=24fed496
[    0.000000] bootconsole [early0] enabled
[    0.000000] CPU revision is: 00019374 (MIPS 24Kc)
[    0.000000] SoC: Atheros AR9330 rev 1
[    0.000000] Clocks: CPU:400.000MHz, DDR:400.000MHz, AHB:200.000MHz, Ref:25.00
0MHz
[    0.000000] Determined physical RAM map:
[    0.000000]  memory: 02000000 @ 00000000 (usable)
[    0.000000] Initrd not found or empty - disabling initrd
[    0.000000] Zone PFN ranges:
[    0.000000]   Normal   0x00000000 -> 0x00002000
[    0.000000] Movable zone start PFN for each node
[    0.000000] Early memory PFN ranges
[    0.000000]     0: 0x00000000 -> 0x00002000
[    0.000000] On node 0 totalpages: 8192
[    0.000000] free_area_init_node: node 0, pgdat 8031a620, node_mem_map 8100000
0
[    0.000000]   Normal zone: 64 pages used for memmap
[    0.000000]   Normal zone: 0 pages reserved
[    0.000000]   Normal zone: 8128 pages, LIFO batch:0
[    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 pag
es: 8128
[    0.000000] Kernel command line:  board=TL-MR3020 console=ttyATH0,115200 root
fstype=squashfs,jffs2 noinitrd
[    0.000000] PID hash table entries: 128 (order: -3, 512 bytes)
[    0.000000] Dentry cache hash table entries: 4096 (order: 2, 16384 bytes)
[    0.000000] Inode-cache hash table entries: 2048 (order: 1, 8192 bytes)
[    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] Writing ErrCtl register=00000000
[    0.000000] Readback ErrCtl register=00000000
[    0.000000] Memory: 28952k/32768k available (2215k kernel code, 3816k reserve
d, 579k data, 208k init, 0k highmem)
[    0.000000] SLUB: Genslabs=9, HWalign=32, Order=0-3, MinObjects=0, CPUs=1, No
des=1
[    0.000000] NR_IRQS:51
[    0.000000] Calibrating delay loop... 265.42 BogoMIPS (lpj=1327104)
[    0.080000] pid_max: default: 32768 minimum: 301
[    0.080000] Mount-cache hash table entries: 512
[    0.090000] NET: Registered protocol family 16
[    0.090000] gpiochip_add: registered GPIOs 0 to 29 on device: ath79
[    0.100000] MIPS: machine is TP-LINK TL-MR3020
[    0.340000] bio: create slab <bio-0> at 0
[    0.350000] Switching to clocksource MIPS
[    0.350000] NET: Registered protocol family 2
[    0.360000] IP route cache hash table entries: 1024 (order: 0, 4096 bytes)
[    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.380000] TCP reno registered
[    0.380000] UDP hash table entries: 256 (order: 0, 4096 bytes)
[    0.390000] UDP-Lite hash table entries: 256 (order: 0, 4096 bytes)
[    0.390000] NET: Registered protocol family 1
[    0.400000] PCI: CLS 0 bytes, default 32
[    0.410000] squashfs: version 4.0 (2009/01/31) Phillip Lougher
[    0.420000] JFFS2 version 2.2 (NAND) (SUMMARY) (LZMA) (RTIME) (CMODE_PRIORITY
) (c) 2001-2006 Red Hat, Inc.
[    0.430000] msgmni has been set to 56
[    0.430000] Block layer SCSI generic (bsg) driver version 0.4 loaded (major 2
54)
[    0.440000] io scheduler noop registered
[    0.440000] io scheduler deadline registered (default)
[    0.450000] Serial: 8250/16550 driver, 16 ports, IRQ sharing enabled
[    0.460000] ar933x-uart: ttyATH0 at MMIO 0x18020000 (irq = 11) is a AR933X UA
RT
[    0.470000] console [ttyATH0] enabled, bootconsole disabled
[    0.480000] m25p80 spi0.0: found s25sl032a, expected m25p80
[    0.480000] m25p80 spi0.0: s25sl032a (4096 Kbytes)
[    0.490000] 5 tp-link partitions found on MTD device spi0.0
[    0.490000] Creating 5 MTD partitions on "spi0.0":
[    0.500000] 0x000000000000-0x000000020000 : "u-boot"
[    0.510000] 0x000000020000-0x00000011cf64 : "kernel"
[    0.510000] mtd: partition "kernel" must either start or end on erase block b
oundary or be smaller than an erase block -- forcing read-only
[    0.520000] 0x00000011cf64-0x0000003f0000 : "rootfs"
[    0.530000] mtd: partition "rootfs" must either start or end on erase block b
oundary or be smaller than an erase block -- forcing read-only
[    0.540000] mtd: partition "rootfs" set to be root filesystem
[    0.550000] mtd: partition "rootfs_data" created automatically, ofs=290000, l
en=160000
[    0.550000] 0x000000290000-0x0000003f0000 : "rootfs_data"
[    0.560000] 0x0000003f0000-0x000000400000 : "art"
[    0.570000] 0x000000020000-0x0000003f0000 : "firmware"
[    0.590000] ag71xx_mdio: probed
[    0.600000] eth0: Atheros AG71xx at 0xb9000000, irq 4
[    1.150000] ag71xx ag71xx.0: eth0: connected to PHY at ag71xx-mdio.1:00 [uid=
004dd041, driver=Generic PHY]
[    1.160000] TCP cubic registered
[    1.160000] NET: Registered protocol family 17
[    1.160000] Bridge firewalling registered
[    1.170000] 8021q: 802.1Q VLAN Support v1.8
[    1.180000] VFS: Mounted root (squashfs filesystem) readonly on device 31:2.
[    1.190000] Freeing unused kernel memory: 208k freed
[    3.240000] Registered led device: tp-link:green:3g
[    3.240000] Registered led device: tp-link:green:wlan
[    3.240000] Registered led device: tp-link:green:lan
[    3.240000] Registered led device: tp-link:green:wps
[    6.570000] JFFS2 notice: (440) jffs2_build_xattr_subsystem: complete buildin
g xattr subsystem, 1 of xdatum (1 unchecked, 0 orphan) and 9 of xref (0 dead, 2
orphan) found.
[    7.170000] eth0: link up (10Mbps/Half duplex)
[   17.320000] SCSI subsystem initialized
[   17.490000] usbcore: registered new interface driver usbfs
[   17.500000] usbcore: registered new interface driver hub
[   17.500000] usbcore: registered new device driver usb
[   17.970000] ehci_hcd: USB 2.0 'Enhanced' Host Controller (EHCI) Driver
[   17.980000] ehci-platform ehci-platform: Generic Platform EHCI Controller
[   17.980000] ehci-platform ehci-platform: new USB bus registered, assigned bus
 number 1
[   18.020000] ehci-platform ehci-platform: irq 3, io mem 0x1b000000
[   18.040000] ehci-platform ehci-platform: USB 2.0 started, EHCI 1.00
[   18.040000] hub 1-0:1.0: USB hub found
[   18.040000] hub 1-0:1.0: 1 port detected
[   18.060000] ohci_hcd: USB 1.1 'Open' Host Controller (OHCI) Driver
[   18.240000] Initializing USB Mass Storage driver...
[   18.240000] usbcore: registered new interface driver usb-storage
[   18.250000] USB Mass Storage support registered.
[   18.440000] usb 1-1: new high-speed USB device number 2 using ehci-platform
[   18.590000] hub 1-1:1.0: USB hub found
[   18.590000] hub 1-1:1.0: 7 ports detected
[   18.870000] usb 1-1.5: new full-speed USB device number 3 using ehci-platform

[   21.080000] usb 1-1.1: new full-speed USB device number 4 using ehci-platform

[   21.190000] usb 1-1.1: config 1 has an invalid interface number: 4 but max is
 1
[   21.190000] usb 1-1.1: config 1 has no interface number 1
[   21.210000] scsi0 : usb-storage 1-1.1:1.0
[   21.210000] scsi1 : usb-storage 1-1.1:1.4
[   22.210000] scsi 0:0:0:0: CD-ROM            Novatel  Mass Storage     1.00 PQ
: 0 ANSI: 2
[   22.220000] scsi 1:0:0:0: Direct-Access     Novatel  MMC Storage      2.31 PQ
: 0 ANSI: 2
[   22.230000] sd 1:0:0:0: [sda] Attached SCSI removable disk
[   38.760000] eth0: link down
[   39.240000] Compat-wireless backport release: compat-wireless-2012-07-13
[   39.240000] Backport based on wireless-testing.git master-2012-07-16
[   39.250000] compat.git: wireless-testing.git
[   39.370000] cfg80211: Calling CRDA to update world regulatory domain
[   39.370000] cfg80211: World regulatory domain updated:
[   39.380000] cfg80211:   (start_freq - end_freq @ bandwidth), (max_antenna_gai
n, max_eirp)
[   39.380000] cfg80211:   (2402000 KHz - 2472000 KHz @ 40000 KHz), (300 mBi, 20
00 mBm)
[   39.390000] cfg80211:   (2457000 KHz - 2482000 KHz @ 20000 KHz), (300 mBi, 20
00 mBm)
[   39.400000] cfg80211:   (2474000 KHz - 2494000 KHz @ 20000 KHz), (300 mBi, 20
00 mBm)
[   39.410000] cfg80211:   (5170000 KHz - 5250000 KHz @ 40000 KHz), (300 mBi, 20
00 mBm)
[   39.410000] cfg80211:   (5735000 KHz - 5835000 KHz @ 40000 KHz), (300 mBi, 20
00 mBm)
[   40.040000] ath: EEPROM regdomain: 0x0
[   40.040000] ath: EEPROM indicates default country code should be used
[   40.040000] ath: doing EEPROM country->regdmn map search
[   40.040000] ath: country maps to regdmn code: 0x3a
[   40.040000] ath: Country alpha2 being used: US
[   40.040000] ath: Regpair used: 0x3a
[   40.050000] ieee80211 phy0: Selected rate control algorithm 'minstrel_ht'
[   40.050000] Registered led device: ath9k-phy0
[   40.050000] ieee80211 phy0: Atheros AR9330 Rev:1 mem=0xb8100000, irq=2
[   40.050000] cfg80211: Calling CRDA for country: US
[   40.060000] cfg80211: Regulatory domain changed to country: US
[   40.060000] cfg80211:   (start_freq - end_freq @ bandwidth), (max_antenna_gai
n, max_eirp)
[   40.070000] cfg80211:   (2402000 KHz - 2472000 KHz @ 40000 KHz), (300 mBi, 27
00 mBm)
[   40.080000] cfg80211:   (5170000 KHz - 5250000 KHz @ 40000 KHz), (300 mBi, 17
00 mBm)
[   40.090000] cfg80211:   (5250000 KHz - 5330000 KHz @ 40000 KHz), (300 mBi, 20
00 mBm)
[   40.100000] cfg80211:   (5490000 KHz - 5600000 KHz @ 40000 KHz), (300 mBi, 20
00 mBm)
[   40.100000] cfg80211:   (5650000 KHz - 5710000 KHz @ 40000 KHz), (300 mBi, 20
00 mBm)
[   40.110000] cfg80211:   (5735000 KHz - 5835000 KHz @ 40000 KHz), (300 mBi, 30
00 mBm)
[   40.340000] PPP generic driver version 2.4.2
[   40.580000] ip_tables: (C) 2000-2006 Netfilter Core Team
[   40.700000] NET: Registered protocol family 24
[   40.760000] nf_conntrack version 0.5.0 (455 buckets, 1820 max)
[   44.160000] device eth0 entered promiscuous mode
[   44.410000] eth0: link up (10Mbps/Half duplex)
[   44.410000] br-lan: port 1(eth0) entered forwarding state
[   44.420000] br-lan: port 1(eth0) entered forwarding state
[   46.420000] br-lan: port 1(eth0) entered forwarding state
[   47.460000] usb 1-1.1: USB disconnect, device number 4
[   48.730000] usb 1-1.1: new full-speed USB device number 5 using ehci-platform

[   48.810000] usb 1-1.1: device descriptor read/64, error -32
[   49.030000] scsi2 : usb-storage 1-1.1:1.4
[   50.040000] scsi 2:0:0:0: Direct-Access     Novatel  MMC Storage      2.31 PQ
: 0 ANSI: 2
[   50.050000] sd 2:0:0:0: [sda] 3862528 512-byte logical blocks: (1.97 GB/1.84
GiB)
[   50.070000] sd 2:0:0:0: [sda] Write Protect is off
[   50.070000] sd 2:0:0:0: [sda] Mode Sense: 0b 00 00 08
[   50.070000] sd 2:0:0:0: [sda] No Caching mode page present
[   50.070000] sd 2:0:0:0: [sda] Assuming drive cache: write through
[   50.100000] sd 2:0:0:0: [sda] No Caching mode page present
[   50.100000] sd 2:0:0:0: [sda] Assuming drive cache: write through
[   50.130000]  sda: sda1
[   50.140000] sd 2:0:0:0: [sda] No Caching mode page present
[   50.140000] sd 2:0:0:0: [sda] Assuming drive cache: write through
[   50.150000] sd 2:0:0:0: [sda] Attached SCSI removable disk
[   84.720000] EXT4-fs (sda1): recovery complete
[   84.720000] EXT4-fs (sda1): mounted filesystem with ordered data mode. Opts:
(null)
root@OpenWrt:~#
root@OpenWrt:~# df
Filesystem           1K-blocks      Used Available Use% Mounted on
rootfs                    1408       792       616  56% /
/dev/root                 1536      1536         0 100% /rom
tmpfs                    14580        76     14504   1% /tmp
tmpfs                      512         0       512   0% /dev
/dev/mtdblock3            1408       792       616  56% /overlay
overlayfs:/overlay        1408       792       616  56% /
/dev/sda1                 1408       792       616  56% /
root@OpenWrt:~#
root@OpenWrt:~# 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)
tmpfs on /dev type tmpfs (rw,noatime,size=512k,mode=755)
devpts on /dev/pts type devpts (rw,noatime,mode=600)
/dev/mtdblock3 on /overlay type jffs2 (rw,noatime)
overlayfs:/overlay on / type overlayfs (rw,relatime,lowerdir=/,upperdir=/overla
)
debugfs on /sys/kernel/debug type debugfs (rw,relatime)
none on /proc/bus/usb type usbfs (rw,relatime)
/dev/sda1 on / type ext4 (rw,sync,relatime,user_xattr,barrier=1,data=ordered)
root@OpenWrt:~#

which shows the external flash is mounted as /dev/sda1 but the size is incorrect.  So which is it, extroot working or not?

Thanks all for your help.

(Last edited by choogenboom on 21 Sep 2012, 13:49)

I really have this workin reliable with overlay and whole root :-)

written_direcon wrote:

I really have this workin reliable with overlay and whole root :-)

Do you have detailed instructions of how you did it?

I just did it with a standard USB stick and works fine, so I am comfortable I can get it working that way. I am now plowing ahead with my novatel MC760 and getting it to extroot on its micro sd.  A howto would be much appreciated.

written_direcon wrote:

I really have this workin reliable with overlay and whole root :-)

I read your guide here

http://www.custom-openwrt-builds.info/w … nal_RootFS

and I would be curious to see the output of df for your system.  If I follow your instructions it will mount on /overlay but not on rootfs.  rootfs still shows its using the internal flash.

I put usb and led driver, also fs support into kernel, so it will load early.
And I don't need USB1.0, so remove USB1.0 support can speed up a little bit boot time and save some little kernel space.

root@MR3020:/# dmesg
[    0.000000] Linux version 3.3.8 (gcc version 4.6.3 20120201 (prerelease) (Linaro GCC 4.6-2012.02) ) #2 Thu Sep 20 16:59:38
[    0.000000] bootconsole [early0] enabled
[    0.000000] CPU revision is: 00019374 (MIPS 24Kc)
[    0.000000] SoC: Atheros AR9330 rev 1
[    0.000000] Clocks: CPU:400.000MHz, DDR:400.000MHz, AHB:200.000MHz, Ref:25.000MHz
[    0.000000] Determined physical RAM map:
[    0.000000]  memory: 02000000 @ 00000000 (usable)
[    0.000000] Initrd not found or empty - disabling initrd
[    0.000000] Zone PFN ranges:
[    0.000000]   Normal   0x00000000 -> 0x00002000
[    0.000000] Movable zone start PFN for each node
[    0.000000] Early memory PFN ranges
[    0.000000]     0: 0x00000000 -> 0x00002000
[    0.000000] On node 0 totalpages: 8192
[    0.000000] free_area_init_node: node 0, pgdat 8038c430, node_mem_map 81000000
[    0.000000]   Normal zone: 64 pages used for memmap
[    0.000000]   Normal zone: 0 pages reserved
[    0.000000]   Normal zone: 8128 pages, LIFO batch:0
[    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: 8128
[    0.000000] Kernel command line:  board=TL-MR3020 console=ttyATH0,115200 rootfstype=squashfs,jffs2 noinitrd
[    0.000000] PID hash table entries: 128 (order: -3, 512 bytes)
[    0.000000] Dentry cache hash table entries: 4096 (order: 2, 16384 bytes)
[    0.000000] Inode-cache hash table entries: 2048 (order: 1, 8192 bytes)
[    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] Writing ErrCtl register=00000000
[    0.000000] Readback ErrCtl register=00000000
[    0.000000] Memory: 28528k/32768k available (2616k kernel code, 4240k reserved, 633k data, 180k init, 0k highmem)
[    0.000000] SLUB: Genslabs=9, HWalign=32, Order=0-3, MinObjects=0, CPUs=1, Nodes=1
[    0.000000] NR_IRQS:51
[    0.000000] Calibrating delay loop... 265.42 BogoMIPS (lpj=1327104)
[    0.080000] pid_max: default: 32768 minimum: 301
[    0.080000] Mount-cache hash table entries: 512
[    0.090000] NET: Registered protocol family 16
[    0.090000] gpiochip_add: registered GPIOs 0 to 29 on device: ath79
[    0.100000] MIPS: machine is TP-LINK TL-MR3020
[    0.350000] bio: create slab <bio-0> at 0
[    0.360000] usbcore: registered new interface driver usbfs
[    0.360000] usbcore: registered new interface driver hub
[    0.370000] usbcore: registered new device driver usb
[    0.370000] Switching to clocksource MIPS
[    0.380000] NET: Registered protocol family 2
[    0.380000] IP route cache hash table entries: 1024 (order: 0, 4096 bytes)
[    0.380000] TCP established hash table entries: 1024 (order: 1, 8192 bytes)
[    0.380000] TCP bind hash table entries: 1024 (order: 0, 4096 bytes)
[    0.390000] TCP: Hash tables configured (established 1024 bind 1024)
[    0.400000] TCP reno registered
[    0.400000] UDP hash table entries: 256 (order: 0, 4096 bytes)
[    0.410000] UDP-Lite hash table entries: 256 (order: 0, 4096 bytes)
[    0.410000] NET: Registered protocol family 1
[    0.420000] PCI: CLS 0 bytes, default 32
[    0.440000] squashfs: version 4.0 (2009/01/31) Phillip Lougher
[    0.450000] NTFS driver 2.1.30 [Flags: R/W].
[    0.450000] JFFS2 version 2.2 (NAND) (SUMMARY) (LZMA) (RTIME) (CMODE_PRIORITY) (c) 2001-2006 Red Hat, Inc.
[    0.460000] msgmni has been set to 55
[    0.460000] io scheduler noop registered
[    0.470000] io scheduler deadline registered (default)
[    0.470000] Serial: 8250/16550 driver, 1 ports, IRQ sharing disabled
[    0.480000] ar933x-uart: ttyATH0 at MMIO 0x18020000 (irq = 11) is a AR933X UART
[    0.480000] console [ttyATH0] enabled, bootconsole disabled
[    0.500000] m25p80 spi0.0: found w25q32, expected m25p80
[    0.500000] m25p80 spi0.0: w25q32 (4096 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-0x000000145710 : "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] 0x000000145710-0x0000003f0000 : "rootfs"
[    0.540000] 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: partition "rootfs" set to be root filesystem
[    0.560000] mtd: partition "rootfs_data" created automatically, ofs=390000, len=60000
[    0.570000] 0x000000390000-0x0000003f0000 : "rootfs_data"
[    0.580000] 0x0000003f0000-0x000000400000 : "art"
[    0.580000] 0x000000020000-0x0000003f0000 : "firmware"
[    0.600000] ag71xx_mdio: probed
[    0.610000] eth0: Atheros AG71xx at 0xb9000000, irq 4
[    1.160000] ag71xx ag71xx.0: eth0: connected to PHY at ag71xx-mdio.1:00 [uid=004dd041, driver=Generic PHY]
[    1.170000] ehci_hcd: USB 2.0 'Enhanced' Host Controller (EHCI) Driver
[    1.180000] ehci-platform ehci-platform: Generic Platform EHCI Controller
[    1.180000] ehci-platform ehci-platform: new USB bus registered, assigned bus number 1
[    1.220000] ehci-platform ehci-platform: irq 3, io mem 0x1b000000
[    1.240000] ehci-platform ehci-platform: USB 2.0 started, EHCI 1.00
[    1.240000] hub 1-0:1.0: USB hub found
[    1.240000] hub 1-0:1.0: 1 port detected
[    1.250000] Registered led device: tp-link:green:3g
[    1.250000] Registered led device: tp-link:green:wlan
[    1.250000] Registered led device: tp-link:green:lan
[    1.250000] Registered led device: tp-link:green:wps
[    1.250000] TCP westwood registered
[    1.250000] NET: Registered protocol family 17
[    1.260000] 8021q: 802.1Q VLAN Support v1.8
[    1.270000] VFS: Mounted root (squashfs filesystem) readonly on device 31:2.
[    1.270000] Freeing unused kernel memory: 180k freed
[    1.590000] usb 1-1: new high-speed USB device number 2 using ehci-platform
[    6.190000] eth0: link up (100Mbps/Full duplex)
[    6.920000] JFFS2 notice: (422) jffs2_build_xattr_subsystem: complete building xattr subsystem, 0 of xdatum (0 unchecked, 0 orphan) and 0 of xref (0 dead, 0 orphan) found.
[    7.610000] SCSI subsystem initialized
[    7.720000] Initializing USB Mass Storage driver...
[    7.730000] scsi0 : usb-storage 1-1:1.0
[    7.730000] usbcore: registered new interface driver usb-storage
[    7.740000] USB Mass Storage support registered.
[    8.730000] scsi 0:0:0:0: Direct-Access     CBM      Flash Disk       5.00 PQ: 0 ANSI: 2
[    8.740000] sd 0:0:0:0: [sda] 2054144 512-byte logical blocks: (1.05 GB/1003 MiB)
[    8.740000] sd 0:0:0:0: [sda] Write Protect is off
[    8.750000] sd 0:0:0:0: [sda] Mode Sense: 0b 00 00 08
[    8.750000] sd 0:0:0:0: [sda] No Caching mode page present
[    8.750000] sd 0:0:0:0: [sda] Assuming drive cache: write through
[    8.760000] sd 0:0:0:0: [sda] No Caching mode page present
[    8.770000] sd 0:0:0:0: [sda] Assuming drive cache: write through
[    8.770000]  sda: sda1 sda2 sda3
[    8.780000] sd 0:0:0:0: [sda] No Caching mode page present
[    8.790000] sd 0:0:0:0: [sda] Assuming drive cache: write through
[    8.790000] sd 0:0:0:0: [sda] Attached SCSI removable disk
[   28.290000] EXT4-fs (sda1): warning: mounting unchecked fs, running e2fsck is recommended
[   28.300000] EXT4-fs (sda1): mounted filesystem without journal. Opts: (null)
[   28.490000] eth0: link down
[   30.180000] Compat-drivers backport release: compat-drivers-2012-09-04-2-gddac993
[   30.180000] Backport based on wireless-testing.git master-2012-09-07
[   30.190000] compat.git: wireless-testing.git
[   30.220000] cfg80211: Calling CRDA to update world regulatory domain
[   30.230000] cfg80211: World regulatory domain updated:
[   30.230000] cfg80211:   (start_freq - end_freq @ bandwidth), (max_antenna_gain, max_eirp)
[   30.240000] cfg80211:   (2402000 KHz - 2472000 KHz @ 40000 KHz), (300 mBi, 2000 mBm)
[   30.250000] cfg80211:   (2457000 KHz - 2482000 KHz @ 20000 KHz), (300 mBi, 2000 mBm)
[   30.260000] cfg80211:   (2474000 KHz - 2494000 KHz @ 20000 KHz), (300 mBi, 2000 mBm)
[   30.270000] cfg80211:   (5170000 KHz - 5250000 KHz @ 40000 KHz), (300 mBi, 2000 mBm)
[   30.270000] cfg80211:   (5735000 KHz - 5835000 KHz @ 40000 KHz), (300 mBi, 2000 mBm)
[   31.020000] ath: EEPROM regdomain: 0x0
[   31.020000] ath: EEPROM indicates default country code should be used
[   31.020000] ath: doing EEPROM country->regdmn map search
[   31.020000] ath: country maps to regdmn code: 0x3a
[   31.020000] ath: Country alpha2 being used: US
[   31.020000] ath: Regpair used: 0x3a
[   31.030000] ieee80211 phy0: Selected rate control algorithm 'minstrel_ht'
[   31.030000] Registered led device: ath9k-phy0
[   31.030000] ieee80211 phy0: Atheros AR9330 Rev:1 mem=0xb8100000, irq=2
[   31.030000] cfg80211: Calling CRDA for country: US
[   31.040000] cfg80211: Regulatory domain changed to country: US
[   31.040000] cfg80211:   (start_freq - end_freq @ bandwidth), (max_antenna_gain, max_eirp)
[   31.050000] cfg80211:   (2402000 KHz - 2472000 KHz @ 40000 KHz), (300 mBi, 2700 mBm)
[   31.060000] cfg80211:   (5170000 KHz - 5250000 KHz @ 40000 KHz), (300 mBi, 1700 mBm)
[   31.070000] cfg80211:   (5250000 KHz - 5330000 KHz @ 40000 KHz), (300 mBi, 2000 mBm)
[   31.080000] cfg80211:   (5490000 KHz - 5600000 KHz @ 40000 KHz), (300 mBi, 2000 mBm)
[   31.080000] cfg80211:   (5650000 KHz - 5710000 KHz @ 40000 KHz), (300 mBi, 2000 mBm)
[   31.090000] cfg80211:   (5735000 KHz - 5835000 KHz @ 40000 KHz), (300 mBi, 3000 mBm)
[   31.220000] PPP generic driver version 2.4.2
[   31.460000] ip_tables: (C) 2000-2006 Netfilter Core Team
[   31.700000] NET: Registered protocol family 24
[   31.740000] nf_conntrack version 0.5.0 (448 buckets, 1792 max)
[   32.090000] xt_time: kernel timezone is -0000
[   32.400000] usbcore: registered new interface driver cdc_acm
[   32.400000] cdc_acm: USB Abstract Control Model driver for USB modems and ISDN adapters
[   32.520000] usbcore: registered new interface driver usbserial
[   32.520000] USB Serial support registered for generic
[   32.530000] usbcore: registered new interface driver usbserial_generic
[   32.530000] usbserial: USB Serial Driver core
[   32.670000] USB Serial support registered for GSM modem (1-port)
[   32.680000] usbcore: registered new interface driver option
[   32.680000] option: v0.7.2:USB Driver for GSM modems
[   35.180000] Adding 28176k swap on /dev/sda3.  Priority:-1 extents:1 across:28176k
[   35.440000] EXT4-fs (sda2): warning: mounting unchecked fs, running e2fsck is recommended
[   35.450000] EXT4-fs (sda2): mounted filesystem without journal. Opts: (null)
[   35.640000] JFFS2 notice: (750) jffs2_build_xattr_subsystem: complete building xattr subsystem, 0 of xdatum (0 unchecked, 0 orphan) and 0 of xref (0 dead, 0 orphan) found.
[   38.150000] device eth0 entered promiscuous mode
[   38.330000] eth0: link up (100Mbps/Full duplex)
[   38.330000] br-WAN: port 1(eth0) entered forwarding state
[   38.340000] br-WAN: port 1(eth0) entered forwarding state
[   40.340000] br-WAN: port 1(eth0) entered forwarding state
[   40.670000] cfg80211: Calling CRDA for country: JP
[   40.680000] cfg80211: Regulatory domain changed to country: JP
[   40.680000] cfg80211:   (start_freq - end_freq @ bandwidth), (max_antenna_gain, max_eirp)
[   40.690000] cfg80211:   (2402000 KHz - 2472000 KHz @ 40000 KHz), (N/A, 2000 mBm)
[   40.700000] cfg80211:   (2457000 KHz - 2482000 KHz @ 20000 KHz), (N/A, 2000 mBm)
[   40.710000] cfg80211:   (2474000 KHz - 2494000 KHz @ 20000 KHz), (N/A, 2000 mBm)
[   40.710000] cfg80211:   (4910000 KHz - 4930000 KHz @ 10000 KHz), (N/A, 2300 mBm)
[   40.720000] cfg80211:   (4910000 KHz - 4990000 KHz @ 40000 KHz), (N/A, 2300 mBm)
[   40.730000] cfg80211:   (4930000 KHz - 4950000 KHz @ 10000 KHz), (N/A, 2300 mBm)
[   40.730000] cfg80211:   (5030000 KHz - 5045000 KHz @ 10000 KHz), (N/A, 2300 mBm)
[   40.740000] cfg80211:   (5030000 KHz - 5090000 KHz @ 40000 KHz), (N/A, 2300 mBm)
[   40.750000] cfg80211:   (5050000 KHz - 5060000 KHz @ 10000 KHz), (N/A, 2300 mBm)
[   40.760000] cfg80211:   (5170000 KHz - 5250000 KHz @ 40000 KHz), (N/A, 2000 mBm)
[   40.760000] cfg80211:   (5250000 KHz - 5330000 KHz @ 40000 KHz), (N/A, 2000 mBm)
[   40.770000] cfg80211:   (5490000 KHz - 5710000 KHz @ 40000 KHz), (N/A, 2300 mBm)
root@MR3020:/# df -h&&free
Filesystem                Size      Used Available Use% Mounted on
rootfs                  188.7M      8.6M    170.5M   5% /
/dev/root                 2.5M      2.5M         0 100% /rom
tmpfs                    14.0M    176.0K     13.8M   1% /tmp
tmpfs                   512.0K         0    512.0K   0% /dev
/dev/sda1               188.7M      8.6M    170.5M   5% /overlay
overlayfs:/overlay      188.7M      8.6M    170.5M   5% /
/dev/mtdblock3          384.0K    204.0K    180.0K  53% /mnt/internal
//server.lan/share
                         18.4G      8.7G      9.8G  47% /tmp/smb
             total         used         free       shared      buffers
Mem:         28708        24924         3784            0         2236
-/+ buffers:              22688         6020
Swap:        28176            0        28176

I mount the internal jffs2 back to another directory so I can switch extroot  on/off easier.
And I have tweaked TCP congestion to Westwood+ instead of the default Cubic.  Some said it has better performance over wireless and wired network.

choogenboom wrote:
written_direcon wrote:

I really have this workin reliable with overlay and whole root :-)

I read your guide here

http://www.custom-openwrt-builds.info/w … nal_RootFS

and I would be curious to see the output of df for your system.  If I follow your instructions it will mount on /overlay but not on rootfs.  rootfs still shows its using the internal flash.

Here you go:
df -h

Filesystem                Size      Used Available Use% Mounted on
rootfs                    1.6G     16.0E      1.6G 100% /
/dev/root                 2.3M      2.3M         0 100% /rom
tmpfs                    14.4M     96.0K     14.3M   1% /tmp
tmpfs                   512.0K         0    512.0K   0% /dev
/dev/sda5                 1.6G     16.0E      1.6G 100% /overlay
overlayfs:/overlay        1.6G     16.0E      1.6G 100% /

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)
tmpfs on /dev type tmpfs (rw,noatime,size=512k,mode=755)
devpts on /dev/pts type devpts (rw,noatime,mode=600)
/dev/sda5 on /overlay type ext4 (rw,sync,relatime,user_xattr,barrier=1,data=ordered)
overlayfs:/overlay on / type overlayfs (rw,relatime,lowerdir=/,upperdir=/overlay)
debugfs on /sys/kernel/debug type debugfs (rw,relatime)
none on /proc/bus/usb type usbfs (rw,relatime)

Got extroot running from micrro SD hosted by a Novatel MC760 3G USB stick (or dongle) to work after much trial and error.  Here are some things I learned along the way:

1 - you do not need to dynamically (ie every time at boot) disable the CDROM.  The Novatel Mobilink modem configuration and management software can configure the stick to disable the CDROM, a setting which is made in the sticks FLASH.  After disabling "Auto Install" following these instructions http://www.nvtl.com/index.php?option=co … p;catid=33 the CDROM was not mounted during boot and instead the SD card was mounted (see log below) early in teh boot sequence thus making it available for extroot.

2 - using either the usb-modeswitch or the sdparm method to turn off CDROM dynamically at boot time does not allow extroot to work, at least for this stick.  Since the sticks SD card is not enabled until after the calls to usb-modeswitch or sdparm, the sticks SD card filesystem is not present when extroot lookks to mount it at boot time.  Note that it _does_ mount later in the boot sequence but not as rootfs.

3 - if you really do want to use the dynamic (ie at boot time) disable of the CDROM, between the two choices of usb-modeswitch or sdparm, the sdparm method is IMHO better, if only because it uses much less code space.  https://forum.openwrt.org/viewtopic.php?id=15919 teaches how to use sdparm with hotplug to automatically invoke sdparm when the stick's CDROM is mounted.  But note, again, with this stick neither the sdparm or usb-modeswitch methods work if you want to use extroot

4 - following the extroot instructions found here http://wiki.openwrt.org/doc/howto/extroot worked for my system

5 - I have yet to find a clear explanation of the sequence of events for extroot booting.  Best I can tell it starts booting from ROM, then switches over to the extroot filesystem (if its available, which is the key to it working/mounting) early in the boot process.  Exactly when it switches, what triggers it, and when the USB filesystem MUST be available are questions I could not find answers to.  Another solution that could work is if you could invoke the dynamic commands to unmount the CDROM (either sdparm or usb-modeswitch methods) then force a wait for the command to ripple through until the USB filesystem is available for mounting then continuing boot I am guessing the extroot would then find the filesystem when it needed it.


resulting kernel log and output from df for my working setup is

root@OpenWrt:/# dmesg
[    0.000000] Linux version 3.3.8 (openwrt@callisto.lab.bufferbloat.net) (gcc v
ersion 4.6.3 20120201 (prerelease) (Linaro GCC 4.6-2012.02) ) #1 Fri Sep 21 02:5
8:52 EDT 2012
[    0.000000] MyLoader: sysp=7ab7c29c, boardp=07ac6486, parts=24fed496
[    0.000000] bootconsole [early0] enabled
[    0.000000] CPU revision is: 00019374 (MIPS 24Kc)
[    0.000000] SoC: Atheros AR9330 rev 1
[    0.000000] Clocks: CPU:400.000MHz, DDR:400.000MHz, AHB:200.000MHz, Ref:25.00
0MHz
[    0.000000] Determined physical RAM map:
[    0.000000]  memory: 02000000 @ 00000000 (usable)
[    0.000000] Initrd not found or empty - disabling initrd
[    0.000000] Zone PFN ranges:
[    0.000000]   Normal   0x00000000 -> 0x00002000
[    0.000000] Movable zone start PFN for each node
[    0.000000] Early memory PFN ranges
[    0.000000]     0: 0x00000000 -> 0x00002000
[    0.000000] On node 0 totalpages: 8192
[    0.000000] free_area_init_node: node 0, pgdat 8031b100, node_mem_map 8100000
0
[    0.000000]   Normal zone: 64 pages used for memmap
[    0.000000]   Normal zone: 0 pages reserved
[    0.000000]   Normal zone: 8128 pages, LIFO batch:0
[    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 pag
es: 8128
[    0.000000] Kernel command line:  board=TL-MR3020 console=ttyATH0,115200 root
fstype=squashfs,jffs2 noinitrd
[    0.000000] PID hash table entries: 128 (order: -3, 512 bytes)
[    0.000000] Dentry cache hash table entries: 4096 (order: 2, 16384 bytes)
[    0.000000] Inode-cache hash table entries: 2048 (order: 1, 8192 bytes)
[    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] Writing ErrCtl register=00000000
[    0.000000] Readback ErrCtl register=00000000
[    0.000000] Memory: 28948k/32768k available (2216k kernel code, 3820k reserve
d, 581k data, 208k init, 0k highmem)
[    0.000000] SLUB: Genslabs=9, HWalign=32, Order=0-3, MinObjects=0, CPUs=1, No
des=1
[    0.000000] NR_IRQS:51
[    0.000000] Calibrating delay loop... 265.42 BogoMIPS (lpj=1327104)
[    0.080000] pid_max: default: 32768 minimum: 301
[    0.080000] Mount-cache hash table entries: 512
[    0.090000] NET: Registered protocol family 16
[    0.090000] gpiochip_add: registered GPIOs 0 to 29 on device: ath79
[    0.100000] MIPS: machine is TP-LINK TL-MR3020
[    0.350000] bio: create slab <bio-0> at 0
[    0.360000] Switching to clocksource MIPS
[    0.360000] NET: Registered protocol family 2
[    0.370000] IP route cache hash table entries: 1024 (order: 0, 4096 bytes)
[    0.370000] TCP established hash table entries: 1024 (order: 1, 8192 bytes)
[    0.370000] TCP bind hash table entries: 1024 (order: 0, 4096 bytes)
[    0.380000] TCP: Hash tables configured (established 1024 bind 1024)
[    0.390000] TCP reno registered
[    0.390000] UDP hash table entries: 256 (order: 0, 4096 bytes)
[    0.400000] UDP-Lite hash table entries: 256 (order: 0, 4096 bytes)
[    0.400000] NET: Registered protocol family 1
[    0.410000] PCI: CLS 0 bytes, default 32
[    0.420000] squashfs: version 4.0 (2009/01/31) Phillip Lougher
[    0.430000] JFFS2 version 2.2 (NAND) (SUMMARY) (LZMA) (RTIME) (CMODE_PRIORITY
) (c) 2001-2006 Red Hat, Inc.
[    0.440000] msgmni has been set to 56
[    0.440000] Block layer SCSI generic (bsg) driver version 0.4 loaded (major 2
54)
[    0.450000] io scheduler noop registered
[    0.450000] io scheduler deadline registered (default)
[    0.460000] Serial: 8250/16550 driver, 16 ports, IRQ sharing enabled
[    0.470000] ar933x-uart: ttyATH0 at MMIO 0x18020000 (irq = 11) is a AR933X UA
RT
[    0.480000] console [ttyATH0] enabled, bootconsole disabled
[    0.490000] m25p80 spi0.0: found s25sl032a, expected m25p80
[    0.490000] m25p80 spi0.0: s25sl032a (4096 Kbytes)
[    0.500000] 5 tp-link partitions found on MTD device spi0.0
[    0.500000] Creating 5 MTD partitions on "spi0.0":
[    0.510000] 0x000000000000-0x000000020000 : "u-boot"
[    0.520000] 0x000000020000-0x00000011d11c : "kernel"
[    0.520000] mtd: partition "kernel" must either start or end on erase block b
oundary or be smaller than an erase block -- forcing read-only
[    0.530000] 0x00000011d11c-0x0000003f0000 : "rootfs"
[    0.540000] mtd: partition "rootfs" must either start or end on erase block b
oundary or be smaller than an erase block -- forcing read-only
[    0.550000] mtd: partition "rootfs" set to be root filesystem
[    0.560000] mtd: partition "rootfs_data" created automatically, ofs=2A0000, l
en=150000
[    0.560000] 0x0000002a0000-0x0000003f0000 : "rootfs_data"
[    0.570000] 0x0000003f0000-0x000000400000 : "art"
[    0.580000] 0x000000020000-0x0000003f0000 : "firmware"
[    0.600000] ag71xx_mdio: probed
[    0.610000] eth0: Atheros AG71xx at 0xb9000000, irq 4
[    1.160000] ag71xx ag71xx.0: eth0: connected to PHY at ag71xx-mdio.1:00 [uid=
004dd041, driver=Generic PHY]
[    1.170000] TCP cubic registered
[    1.170000] NET: Registered protocol family 17
[    1.170000] Bridge firewalling registered
[    1.180000] 8021q: 802.1Q VLAN Support v1.8
[    1.190000] VFS: Mounted root (squashfs filesystem) readonly on device 31:2.
[    1.200000] Freeing unused kernel memory: 208k freed
[    3.230000] Registered led device: tp-link:green:3g
[    3.230000] Registered led device: tp-link:green:wlan
[    3.230000] Registered led device: tp-link:green:lan
[    3.230000] Registered led device: tp-link:green:wps
[    6.170000] eth0: link up (100Mbps/Full duplex)
[    6.550000] JFFS2 notice: (441) jffs2_build_xattr_subsystem: complete buildin
g xattr subsystem, 1 of xdatum (1 unchecked, 0 orphan) and 8 of xref (0 dead, 0
orphan) found.
[    7.190000] SCSI subsystem initialized
[    7.370000] usbcore: registered new interface driver usbfs
[    7.370000] usbcore: registered new interface driver hub
[    7.380000] usbcore: registered new device driver usb
[    7.940000] ehci_hcd: USB 2.0 'Enhanced' Host Controller (EHCI) Driver
[    7.940000] ehci-platform ehci-platform: Generic Platform EHCI Controller
[    7.950000] ehci-platform ehci-platform: new USB bus registered, assigned bus
 number 1
[    7.990000] ehci-platform ehci-platform: irq 3, io mem 0x1b000000
[    8.010000] ehci-platform ehci-platform: USB 2.0 started, EHCI 1.00
[    8.010000] hub 1-0:1.0: USB hub found
[    8.010000] hub 1-0:1.0: 1 port detected
[    8.030000] ohci_hcd: USB 1.1 'Open' Host Controller (OHCI) Driver
[    8.090000] Initializing USB Mass Storage driver...
[    8.100000] usbcore: registered new interface driver usb-storage
[    8.100000] USB Mass Storage support registered.
[    8.340000] usb 1-1: new full-speed USB device number 2 using ehci-platform
[    8.500000] scsi0 : usb-storage 1-1:1.4
[    9.500000] scsi 0:0:0:0: Direct-Access     Novatel  MMC Storage      2.31 PQ
: 0 ANSI: 2
[    9.520000] sd 0:0:0:0: [sda] 3862528 512-byte logical blocks: (1.97 GB/1.84
GiB)
[    9.530000] sd 0:0:0:0: [sda] Write Protect is off
[    9.540000] sd 0:0:0:0: [sda] Mode Sense: 0b 00 00 08
[    9.540000] sd 0:0:0:0: [sda] No Caching mode page present
[    9.540000] sd 0:0:0:0: [sda] Assuming drive cache: write through
[    9.570000] sd 0:0:0:0: [sda] No Caching mode page present
[    9.570000] sd 0:0:0:0: [sda] Assuming drive cache: write through
[    9.600000]  sda: sda1
[    9.620000] sd 0:0:0:0: [sda] No Caching mode page present
[    9.620000] sd 0:0:0:0: [sda] Assuming drive cache: write through
[    9.630000] sd 0:0:0:0: [sda] Attached SCSI removable disk
[   28.820000] EXT4-fs (sda1): warning: mounting unchecked fs, running e2fsck is
 recommended
[   28.880000] EXT4-fs (sda1): mounted filesystem without journal. Opts: (null)
[   29.150000] eth0: link down
[   29.680000] Compat-drivers backport release: compat-drivers-2012-09-04-2-gdda
c993
[   29.690000] Backport based on wireless-testing.git master-2012-09-07
[   29.690000] compat.git: wireless-testing.git
[   29.770000] cfg80211: Calling CRDA to update world regulatory domain
[   29.770000] cfg80211: World regulatory domain updated:
[   29.780000] cfg80211:   (start_freq - end_freq @ bandwidth), (max_antenna_gai
n, max_eirp)
[   29.790000] cfg80211:   (2402000 KHz - 2472000 KHz @ 40000 KHz), (300 mBi, 20
00 mBm)
[   29.790000] cfg80211:   (2457000 KHz - 2482000 KHz @ 20000 KHz), (300 mBi, 20
00 mBm)
[   29.800000] cfg80211:   (2474000 KHz - 2494000 KHz @ 20000 KHz), (300 mBi, 20
00 mBm)
[   29.810000] cfg80211:   (5170000 KHz - 5250000 KHz @ 40000 KHz), (300 mBi, 20
00 mBm)
[   29.820000] cfg80211:   (5735000 KHz - 5835000 KHz @ 40000 KHz), (300 mBi, 20
00 mBm)
[   30.630000] ath: EEPROM regdomain: 0x0
[   30.630000] ath: EEPROM indicates default country code should be used
[   30.630000] ath: doing EEPROM country->regdmn map search
[   30.630000] ath: country maps to regdmn code: 0x3a
[   30.630000] ath: Country alpha2 being used: US
[   30.630000] ath: Regpair used: 0x3a
[   30.630000] ieee80211 phy0: Selected rate control algorithm 'minstrel_ht'
[   30.630000] Registered led device: ath9k-phy0
[   30.630000] ieee80211 phy0: Atheros AR9330 Rev:1 mem=0xb8100000, irq=2
[   30.640000] cfg80211: Calling CRDA for country: US
[   30.650000] cfg80211: Regulatory domain changed to country: US
[   30.650000] cfg80211:   (start_freq - end_freq @ bandwidth), (max_antenna_gai
n, max_eirp)
[   30.660000] cfg80211:   (2402000 KHz - 2472000 KHz @ 40000 KHz), (300 mBi, 27
00 mBm)
[   30.670000] cfg80211:   (5170000 KHz - 5250000 KHz @ 40000 KHz), (300 mBi, 17
00 mBm)
[   30.680000] cfg80211:   (5250000 KHz - 5330000 KHz @ 40000 KHz), (300 mBi, 20
00 mBm)
[   30.680000] cfg80211:   (5490000 KHz - 5600000 KHz @ 40000 KHz), (300 mBi, 20
00 mBm)
[   30.690000] cfg80211:   (5650000 KHz - 5710000 KHz @ 40000 KHz), (300 mBi, 20
00 mBm)
[   30.700000] cfg80211:   (5735000 KHz - 5835000 KHz @ 40000 KHz), (300 mBi, 30
00 mBm)
[   31.330000] PPP generic driver version 2.4.2
[   31.570000] ip_tables: (C) 2000-2006 Netfilter Core Team
[   31.690000] NET: Registered protocol family 24
[   31.790000] nf_conntrack version 0.5.0 (455 buckets, 1820 max)
[   32.220000] usbcore: registered new interface driver cdc_acm
[   32.220000] cdc_acm: USB Abstract Control Model driver for USB modems and ISD
N adapters
[   32.290000] usbcore: registered new interface driver usbserial
[   32.300000] USB Serial support registered for generic
[   32.300000] usbcore: registered new interface driver usbserial_generic
[   32.310000] usbserial: USB Serial Driver core
[   32.510000] USB Serial support registered for GSM modem (1-port)
[   32.510000] option 1-1:1.0: GSM modem (1-port) converter detected
[   32.520000] usb 1-1: GSM modem (1-port) converter now attached to ttyUSB0
[   32.530000] option 1-1:1.1: GSM modem (1-port) converter detected
[   32.530000] usb 1-1: GSM modem (1-port) converter now attached to ttyUSB1
[   32.540000] option 1-1:1.2: GSM modem (1-port) converter detected
[   32.540000] usb 1-1: GSM modem (1-port) converter now attached to ttyUSB2
[   32.550000] option 1-1:1.3: GSM modem (1-port) converter detected
[   32.560000] usb 1-1: GSM modem (1-port) converter now attached to ttyUSB3
[   32.560000] usbcore: registered new interface driver option
[   32.570000] option: v0.7.2:USB Driver for GSM modems
[   35.530000] device eth0 entered promiscuous mode
[   36.210000] eth0: link up (100Mbps/Full duplex)
[   36.210000] br-lan: port 1(eth0) entered forwarding state
[   36.220000] br-lan: port 1(eth0) entered forwarding state
[   38.220000] br-lan: port 1(eth0) entered forwarding state
root@OpenWrt:/# df -h
Filesystem                Size      Used Available Use% Mounted on
rootfs                    1.8G     31.1M      1.7G   2% /
/dev/root                 1.5M      1.5M         0 100% /rom
tmpfs                    14.2M     72.0K     14.2M   0% /tmp
tmpfs                   512.0K         0    512.0K   0% /dev
/dev/sda1                 1.8G     31.1M      1.7G   2% /overlay
overlayfs:/overlay        1.8G     31.1M      1.7G   2% /
root@OpenWrt:/#

(Last edited by choogenboom on 22 Sep 2012, 16:39)

@choogenboom, thanks for sharing your experience. As I mentioned in the first post in the topic my ZTE Vodafone K3765-Z works OK and my configuration works just fine when using a separate USB flash device. Probably CDROM mode is the one that is doing the mess. As sdparm would take another precious kb in the image, how should we disable the CDROM mode with usb-modeswitch?

I will do some testing these days if I have some spare time...

In fact I tested another HSPA modem - Alcatel X220L HSPA modem  - it even does not "see" the SD card storage partitions (it only sees the block device /dev/sdaX) until you trigger an event related to it - for example a mount attempt (mount /dev/sda .....) or something else related to the block device, very strange .... probably it is again an issue related to the CDROM mode.

Anyways, is there an universal method to disable this?

(Last edited by dir2cas on 22 Sep 2012, 19:59)

my experience is that the sdparm package is smaller that usb-modeswitch, especially if you also install the usb-modeswitch-data package which contains 100's of files, only one of which you need for your specific modem.  So my current advice is use the sdparm method with the hotplug script, see link in my prior post on detailed howto.

For a "universal" way to disable CDROM mode you'll have to do some research.  I have seen some modems that have an AT command that does it, could be the industry has standarized on a AT command for doing it but I have not done the research to verify this. 

Also want to add that I have now tested the "Whole external root (pivot root)" method also with good results.

  _______                     ________        __
 |       |.-----.-----.-----.|  |  |  |.----.|  |_
 |   -   ||  _  |  -__|     ||  |  |  ||   _||   _|
 |_______||   __|_____|__|__||________||__|  |____|
          |__| W I R E L E S S   F R E E D O M
 -----------------------------------------------------
 ATTITUDE ADJUSTMENT (Bleeding Edge, r33482)
 -----------------------------------------------------
  * 1/4 oz Vodka      Pour all ingredients into mixing
  * 1/4 oz Gin        tin with ice, strain into glass.
  * 1/4 oz Amaretto
  * 1/4 oz Triple sec
  * 1/4 oz Peach schnapps
  * 1/4 oz Sour mix
  * 1 splash Cranberry juice
 -----------------------------------------------------
root@OpenWrt:~# df
Filesystem           1K-blocks      Used Available Use% Mounted on
rootfs                 1925448     39900   1789088   2% /
/dev/root                 1536      1536         0 100% /rom
tmpfs                    14580        76     14504   1% /tmp
tmpfs                      512         0       512   0% /dev
/dev/sda1              1925448     39900   1789088   2% /
root@OpenWrt:~#

(Last edited by choogenboom on 24 Sep 2012, 21:54)

The discussion might have continued from here.