OpenWrt Forum Archive

Topic: Cannot mount external usb disk

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

Dear all,

though I did the steps to get usb support for external storage, and I can see the /dev/sda and its three partitions sda1, sda2, sda3, I can't really mount them. When I use the CLI to mount sda1 (or any partition for that matter), it returns "No such device"

When I do:

root@Thuis:/# mount -t ext3 /dev/sda1 /mnt/casa-share/ -o rw,sync
mount: mounting /dev/sda1 on /mnt/casa-share/ failed: No such device

When I login through the LUCI webinterface, I go to System/Mount Points, and yes, the three partitions are shown. Yesterday it also showed me the number of MBs between brackets, now not anymore.

Strange enough I can go to the mount point /mnt/casa-share and store files on it, delete them etc.

lsusb gives no information.
df prints

Filesystem           1K-blocks      Used Available Use% Mounted on
df: /proc/mounts: No such file or directory

Then I decide to reboot the machine. Now there is no drive detected at all. Under /dev there is no such thing as sda. lsusb only show the machine's usb hub controller: Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub

Something must be wrong, but I don't know where. I did follow the instructions to get basic usb support and then the howto on obtaining usb storage.

I am running OpenWrt Backfire 10.03 on an Asus WL-500gPv1.

Any help would be appreciated.

best regards

dmesg output shows this:

ehci_hcd: USB 2.0 'Enhanced' Host Controller (EHCI) Driver
PCI: Enabling device 0000:00:03.2 (0000 -> 0002)
PCI: Fixing up device 0000:00:03.2
ehci_hcd 0000:00:03.2: EHCI Host Controller
ehci_hcd 0000:00:03.2: new USB bus registered, assigned bus number 1
ehci_hcd 0000:00:03.2: Enabling legacy PCI PM
ehci_hcd 0000:00:03.2: irq 6, io mem 0x40002000
ehci_hcd 0000:00:03.2: USB 2.0 started, EHCI 1.00
usb usb1: configuration #1 chosen from 1 choice
hub 1-0:1.0: USB hub found
hub 1-0:1.0: 4 ports detected

Have you looked at the OpenWrt Wiki and followed USB Storage ?

I first followed the usb essentials and then the usb storage howto.

and though i sometimes see the /dev/ files for the sd, it doesn't seem to be very predictable. I have no clue what could be wrong. When I plug the same usb disk into my regular pc i have no problem at all. Just to be sure I formatted it with ext3 (not ext4), as ext2 or 3 seem to be the recommendation.

Checking back to the wl500gP page I confirmed that indeed it says usb 2, and dmesg seems to confirm that. So EHCI would the appropriate controller, right?
Is there anything else I could check or have overlooked?

thanks for your help!

(Last edited by wte on 9 Sep 2011, 18:45)

I tried it also with another usb hard disk, which it recognises, when I do lsusb or dmesg, but it doesn't show up as mount point under /dev.

What could be wrong?

Thanks for any help you could provide!

wte wrote:

I tried it also with another usb hard disk, which it recognises, when I do lsusb or dmesg, but it doesn't show up as mount point under /dev.

What could be wrong?

Thanks for any help you could provide!

You haven't specified what firmware you use. So I'd check first with lsmod if all necessary kernel modules are installed and properly loaded for this particular file system (kmod-fs-ext3 or kmod-fs-ext4). And check with the 'fdisk -l' that the sda1 is a ext3 partition.

Ah, yes, I'm running the OpenWrt Backfire 10.03. lsmod gives me:

root@Thuis:/mnt# lsmod
Module                  Size  Used by    Not tainted
nf_nat_tftp              432  0 
nf_conntrack_tftp       2400  1 nf_nat_tftp
nf_nat_irc               864  0 
nf_conntrack_irc        2592  1 nf_nat_irc
nf_nat_ftp              1360  0 
nf_conntrack_ftp        4896  1 nf_nat_ftp
ipt_MASQUERADE           992  2 
iptable_nat             2880  1 
nf_nat                 12544  5 nf_nat_tftp,nf_nat_irc,nf_nat_ftp,ipt_MASQUERADE,iptable_nat
xt_NOTRACK               672  0 
iptable_raw              656  1 
xt_state                 800  3 
nf_conntrack_ipv4       8352  6 iptable_nat,nf_nat
nf_defrag_ipv4           608  1 nf_conntrack_ipv4
nf_conntrack           44000 12 nf_nat_tftp,nf_conntrack_tftp,nf_nat_irc,nf_conntrack_irc,nf_nat_ftp,nf_conntrack_ftp,ipt_MASQUERADE,iptable_nat,nf_nat,xt_NOTRACK,xt_state,nf_conntrack_ipv4
ehci_hcd               34080  0 
pppoe                  10208  0 
pppox                   1312  1 pppoe
ipt_REJECT              1984  2 
xt_TCPMSS               2720  2 
ipt_LOG                 4640  0 
xt_comment               464  0 
xt_multiport            1904  0 
xt_mac                   576  0 
xt_limit                1152  1 
iptable_mangle           992  0 
iptable_filter           768  1 
ip_tables               8800  4 iptable_nat,iptable_raw,iptable_mangle,iptable_filter
xt_tcpudp               1856  5 
x_tables                9824 13 ipt_MASQUERADE,iptable_nat,xt_NOTRACK,xt_state,ipt_REJECT,xt_TCPMSS,ipt_LOG,xt_comment,xt_multiport,xt_mac,xt_limit,ip_tables,xt_tcpudp
ppp_async               9040  0 
ppp_generic            21200  3 pppoe,pppox,ppp_async
slhc                    5360  1 ppp_generic
ext4                  228944  0 
jbd2                   49552  1 ext4
b43legacy              98784  0 
b43                   154752  0 
mac80211              212576  2 b43legacy,b43
usbcore               107120  2 ehci_hcd
nls_base                4960  1 usbcore
mbcache                 4160  1 ext4
crc16                    976  1 ext4
crc_ccitt                976  1 ppp_async
cfg80211              129216  3 b43legacy,b43,mac80211
compat_firmware_class     5936  2 b43legacy,b43
compat                   432  0 
arc4                     816  2 
aes_generic            31056  0 
deflate                 1328  0 
ecb                     1328  2 
cbc                     2016  0 
switch_robo             4048  0 
switch_core             5216  1 switch_robo
diag                    7504  0

Have you installed kmod-usb-storage?

well given that
- your external usb drive is self powered
- you have proper drivers installed for the usb subsystem (kmod-usb-{ohci,uhci}, kmod-usb2)
- you have installed kmod-usb-storage
- mount directory exists and accessible

the only thing I know you can try is to install kmod-fs-ext3. I know that ext4 driver should also support ext3 but it's worth a shot.

ps If this is a usb subsystem problem you may try to remove ohci/uhci leaving only kmod-usb2 in the system.

How large is the USB disk drive? If it is over 2TB then you have to use a GPT or GUID partition table which is not supported on a kernel level by openwrt. This has been a problem that I've been trying to fix for myself the past month infrequently.

See https://dev.openwrt.org/ticket/8672 for more information.

ok, thanks for your help, flux. Indeed, it is a self-powered usb disk (but I tried also another with ext. power, same issue). Following your advice, this is what I did: I removed ksmod-fs-ext4 and installed -ext3. I rebooted and still can't see any sd in /dev/.

Now I try the usb subsystem. I'm not sure why you say I should (or even could) remove uhci / ohci, as I'm using EHCI, as suggested in usb.essentials.  I understand OHCI and UHCI are for usb 1.0, while my WL-500gPv1 has usb 2.0.  Well, so I just tried it: removed EHCI, tried UHCI, "no device", so I removed that and installed OHCI. Now lsusb gives me a second hub:

Bus 002 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 001 Device 002: ID 059f:0641 LaCie, Ltd Mobile Hard Drive
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub

lsmod presents it uses OHCI

ehci_hcd               34080  1 ohci_hcd
...
usbcore               107120  3 ohci_hcd,ehci_hcd
nls_base                4960  1 usbcore
...

BTW Zullwick: no it is a few hundred GBs. Thanks anyways for bringing it up.

But still my disk is not showing up under the /dev files, so I can't really mount it. What can I do? I rebooted. My dmesg:

usbcore: registered new interface driver usbfs
usbcore: registered new interface driver hub
usbcore: registered new device driver usb
cfg80211: World regulatory domain updated:
    (start_freq - end_freq @ bandwidth), (max_antenna_gain, max_eirp)
    (2402000 KHz - 2472000 KHz @ 40000 KHz), (300 mBi, 2000 mBm)
    (2457000 KHz - 2482000 KHz @ 20000 KHz), (300 mBi, 2000 mBm)
    (2474000 KHz - 2494000 KHz @ 20000 KHz), (300 mBi, 2000 mBm)
    (5170000 KHz - 5250000 KHz @ 40000 KHz), (300 mBi, 2000 mBm)
    (5735000 KHz - 5835000 KHz @ 40000 KHz), (300 mBi, 2000 mBm)
b43-phy0: Broadcom 4318 WLAN found (core revision 9)
phy0: Selected rate control algorithm 'minstrel'
Registered led device: b43-phy0::tx
Registered led device: b43-phy0::rx
Registered led device: b43-phy0::assoc
Registered led device: b43-phy0::radio
Broadcom 43xx driver loaded [ Features: PL, Firmware-ID: FW13 ]
Broadcom 43xx-legacy driver loaded [ Features: PLID, Firmware-ID: FW10 ]
PPP generic driver version 2.4.2
ip_tables: (C) 2000-2006 Netfilter Core Team
NET: Registered protocol family 24
ehci_hcd: USB 2.0 'Enhanced' Host Controller (EHCI) Driver
PCI: Enabling device 0000:00:03.2 (0000 -> 0002)
PCI: Fixing up device 0000:00:03.2
ehci_hcd 0000:00:03.2: EHCI Host Controller
ehci_hcd 0000:00:03.2: new USB bus registered, assigned bus number 1
ehci_hcd 0000:00:03.2: Enabling legacy PCI PM
ehci_hcd 0000:00:03.2: irq 6, io mem 0x40002000
ehci_hcd 0000:00:03.2: USB 2.0 started, EHCI 1.00
usb usb1: configuration #1 chosen from 1 choice
hub 1-0:1.0: USB hub found
hub 1-0:1.0: 4 ports detected
nf_conntrack version 0.5.0 (463 buckets, 1852 max)
CONFIG_NF_CT_ACCT is deprecated and will be removed soon. Please use
nf_conntrack.acct=1 kernel parameter, acct=1 nf_conntrack module option or
sysctl net.netfilter.nf_conntrack_acct=1 to enable it.
usb 1-2: new high speed USB device using ehci_hcd and address 2
usb 1-2: configuration #1 chosen from 1 choice
ohci_hcd: USB 1.1 'Open' Host Controller (OHCI) Driver
ohci_hcd ssb0:2: SSB OHCI Controller
ohci_hcd ssb0:2: new USB bus registered, assigned bus number 2
ohci_hcd ssb0:2: irq 2, io mem 0x18003000
usb usb2: configuration #1 chosen from 1 choice
hub 2-0:1.0: USB hub found
hub 2-0:1.0: 2 ports detected

do you have any other suggestion?
thanks

wte wrote:

ok, thanks for your help, flux. Indeed, it is a self-powered usb disk (but I tried also another with ext. power, same issue). Following your advice, this is what I did: I removed ksmod-fs-ext4 and installed -ext3. I rebooted and still can't see any sd in /dev/.

Now I try the usb subsystem. I'm not sure why you say I should (or even could) remove uhci / ohci, as I'm using EHCI, as suggested in usb.essentials.  I understand OHCI and UHCI are for usb 1.0, while my WL-500gPv1 has usb 2.0.  Well, so I just tried it: removed EHCI, tried UHCI, "no device", so I removed that and installed OHCI. Now lsusb gives me a second hub:

1. I actually mean to install kmod-fs-ext3 additionally without removing kmod-fs-ext4. Because I've used kmod-fs-ext3 on different hardware and it is proven to work. On the other hand kmod-fs-ext4 is a new addition and I haven't tested it personally. But well it doesn't matter if you say it doesn't help.

2. No I mean you could try to remove kmod-usb-ohci or kmod-usb-uhci if you have it installed. Usually it doesn't hurt if you have kmod-usb-ohci/uhci installed together with the kmod-usb2. But some hardware only works if kmod-usb2 installed exclusively i.e no ohci/uhci.

You may try another file system. Take a fat32 usb stick for example and try to mount it. You will need kmod-fs-vfat and some nls packages (I intall kmod-nls-cp437, kmod-nls-iso8859-1, kmod-nls-utf8, kmod-nls-cp1251 but I think installing the first 2 shall be enough for the test).

But in general it shall work with you initial configuration as I see it now
ps Post fdisk -l output

have you an external hub? Try without it

Thanks, flux.

No, I'm not using an external usb hub; the lsusb shows the internal ones.

ad 1) ok, added kmod-fs-ext4 again (but no change).
ad 2) ok, I removed OHCI, but still the EHCI module is in there.
ad 3) tomorrow I will format a stick with fat32, to see how that goes.
ad 4) installed fdisk; fdisk - gives no output at all. What is that?

thanks

you need to install kmod-usb-storage and make sure it is loaded. It won't work without it.

thanks, man. I just missed kmod-usb-storage. That feels stupid. Now it seems to work.

now fdisk -l prints:

Disk /dev/sda: 120.0 GB, 120034123776 bytes
255 heads, 63 sectors/track, 14593 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0xfc316226

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1               1       14403   115683328   83  Linux
/dev/sda2           14530       14594      512000   82  Linux swap / Solaris
/dev/sda3           14403       14530     1024000   83  Linux

Partition table entries are not in disk order

The discussion might have continued from here.