OpenWrt Forum Archive

Topic: Mount USB Stick With Kami706 in WL-500gP

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

I'm getting a "mount failed" message when i try to mount a fat formatted 128mb USB memory stick.

dmesg: 

Bus Device Product Manufacturer VendorID:ProdID USB version 
03 5 USB 2.0 SD/MMC READER  SDMMC M121  14cd:6700 2.00
scsi3 : SCSI emulation for USB Mass Storage devices
usb-storage: device found at 5
usb-storage: waiting for device to settle before scanning
scsi 3:0:0:0: Direct-Access     USB 2.0  SD/MMC Reader         PQ: 0 ANSI: 0 CCS
SCSI device sda: 244864 512-byte hdwr sectors (125 MB)
sda: Write Protect is off
sda: Mode Sense: 03 00 00 00
sda: assuming drive cache: write through
SCSI device sda: 244864 512-byte hdwr sectors (125 MB)
sda: Write Protect is off
sda: Mode Sense: 03 00 00 00
sda: assuming drive cache: write through
 sda: sda1
sd 3:0:0:0: Attached scsi removable disk sda
usb-storage: device scan complete
FAT: codepage cp437 not found
Installed Packages

Action Package Version Description 
Uninstall base-files-brcm47xx-2.6 8-7431  
Uninstall bridge 1.0.6-1  
Uninstall busybox 1.4.2-1  
Uninstall dnsmasq 2.38-1  
Uninstall dropbear 0.49-1  
Uninstall ez-ipupdate 3.0.11b8-2  
Uninstall fdisk 2.12r-1  
Uninstall haserl 0.8.0-1  
Uninstall hotplug2 0.9-1  
Uninstall iptables 1.3.5-1  
Uninstall kernel 2.6.19.2-brcm47xx-1  
Uninstall kmod-diag 1+2.6.19.2-brcm47xx-1  
Uninstall kmod-fs-vfat 2.6.19.2-brcm47xx-1  
Uninstall kmod-ipt-nathelper 2.6.19.2-brcm47xx-1  
Uninstall kmod-madwifi 2.6.19.2+0.9.2.1-brcm47xx-1  
Uninstall kmod-nls-base 2.6.19.2-brcm47xx-1  
Uninstall kmod-ppp 2.6.19.2-brcm47xx-1  
Uninstall kmod-pppoe 2.6.19.2-brcm47xx-1  
Uninstall kmod-scsi-core 2.6.19.2-brcm47xx-1  
Uninstall kmod-switch 2.6.19.2-brcm47xx-1  
Uninstall kmod-usb-core 2.6.19.2-brcm47xx-1  
Uninstall kmod-usb-storage 2.6.19.2-brcm47xx-1  
Uninstall kmod-usb-uhci 2.6.19.2-brcm47xx-1  
Uninstall kmod-usb2 2.6.19.2-brcm47xx-1  
Uninstall libgcc 4.1.2-8  
Uninstall mtd 5  
Uninstall ntpclient 2003_194-2  
Uninstall ppp 2.4.3-7  
Uninstall ppp-mod-pppoe 2.4.3-7  
Uninstall uclibc 0.9.28-8  
Uninstall udevtrigger 106-1  
Uninstall webif 0.3-3  
Uninstall wireless-tools 28-1

fdisk -l:

root@Kamikazi:~# fdisk -l

Disk /dev/sda: 125 MB, 125370368 bytes
4 heads, 32 sectors/track, 1913 cylinders
Units = cylinders of 128 * 512 = 65536 bytes

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1               1        1913      122382+   6  FAT16
root@Kamikazi:~#

mount:

root@Kamikazi:~# mount /dev/sda1 /mnt
mount: mounting /dev/sda1 on /mnt failed
root@Kamikazi:~# mount /dev/sda /mnt
mount: mounting /dev/sda on /mnt failed
root@Kamikazi:~#

Anyone know what's wrong? Thanks in advance.

Rob

(Last edited by robrob on 5 Jul 2007, 22:45)

Hrm... do you have /dev/scsi/[...]?
Then try this:

mount /dev/scsi/host0/bus0/target0/lun0/part1 /mnt

(Last edited by spelth on 5 Jul 2007, 13:08)

Same failure to mount:

root@Kamikazi:~# mount /dev/scsi/host0/bus0/target0/lun0/part1 /mnt
mount: mounting /dev/scsi/host0/bus0/target0/lun0/part1 on /mnt failed
root@Kamikazi:~#

Hi,
had the same problem.
Rebootet the router 3-4 times but still no chance.
Left the stick plugt in while I went sleeping. The next day it worked without a problem.
By the way, I have a WL-500g Delux, not a Premium, but maybe the problem has the same root.
with best regards
p90

Hi! smile

You must install at least these packages:

kmod-nls-base
kmod-nls-cp437

Additionally these might be needed according to the filenames' charset.

kmod-nls-cp850
kmod-nls-iso8859-1
kmod-nls-iso8859-15
kmod-nls-utf8

To enable automount, you will need do add some scripts which are already included on kamikaze development branch (trunk)

/sbin/usb-storage

#!/bin/sh
# Copyright (C) 2006 OpenWrt.org
logger "usb device is mass storage"
i=0                                
while [ $i -le 10 ]; do
        logger "waiting on usb drive $i ..."                         
        i=$(($i+1))
        cd /sys${DEVPATH}
        for blk in `find host* -type d`; do
                cd /sys/${DEVPATH}/${blk}
                BLK=$(find block* -type l 2> /dev/null)
                [ -n "${BLK}" ] && {
                        cd /sys${DEVPATH}/${blk}/${BLK}
                        ls /dev/ > /tmp/d
                        sleep 2
                        for node in `find sd* -type d | grep -v "/"`; do
                                echo "mounting /dev/${node} on /mnt/usbdrive"
                                mkdir -p /mnt/usbdrive
                                mount /dev/${node} /mnt/usbdrive
                                exit 0
                        done
                }
        done
        sleep 1
done

/etc/hotplug.d/usb/10-usb-storage

#!/bin/sh
# Copyright (C) 2006 OpenWrt.org
case "$ACTION" in
        add)
                [ -n "${INTERFACE}" ] &&
                [ "$(expr substr ${INTERFACE} 1 2)" == "8/" ]  && {
                        /sbin/usb-storage &
                }
                ;;
esac

Don't forget to make them executable (chmod +x) wink

You must edit /etc/hotplug2.rules
Edit the line:
SUBSYSTEM ~~ (net|button){
to:
SUBSYSTEM ~~ (net|button|usb){

I hope it works for you smile

(Last edited by raver on 6 Jul 2007, 12:39)

raver,

Thanks for the help. kmod-nls-base was already installed and I successfully added kmod-nls-cp437 but I get this error when trying to add the other packages you listed:

root@Kamikazi:~# ipkg install kmod-nls-cp850
Installing kmod-nls-cp850 (2.6.19.2-brcm-1) to root...
Downloading ftp://ftp.berlios.de/pub/xwrt/kamikaze/broadcom-2.6/packages//./kmod-nls-cp850_2.6.19.2-brcm-1_mipsel.ipk
wget: bad response to RETR: 550 pub/xwrt/kamikaze/broadcom-2.6/packages//./kmod-nls-cp850_2.6.19.2-brcm-1_mipsel.ipk: No such file or directory
Nothing to be done
An error ocurred, return value: 22.
Collected errors:
ipkg_download: ERROR: Command failed with return value 1: `wget --passive-ftp    -q -P /tmp/ipkg-jDu5HS ftp://ftp.berlios.de/pub/xwrt/kamikaze/broadcom-2.6/packages//./kmod-nls-cp850_2.6.19.2-brcm-1_mipsel.ipk'
Failed to download kmod-nls-cp850. Perhaps you need to run 'ipkg update'?
root@Kamikazi:~#

fdisk -l still gives the same info as in the previous post and the mount commands still fail.

Rob

(Last edited by robrob on 7 Jul 2007, 13:48)

robrob wrote:

...I get this error when trying to add the other packages you listed

Hi Rob smile

I think those additional packages are only needed if filenames have special characters. Essential packages are kmod-nls-base and kmod-nls-cp437.

Did you try "mount -t vfat /dev/sda1 /mnt" and checked loaded modules (lsmod)?

I hope it helps smile

Raver

Success!

raver,

Thanks for the help. As you mentioned, I needed to install kmod-nls-cp437--that's what was causing the mount command to fail. Following your direction, this mount command was successful:

root@Kamikazi:/mnt# mount -t vfat /dev/sda1 /mnt/usb
root@Kamikazi:/mnt#
root@Kamikazi:/mnt# mount
rootfs on / type rootfs (rw)
/dev/root on /rom type squashfs (ro)
none on /proc type proc (rw)
none on /sys type sysfs (rw)
none on /tmp type tmpfs (rw,nosuid,nodev)
tmpfs on /dev type tmpfs (rw)
none on /dev/pts type devpts (rw)
/dev/mtdblock3 on /jffs type jffs2 (rw)
/jffs on / type mini_fo (rw)
none on /proc/bus/usb type usbfs (rw)
/dev/sda1 on /mnt/usb type vfat (rw,fmask=0022,dmask=0022,codepage=cp437,iocharset=iso8859-1)

You're the man. Thanks again for the help. Now I'm off to set up the auto mount.

Rob

(Last edited by robrob on 8 Jul 2007, 12:24)

raver,

I owe you big time. I just got the automount script installed and running by following your excellent instructions.

A note to webif2 users: The "Status/USB" page shows the USB memory stick in the "Connected" section, but the "Mounted USB / SCSI devices" section is empty, but the drive is listed on the "Status/System/Mount Usage" page. When I ssh in and list the /mnt/usbdrive directory the contents of the memory stick are shown.

Thanks again raver,

Rob

(Last edited by robrob on 8 Jul 2007, 02:54)

Hello,

raver wrote:

Additionally these might be needed according to the filenames' charset.

kmod-nls-cp850
kmod-nls-iso8859-1
kmod-nls-iso8859-15
kmod-nls-utf8

I had the same problem and this also solved it. I just would like to underline that having the right charset is important. I couldn't mount my USB until I installed the kmod-nls-iso8859-1 package.

Regards,
Tex

(Last edited by Tex-Twil on 26 Mar 2008, 11:52)

The discussion might have continued from here.