OpenWrt Forum Archive

Topic: WRT54G v2 usb mod config, where do I find contents of my thumb drive

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

I have a WRT54G v2 router I flashed with openwrt 10.03.1 and I did the hardware mod for a USB port. However, I'm a rank beginner noob when it comes to the firmware/software side.  My thumb drive uses a FAT file system.  And installed various software packages:
kmod-fs-ext2     2.4.37.9-1
kmod-fs-ext3     2.4.37.9-1
kmod-fs-hfs     2.4.37.9-1
kmod-fs-msdos     2.4.37.9-1
kmod-fs-nfs     2.4.37.9-1
kmod-fs-nfs-common     2.4.37.9-1
kmod-fs-ntfs     2.4.37.9-1
kmod-fs-vfat    2.4.37.9-1
kmod-ipt-core     2.4.37.9-1
kmod-scsi-core     2.4.37.9-1
kmod-usb-core     2.4.37.9-1
kmod-usb-net     2.4.37.9-1
kmod-usb-ohci     2.4.37.9-1
kmod-usb-storage     2.4.37.9-1
kmod-usb-uhci     2.4.37.9-1
kmod-usb2     2.4.37.9-1

I imagine some of the above are not necessary, and hopefully don't interfere with each other...

I did a dmesg (via a SSH connection into the router)

root@OpenWrt:~# dmesg
CPU revision is: 00029007
Primary instruction cache 8kB, physically tagged, 2-way, linesize 16 bytes.
Primary data cache 4kB, 2-way, linesize 16 bytes.
Linux version 2.4.37.9 (jow@nd-build-02.linux-appliance.net) (gcc version 3.4.6 (OpenWrt-2.0
)) #12 Wed Dec 21 03:33:39 CET 2011
Determined physical RAM map:
memory: 01000000 @ 00000000 (usable)
On node 0 totalpages: 4096
zone(0): 4096 pages.
zone(1): 0 pages.
zone(2): 0 pages.
Kernel command line: root=/dev/mtdblock2 rootfstype=squashfs,jffs2 init=/etc/preinit noinitr
d console=ttyS0,115200
CPU: BCM4712 rev 1 at 200 MHz
Using 100.000 MHz high precision timer.
Calibrating delay loop... 197.83 BogoMIPS
Memory: 14232k/16384k available (1457k kernel code, 2152k reserved, 100k data, 84k init, 0k
highmem)
Dentry cache hash table entries: 2048 (order: 2, 16384 bytes)
Inode cache hash table entries: 1024 (order: 1, 8192 bytes)
Mount cache hash table entries: 512 (order: 0, 4096 bytes)
Buffer cache hash table entries: 1024 (order: 0, 4096 bytes)
Page-cache hash table entries: 4096 (order: 2, 16384 bytes)
Checking for 'wait' instruction...  unavailable.
POSIX conformance testing by UNIFIX
PCI: Initializing host
PCI: Fixing up bus 0
PCI: Fixing up bridge
PCI: Setting latency timer of device 01:00.0 to 64
PCI: Fixing up bus 1
Linux NET4.0 for Linux 2.4
Based upon Swansea University Computer Society NET3.039
Initializing RT netlink socket
Starting kswapd
Registering mini_fo version $Id$
devfs: v1.12c (20020818) Richard Gooch (rgooch@atnf.csiro.au)
devfs: boot_options: 0x1
JFFS2 version 2.1. (C) 2001 Red Hat, Inc., designed by Axis Communications AB.
squashfs: version 3.0 (2006/03/15) Phillip Lougher
pty: 256 Unix98 ptys configured
Serial driver version 5.05c (2001-07-08) with MANY_PORTS SHARE_IRQ SERIAL_PCI enabled
ttyS00 at 0xb8000300 (irq = 3) is a 16550A
ttyS01 at 0xb8000400 (irq = 3) is a 16550A
b44.c:v0.93 (Mar, 2004)
PCI: Setting latency timer of device 00:02.0 to 64
eth0: Broadcom 47xx 10/100BaseT Ethernet 00:12:17:ac:8e:95
Physically mapped flash: Found an alias at 0x400000 for the chip at 0x0
Physically mapped flash: Found an alias at 0x800000 for the chip at 0x0
Physically mapped flash: Found an alias at 0xc00000 for the chip at 0x0
Physically mapped flash: Found an alias at 0x1000000 for the chip at 0x0
Physically mapped flash: Found an alias at 0x1400000 for the chip at 0x0
Physically mapped flash: Found an alias at 0x1800000 for the chip at 0x0
Physically mapped flash: Found an alias at 0x1c00000 for the chip at 0x0
cfi_cmdset_0001: Erase suspend on write enabled
0: offset=0x0,size=0x2000,blocks=8
1: offset=0x10000,size=0x10000,blocks=63
Using word write method
Flash device: 0x400000 at 0x1c000000
bootloader size: 262144
Physically mapped flash: Filesystem type: squashfs, size=0x1a99ba
Creating 5 MTD partitions on "Physically mapped flash":
0x00000000-0x00040000 : "cfe"
0x00040000-0x003f0000 : "linux"
0x000bd400-0x00270000 : "rootfs"
mtd: partition "rootfs" doesn't start on an erase block boundary -- force read-only
0x003f0000-0x00400000 : "nvram"
0x00270000-0x003f0000 : "rootfs_data"
sflash: found no supported devices
Initializing Cryptographic API
IEEE 802.2 LLC for Linux 2.1 (c) 1996 Tim Alpaerts
NET4: Linux TCP/IP 1.0 for NET4.0
IP Protocols: ICMP, UDP, TCP, IGMP
IP: routing cache hash table of 512 buckets, 4Kbytes
TCP: Hash tables configured (established 1024 bind 2048)
Linux IP multicast router 0.06 plus PIM-SM
NET4: Unix domain sockets 1.0/SMP for Linux NET4.0.
NET4: Ethernet Bridge 008 for NET4.0
802.1Q VLAN Support v1.8 Ben Greear <greearb@candelatech.com>
All bugs added by David S. Miller <davem@redhat.com>
VFS: Mounted root (squashfs filesystem) readonly.
Mounted devfs on /dev
Freeing unused kernel memory: 84k freed
diag: Detected 'Linksys WRT54G/GS/GL'
b44: eth0: Link is up at 100 Mbps, full duplex.
b44: eth0: Flow control is off for TX and off for RX.
roboswitch: Probing device eth0: No Robo switch in managed mode found, phy_id = 0xffffffff
roboswitch: Probing device eth1: No such device
roboswitch: Probing device eth2: No such device
roboswitch: Probing device eth3: No such device
SCSI subsystem driver Revision: 1.00
usb.c: registered new driver usbdevfs
usb.c: registered new driver hub
Journalled Block Device driver loaded
PCI: Setting latency timer of device 00:04.0 to 64
usb-ohci.c: USB OHCI at membase 0xb8004000, IRQ 2
usb-ohci.c: usb-00:04.0, PCI device 14e4:4716
usb.c: new USB bus registered, assigned bus number 1
hub.c: USB hub found
hub.c: 2 ports detected
uhci.c: USB Universal Host Controller Interface driver v1.1
Initializing USB Mass Storage driver...
usb.c: registered new driver usb-storage
USB Mass Storage support registered.
hub.c: new USB device 00:04.0-1, assigned address 2
scsi0 : SCSI emulation for USB Mass Storage devices
  Vendor:           Model: USB Flash Memory  Rev: 5.00
  Type:   Direct-Access                      ANSI SCSI revision: 02
Attached scsi removable disk sda at scsi0, channel 0, id 0, lun 0
SCSI device sda: 4028416 512-byte hdwr sectors (2063 MB)
sda: Write Protect is off
Partition check:
/dev/scsi/host0/bus0/target0/lun0: p1
WARNING: USB Mass Storage data integrity not assured
USB Mass Storage device found at 2
mini_fo: using base directory: /
mini_fo: using storage directory: /overlay
mtdblock: erase of region [0x0, 0x10000] on "nvram" failed
jffs2.bbc: SIZE compression mode activated.
b44: eth0: Link is up at 100 Mbps, full duplex.
b44: eth0: Flow control is off for TX and off for RX.
There is already a switch registered on the device 'eth0'
roboswitch: Probing device eth1: No such device
roboswitch: Probing device eth2: No such device
roboswitch: Probing device eth3: No such device
eth0.0: add 01:00:5e:00:00:01 mcast address to master interface
eth0.1: add 01:00:5e:00:00:01 mcast address to master interface
eth0.0: dev_set_promiscuity(master, 1)
device eth0 entered promiscuous mode
device eth0.0 entered promiscuous mode
br-lan: port 1(eth0.0) entering learning state
br-lan: port 1(eth0.0) entering forwarding state
br-lan: topology change detected, propagating
PCI: Setting latency timer of device 00:01.0 to 64
PCI/DMA
wl0: wlc_attach: chiprev 1 coreunit 0 corerev 7 cccap 0x4876a maccap 0x0 band 2.4G, phy_type
2 phy_rev 2 ana_rev 2
wl0: Broadcom BCM4320 802.11 Wireless Controller 4.150.10.5
NTFS driver v1.1.22 [Flags: R/O MODULE]
CSLIP: code copyright 1989 Regents of the University of California
PPP generic driver version 2.4.2
ip_tables: (C) 2000-2002 Netfilter core team
ip_conntrack version 2.1 (5953 buckets, 5953 max) - 352 bytes per conntrack
uhci.c: USB Universal Host Controller Interface driver v1.1
usb.c: USB disconnect on device 00:04.0-1 address 2
USB device disconnected from the SCSI subsystem
hub.c: new USB device 00:04.0-1, assigned address 3
  Vendor:           Model: USB Flash Memory  Rev: 5.00
  Type:   Direct-Access                      ANSI SCSI revision: 02
Attached scsi removable disk sda at scsi0, channel 0, id 0, lun 0
SCSI device sda: 4028416 512-byte hdwr sectors (2063 MB)
sda: Write Protect is off
/dev/scsi/host0/bus0/target0/lun0: p1
USB device connected to the SCSI subsystem
WARNING: USB Mass Storage data integrity not assured
USB Mass Storage device found at 3
usb.c: USB disconnect on device 00:04.0-1 address 3
USB device disconnected from the SCSI subsystem
hub.c: new USB device 00:04.0-1, assigned address 4
  Vendor:           Model: USB Flash Memory  Rev: 5.00
  Type:   Direct-Access                      ANSI SCSI revision: 02
Attached scsi removable disk sda at scsi0, channel 0, id 0, lun 0
SCSI device sda: 4028416 512-byte hdwr sectors (2063 MB)
sda: Write Protect is off
/dev/scsi/host0/bus0/target0/lun0: p1
USB device connected to the SCSI subsystem
WARNING: USB Mass Storage data integrity not assured
USB Mass Storage device found at 4
usb.c: USB disconnect on device 00:04.0-1 address 4
USB device disconnected from the SCSI subsystem
hub.c: new USB device 00:04.0-1, assigned address 5
scsi1 : SCSI emulation for USB Mass Storage devices
  Vendor: SanDisk   Model: Cruzer            Rev: 1100
  Type:   Direct-Access                      ANSI SCSI revision: 02
Attached scsi removable disk sda at scsi1, channel 0, id 0, lun 0
SCSI device sda: 7821312 512-byte hdwr sectors (4005 MB)
sda: Write Protect is off
/dev/scsi/host1/bus0/target0/lun0: p1
WARNING: USB Mass Storage data integrity not assured
USB Mass Storage device found at 5
root@OpenWrt:~#

So it looks like the system is seeing my thumb drive (I can see my plugging and unplugging various thumb drives above), but I haven't figured out where I can go (directory path) to look at the files on this thumb drive.  In the SSH session, I can't find the /dev/sda1 directory or where /home is located.  These are directories, yes?  And is vfat good for thumb drives that use a FAT system? 

Here's the "mount points-mount entry" info at the luci web page of the router

General settings
Device  /dev/sda1
mount point  /home
file system  vfat
run filesystem check  (yes)

What I'm hoping to be able to do is access say image files or html files from a browser on a computer on the same network this router is on.  Like
192.168.1.115:80/directorypath/example.html
and have it show up in the browser like a web page.

Thanks in advance, I did lots of searching, but didn't find the clues I need...

Well, what is the output of 'mount' in your ssh session?
If it isn't mounted yet, you can do 'mount /dev/sda1 /home -t vfat' via ssh.
/dev/sda1 is no directory, it is a file representing your first partition on the flash drive (as a binary container, without filesystem interpretation of the data).

Hi, This is what I get when I say "mount" in a SSH session:

root@OpenWrt:~# mount
rootfs on / type rootfs (rw)
/dev/root on /rom type squashfs (ro)
none on /dev type devfs (rw)
none on /proc type proc (rw)
tmpfs on /tmp type tmpfs (rw,nosuid,nodev)
devpts on /dev/pts type devpts (rw)
/dev/mtdblock/4 on /overlay type jffs2 (rw)
mini_fo:/overlay on / type mini_fo (rw)
none on /proc/bus/usb type usbfs (rw)
root@OpenWrt:~#

When I do

root@OpenWrt:~# mount /dev/sda1 /home -t vfat

I get

root@OpenWrt:~# mount
rootfs on / type rootfs (rw)
/dev/root on /rom type squashfs (ro)
none on /dev type devfs (rw)
none on /proc type proc (rw)
tmpfs on /tmp type tmpfs (rw,nosuid,nodev)
devpts on /dev/pts type devpts (rw)
/dev/mtdblock/4 on /overlay type jffs2 (rw)
mini_fo:/overlay on / type mini_fo (rw)
none on /proc/bus/usb type usbfs (rw)
root@OpenWrt:~#

Looks the same (unless I missed something).  Anyway, I'm clueless as to what any of this means...  sad  As I'm a software noob.  (I'm a hardware guy)

What command in SSH would I say to see a list of the files and directories on the thumb drive?  Assuming no configuration or such errors above

again TIA.

dmesg | tail

should give some details on what's going on here, after trying to mount the partition.

Basically, to access files in a files ystem (be it a partition or a binary file), you need to mount it to a certain directory, wherein the file structure (files and directories) will appear. So, usually, mount is invoked with the location of the file system file and the destination directory (mount point) - and optionally with files ystem type (although this is usually autoprobed). After that, you can move between directories with "cd" and list directory contents with "ls".

I did a

root@OpenWrt:~# dmesg | tail
PCI: Setting latency timer of device 00:01.0 to 64
PCI/DMA
wl0: wlc_attach: chiprev 1 coreunit 0 corerev 7 cccap 0x4876a maccap 0x0 band 2
.4G, phy_type 2 phy_rev 2 ana_rev 2
wl0: Broadcom BCM4320 802.11 Wireless Controller 4.150.10.5
NTFS driver v1.1.22 [Flags: R/O MODULE]
CSLIP: code copyright 1989 Regents of the University of California
PPP generic driver version 2.4.2
ip_tables: (C) 2000-2002 Netfilter core team
ip_conntrack version 2.1 (5953 buckets, 5953 max) - 352 bytes per conntrack
uhci.c: USB Universal Host Controller Interface driver v1.1
root@OpenWrt:~#

In the luci web pages of this OpenWRT router, in "system" and then "Mount Points" it says the device is  /dev/sda1 (which I can't find) and the mount point is at "/home" which I also cannot find.  Where should I find /home?

doing
root@OpenWrt:~# df
Filesystem           1K-blocks      Used Available Use% Mounted on
/dev/root                 1728      1728         0 100% /rom
tmpfs                     7156       104      7052   1% /tmp
/dev/mtdblock/4           1536      1296       240  84% /overlay
mini_fo:/overlay          1728      1728         0 100% /
root@OpenWrt:~#

I don't see /home 

Probably something fundamental I'm missing...

Maybe the lack of /home is the reason, I just checked on my router, it doesn't have a /home directory either. So, better use /mnt instead. I'm just wondering why there is no error message.
Over all, I would recommend to start over again with booting the router, plugging in the flash drive, connecting via ssh and run the following commands (and post all the shell logs):

dmesg | tail
ls /
ls /dev
mount /dev/sda1 /mnt -t vfat
dmesg | tail
lsmod

I did the above and got this:

root@OpenWrt:~# dmesg | tail
scsi0 : SCSI emulation for USB Mass Storage devices
  Vendor: SanDisk   Model: Cruzer            Rev: 1100
  Type:   Direct-Access                      ANSI SCSI revision: 02
Attached scsi removable disk sda at scsi0, channel 0, id 0, lun 0
SCSI device sda: 7821312 512-byte hdwr sectors (4005 MB)
sda: Write Protect is off
Partition check:
/dev/scsi/host0/bus0/target0/lun0: p1
WARNING: USB Mass Storage data integrity not assured
USB Mass Storage device found at 2
root@OpenWrt:~#
root@OpenWrt:~# ls /
bin      etc      mnt      proc     root     sys      usr      www
dev      lib      overlay  rom      sbin     tmp      var
root@OpenWrt:~#
root@OpenWrt:~# ls /dev
console   gpio      mtd       ppp       random    tts       zero
cua       kmem      mtdblock  ptmx      root      tty
discs     log       null      pts       scsi      urandom
full      mem       port      pty       shm       usb
root@OpenWrt:~#
root@OpenWrt:~# mount /dev/sda1 /mnt -t vfat
root@OpenWrt:~#
root@OpenWrt:~# dmesg | tail
scsi0 : SCSI emulation for USB Mass Storage devices
  Vendor: SanDisk   Model: Cruzer            Rev: 1100
  Type:   Direct-Access                      ANSI SCSI revision: 02
Attached scsi removable disk sda at scsi0, channel 0, id 0, lun 0
SCSI device sda: 7821312 512-byte hdwr sectors (4005 MB)
sda: Write Protect is off
Partition check:
/dev/scsi/host0/bus0/target0/lun0: p1
WARNING: USB Mass Storage data integrity not assured
USB Mass Storage device found at 2
root@OpenWrt:~#
root@OpenWrt:~# lsmod
Module                  Size  Used by    Tainted: P 
wlcompat                9600  0
ip_nat_tftp             1768  0
ip_conntrack_tftp       1628  1
ip_nat_irc              2296  0
ip_conntrack_irc        3028  1
ip_nat_ftp              2920  0
ip_conntrack_ftp        4172  1
ipt_MASQUERADE          1316  1
iptable_nat            20888  4 ip_nat_tftp ip_nat_irc ip_nat_ftp ipt_MASQUERAD
E
ipt_NOTRACK              616  0
iptable_raw             1164  1
ipt_state                424  3
ip_conntrack           23376  3 ip_nat_tftp ip_conntrack_tftp ip_nat_irc ip_con
ntrack_irc ip_nat_ftp ip_conntrack_ftp ipt_MASQUERADE iptable_nat ipt_NOTRACK i
pt_state
pppoe                   9368  0
pppox                   1196  1 pppoe
ipt_REJECT              3932  2
ipt_TCPMSS              2316  0
ipt_LOG                 3804  0
ipt_comment              284  0
ipt_multiport            748  0
ipt_mac                  556  0
ipt_limit                892  1
iptable_mangle          2156  1
iptable_filter          1676  1
ip_tables              16960 16 ipt_MASQUERADE iptable_nat ipt_NOTRACK iptable_
raw ipt_state ipt_REJECT ipt_TCPMSS ipt_LOG ipt_comment ipt_multiport ipt_mac i
pt_limit iptable_mangle iptable_filter
nfs                    88712  0
msdos                   6028  0
ppp_async               8044  0
ppp_generic            25772  0 pppoe pppox ppp_async
slhc                    6064  0 ppp_generic
vfat                   11340  0
fat                    34448  0 msdos vfat
ntfs                   59152  0
lockd                  61804  0 nfs
sunrpc                 76944  0 nfs lockd
hfs                    94640  0
wl                    666560  0
usb-storage            70144  0
usb-ohci               19252  0
sd_mod                 12500  0
ext2                   40720  0
ext3                   71436  0
jbd                    51152  0 ext3
usbcore                71296  1 usb-storage usb-ohci
scsi_mod               67152  2 usb-storage sd_mod
switch-adm              6292  0
switch-core             5104  0 switch-adm
diag                   57968  0
root@OpenWrt:~#

I also did a logread:

Jan 30 00:43:05 OpenWrt authpriv.info dropbear[875]: Child connection from 192.
168.1.104:54507
Jan 30 00:43:16 OpenWrt authpriv.notice dropbear[875]: Password auth succeeded
for 'root' from 192.168.1.104:54507
Jan 30 00:43:51 OpenWrt user.info kernel: hub.c: new USB device 00:04.0-1, assi
gned address 2
Jan 30 00:43:53 OpenWrt user.info kernel: scsi0 : SCSI emulation for USB Mass S
torage devices
Jan 30 00:43:53 OpenWrt user.warn kernel:   Vendor: SanDisk   Model: Cruzer   
        Rev: 1100
Jan 30 00:43:53 OpenWrt user.warn kernel:   Type:   Direct-Access             
        ANSI SCSI revision: 02
Jan 30 00:43:53 OpenWrt user.warn kernel: Attached scsi removable disk sda at s
csi0, channel 0, id 0, lun 0
Jan 30 00:43:53 OpenWrt user.warn kernel: SCSI device sda: 7821312 512-byte hdw
r sectors (4005 MB)
Jan 30 00:43:53 OpenWrt user.warn kernel: sda: Write Protect is off
Jan 30 00:43:53 OpenWrt user.info kernel: Partition check:
Jan 30 00:43:53 OpenWrt user.info kernel:  /dev/scsi/host0/bus0/target0/lun0: p
1
Jan 30 00:43:53 OpenWrt user.debug kernel: WARNING: USB Mass Storage data integ
rity not assured
Jan 30 00:43:53 OpenWrt user.debug kernel: USB Mass Storage device found at 2
root@OpenWrt:/mnt/usb#

I did an ls in this directory, but nothing there, below:
root@OpenWrt:/mnt/usb# ls
root@OpenWrt:/mnt/usb# ls -l

Seems the router knows that a thumb drive is present, but doesn't know what to do with it...

Then try

mount /dev/scsi/host0/bus0/target0/lun0:p1 /mnt/usb

You can also try auto-completion by using the Tab-key. Although I don't remember how much that worked on such ancient systems.

The discussion might have continued from here.