You are here

need help with linux on viewing mounted drives

9 posts / 0 new
Last post
wa2ise
wa2ise's picture
need help with linux on viewing mounted drives

I realize that this is off topic from aredn, but as a software nitwit, people here would know (I figure DD-WRT is similar enough to OpenWRT and AREDN here)

I did the hardware mod to a WRT54G v2 to connect a SD card, and it looks like DDWRT sees it, when I do a df -h. And also when I do a mount.

Realize that I'm a rank beginner novice with linux, so this may be a really stupid question, but how do I actually look at (read/write) the files on this SD card? When I have it plugged into my PC (in which I have a program that allows it to read ext2/3 drives) I can see a couple of files I put there as a test. But I can't see anything when I do an ls at /mmc (If I mis-understand it, that's where I should see stuff on the SD card, that's where mount puts it: /dev/mmc/disc0/part1 953.1M 20.0K 904.6M 0% /mmc, yes?)
If not, where do I find the files on my SD card? Maybe I need more for the path? Doing an ls on /mmc yields nothing.

TIA


KE6UPI
df -h shows it mounted. Check

df -h shows it mounted. Check the permissions for the file.

ls -alh /mmc

Here is an example of my USB mounted on a raspberry pi

pi@ke6upi-pi-wan:~ $ ls -alh /mnt/
total 12K
drwxr-xr-x  3 root root 4.0K Jan 31 09:30 .
drwxr-xr-x 21 root root 4.0K Sep 22 08:30 ..
drwxrwxrwx  5 root root 4.0K Jan 31 10:30 usb0

root root shows 1st root is the owner and the 2nd root is the group.

d/rwx/rwx/rwx
directory/root/group/users
d=directory
r=read
w=write
x=execute

Check that you are root
whoami

To change owner

chown -R "file/Path" root
chgrp -R "file/Path" root

Also check that it is formatted ext2.

David

wa2ise
wa2ise's picture
I checked the permissions for
I checked the permissions for the file.

ls -alh /mmc

root@DD-WRT:/# ls -alh /mmc
drwxr-xr-x    3 root     root         1.0K Feb 17  2017 .
drwxr-xr-x   16 root     root          153 Nov  2  2009 ..
root@DD-WRT:/#

and

root@DD-WRT:/# whoami
root

I inserted the SD card in my PC and copied a big file onto it, and I can see the memory consumption when I then reinsert the card bback into the DDWRT:

root@DD-WRT:~# df
Filesystem           1K-blocks      Used Available Use% Mounted on
/dev/root                 3072      3072         0 100% /
/dev/mtdblock/4             64        64         0 100% /jffs
/dev/mmc/disc0/part1    975961     54466    871902   6% /mmc
root@DD-WRT:~#

root@DD-WRT:/# ls -alh
drwxr-xr-x   16 root     root          153 Nov  2  2009 .
drwxr-xr-x   16 root     root          153 Nov  2  2009 ..
drwxr-xr-x    2 root     root          507 Nov  2  2009 bin
drwxr-xr-x    1 root     root            0 Jan  1 00:00 dev
drwxr-xr-x    5 root     root          414 Nov  2  2009 etc
drwxr-xr-x    1 root     root            0 Jan  1 00:00 jffs
drwxr-xr-x    3 root     root          242 Nov  2  2009 lib
drwxr-xr-x    3 root     root         1.0K Feb 17  2017 mmc
drwxr-xr-x    2 root     root            3 Nov  2  2009 mnt
drwxr-xr-x    2 root     root            3 Nov  2  2009 opt
dr-xr-xr-x   30 root     root            0 Jan  1  2000 proc
drwxr-xr-x    2 root     root          991 Nov  2  2009 sbin
drwxr-xr-x    2 root     root            3 Nov  2  2009 sys
drwxrwxrwx    1 root     root            0 Jan  1  2000 tmp
drwxr-xr-x    7 root     root           76 Nov  2  2009 usr
lrwxrwxrwx    1 root     root            7 Nov  2  2009 var -> tmp/var
drwxr-xr-x    7 root     root          112 Nov  2  2009 www
root@DD-WRT:/#

I can't figure out why I can't see the files on the SD card... 


FWIW, and I did a dmesg:

root@DD-WRT:~# dmesg
CPU revision is: 00029007
Linux version 2.4.35 (eko@dd-wrt) (gcc version 3.4.4 (OpenWrt-2.0)) #3395 Mon N
ov 2 13:40:36 CET 2009
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 noinitrd con
sole=ttyS0,115200
CPU: BCM4712 rev 1 at 200 MHz
Using 100.000 MHz high precision timer.
Calibrating delay loop... 196.19 BogoMIPS
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
Initializing RT netlink socket
Starting kswapd
devfs: v1.12c (20020818) Richard Gooch (rgooch@atnf.csiro.au)
devfs: boot_options: 0x1
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 e
nabled
ttyS00 at 0xb8000300 (irq = 3) is a 16550A
ttyS01 at 0xb8000400 (irq = 3) is a 16550A
Software Watchdog Timer: 0.05, timer margin: 60 sec
PCI: Setting latency timer of device 00:02.0 to 64
Universal TUN/TAP device driver 1.5 (C)1999-2002 Maxim Krasnyansky
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=0x2ff709
Creating 5 MTD partitions on "Physically mapped flash":
0x00000000-0x00040000 : "cfe"
0x00040000-0x003f0000 : "linux"
0x000d8000-0x003e0000 : "rootfs"
mtd: partition "rootfs" doesn't start on an erase block boundary -- force read-
only
0x003f0000-0x00400000 : "nvram"
0x003e0000-0x003f0000 : "ddwrt"
Initializing Cryptographic API
IP Protocols: ICMP, UDP, TCP, IGMP
IP: routing cache hash table of 512 buckets, 4Kbytes
TCP: Hash tables configured (established 1024 bind 2048)
ip_conntrack version 2.1 (512 buckets, 4096 max) - 336 bytes per conntrack
ip_tables: (C) 2000-2002 Netfilter core team
ipt_random match loaded
netfilter PSD loaded - (c) astaro AG
ipt_osf: Startng OS fingerprint matching module.
ipt_IPV4OPTSSTRIP loaded
NET4: Unix domain sockets 1.0/SMP for Linux 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
PCI: Setting latency timer of device 00:01.0 to 64
eth1: Broadcom BCM4320 802.11 Wireless Controller 4.80.56.0
JFFS2 version 2.1. (C) 2001 Red Hat, Inc., designed by Axis Communications AB.
mmc: starting module with: SD_DI=0x20, SD_DO=0x8, SD_CLK=0x10, SD_CS=0x80
Size = 992000, hardsectsize = 512, sectors = 1984000
Partition check:
 mmca: p1
EXT2-fs warning: mounting unchecked fs, running e2fsck is recommended
vlan0: add 01:00:5e:00:00:01 mcast address to master interface
vlan0: del 01:00:5e:00:00:01 mcast address from vlan interface
vlan0: del 01:00:5e:00:00:01 mcast address from master interface
vlan0: add 01:00:5e:00:00:01 mcast address to master interface
vlan0: del 01:00:5e:00:00:01 mcast address from vlan interface
vlan0: del 01:00:5e:00:00:01 mcast address from master interface
vlan0: add 01:00:5e:00:00:01 mcast address to master interface
vlan0: dev_set_promiscuity(master, 1)
device eth0 entered promiscuous mode
device vlan0 entered promiscuous mode
device eth1 entered promiscuous mode
vlan1: add 01:00:5e:00:00:01 mcast address to master interface
vlan1: del 01:00:5e:00:00:01 mcast address from vlan interface
vlan1: del 01:00:5e:00:00:01 mcast address from master interface
vlan1: add 01:00:5e:00:00:01 mcast address to master interface
vlan1: del 01:00:5e:00:00:01 mcast address from vlan interface
vlan1: del 01:00:5e:00:00:01 mcast address from master interface
vlan1: add 01:00:5e:00:00:01 mcast address to master interface
vlan1: dev_set_promiscuity(master, 1)
device vlan1 entered promiscuous mode
root@DD-WRT:~#
 
KE6UPI
I haven't played with BustBox

I haven't played with BustBox in along time. I don't won't point you in the wrong direction. But your dmesg said:
EXT2-fs warning: mounting unchecked fs, running e2fsck is recommended
and
mtd: partition "rootfs" doesn't start on an erase block boundary -- force read-
only

I'm guessing, but I wouldn't use windows to make a ext2 file system. Try uBuntu live and gparted.

 

zl4dk
zl4dk's picture
Yes Linux and windows use
Yes Linux and windows use different file systems. This is likely the reason why you can't see the files you copied onto your card. If you want to copy files from your windows machine onto your WRT54g you will need some kind of utility program. I have used winSCP for the same task on my Raspberry Pi, I'm not sure if DD-WRT supports this.
AE6XE
AE6XE's picture
Try this ref:   https://wiki
wa2ise
wa2ise's picture
USB mod works, but...

I gave up on the SD card approach, and did the USB mod, and that works!  I can see the files on the USB stick, and with a USB SD card adapter, I can see those files too.  And from my home network and Firefox, I can visit a web page I have on that USB adapter, http://192.168.1.81/user/mnt/licenseprint.htm (of course this link won't work for anyone but me, but I show it as an example)
As DD-WRT doesn't seem to have an option for teh LAN IP address to be a DHCP client (other than a hack you have to enter as code), I assigned it an address inside the range my mesh node DHCP server would give out.)   However! If I try to link to this web site (with the DD-WRT router connected to my AREDN mesh node, and click that link under "advertised services" as seen under "mesh status" I get a browser error 400, Cross Site Action detected!.  (insert inappropriate curse words here)...   I tried to research a workaround for this error, but found nothing that helps.

My reason for attempting the use of a USB stick memory to house my web pages is that I don't use up flash in the router (delete something and the flash it used still remains tied up until you do a master reflash reset of the router), and to give me more memory room as well. 

Tried again to add a USB stick to the OpenWRT router I attempted at the beginning of this thread, but either I damaged a circuit board trace, or the circuits inside the chip associated to that trace (if I did, it didn't kill the entire chip, as the router still works as before), or I left out an important piece of software package or didn't enable something.  With it seems 10 or so such packages, and maybe I installed something that I don't need and it conflicts with the USB function, the end result is the same, no working USB.  As a SW newbie, it's harder for a hardware weenie like me to figure it out..:).   I have been looking at that ref above, but there's something I don't understand in it, or is assumed knowledge, that I miss. 

Found this suggestion:
go to telnet/ssh console and type nvram set no_crossdetect=1 nvram commit    
I did this, but still no good...
from http://svn.dd-wrt.com/ticket/1483

wa2ise
wa2ise's picture
I'd get "400 Bad Request
I'd get "400 Bad Request Cross Site Action detected!" errors when trying to load web pages on the DD-WRT router via the mesh status page of my AREDN mesh node. Using an OpenWRT router to store the web pages seems to avoid this problem.
K5DLQ
K5DLQ's picture
i understand what you are
i understand what you are trying to accomplish, but...
wouldn't a $35 Raspberry Pi based webserver be SOOO much simpler that turning a router into a webserver?

1) install Raspian to SD card
2) boot
3) apt-get install apache
4) copy files to docroot



My $.02....

Theme by Danetsoft and Danang Probo Sayekti inspired by Maksimer