SOLVED: Simple USB Stick Installation Instructions for LEDE

Ok, added https://lede-project.org/docs/user-guide/usb-drives-quickstart

I'm assuming ext4 filesystem (it's fine also for USB drives), and that the USB drive does not need to be re-partitioned, just re-formatted (which is the case for most data drives and thumb drives).

I recently flashed a router to LEDE... the steps I used to get USB working are summarized here: http://usage-monitoring.com/help/?t=openwrt-usb

Did I miss anything? (It worked for me)

@bobafetthotmail This is exactly what I wanted. THANK YOU!

I tried the procedure, and had to install two other packages (kmod-usb3, kmod-usb-storage) before the procedure worked.

I took the liberty of making an editorial pass over the instructions, and adding those two packages. Please check that I've left a working procedure. Thanks again.

Did I miss anything? (It worked for me)

It's correct, just that on most devices the kmod-usb drivers are already installed.
And yeah, starting and enabling the fstab service is better than making a mount -a like I do.

I tried the procedure, and had to install two other packages (kmod-usb3, kmod-usb-storage) before the procedure worked.

Ok, thanks for testing.
kmod-usb3 (and kmod-usb2) should be installed by default in devices that have USB 3.0 ports or (usb 2.0). Can you tell me what device is that so I can send a PR to add that package in its default list?

I added the kmod-usb2 too for the sake of having this work also when there are devices with USB 2.0 that lack the driver.

If you want a new memory stick to get mounted automatically, just change also that anon_mount to 1

@bobafetthotmail Thanks for updating the Quick Start

This happened on a Netgear WNDR3800 running LEDE 17.01.2 Thanks again.

This happened on a Netgear WNDR3800 running LEDE 17.01.2 Thanks again.

Hmm, that device does not have a USB 3.0 port so it should not need kmod-usb3. Can you try removing kmod-usb3 and see if it still works?

My goal was a procedure that would work on all LEDE devices, so including packages to support USB 2.0 & USB 3.0 would be important.

Am I correct that opkg installing a package that's not required (or is already present) has no effect, except perhaps to consume a bit more Flash memory?

My goal was a procedure that would work on all LEDE devices, so including packages to support USB 2.0 & USB 3.0 would be important.

Which should be selected by default for each device, so I was asking because if you need that package for your device it has to be added to the default packages for that device.

For the quickstart guide it is OK to go quick and dirty like this, and I'm not going to change the quickstart regardless of the result of your test.

But for the other tutorial we assume that these packages for USB support are already there and the instructions to install them are under "troubleshooting" pages.

Especially we don't have any provisions for telling people to install kmod-usb3 (usb 3.0 driver) for a device with USB 2.0 port.

So could you please uninstall kmod-usb3 and see if it still works? Sorry to bore you on this, but I think it is important.

Am I correct that opkg installing a package that’s not required (or is already present) has no effect, except perhaps to consume a bit more Flash memory?

If it's not required it will waste space, if it's already present it won't. But in this case it won't break anything.

Sorry, not boredom - I just missed that initial request. I just uninstalled kmod-usb3, and the USB drive continues to work.

I should note that I suspect the problem was the lack of the other package - kmod-usb-storage. After I installed it, the USB drive worked.

Here's what I saw. After installing the initial set of packages from the procedure (opkg install block-mount e2fsprogs kmod-fs-ext4) I tried to do the next step (mkfs.ext4) but got an error:

root@LEDE-MediaRoom:~# mkfs.ext4 /dev/sda1
mke2fs 1.43.3 (04-Sep-2016)
The file /dev/sda1 does not exist and no size was specified.

To diagnose, I installed lsbutils and saw this:

root@LEDE-MediaRoom:~# lsusb -t
/:  Bus 02.Port 1: Dev 1, Class=root_hub, Driver=ohci-platform/2p, 12M
/:  Bus 01.Port 1: Dev 1, Class=root_hub, Driver=ehci-platform/2p, 480M
    |__ Port 1: Dev 2, If 0, Class=Mass Storage, Driver=, 480M

Note that the last line has "Driver=" I looked at the installed packages, and kmod-usb2 was there, but not kmod-usb-storage

root@LEDE-MediaRoom:~# opkg list-installed | grep usb
kmod-leds-wndr3700-usb - 4.4.71-1
kmod-usb-core - 4.4.71-1
kmod-usb-ledtrig-usbport - 4.4.71-1
kmod-usb-ohci - 4.4.71-1
kmod-usb2 - 4.4.71-1
libusb-1.0 - 1.0.21-1
usbutils - 007-6

I installed both kmod-usb-storage, and kmod-usb3 (because I read some other documentation that recommended it).

root@LEDE-MediaRoom:~# opkg install kmod-usb3 kmod-usb-storage
Installing kmod-usb3 (4.4.71-1) to root...
Downloading http://downloads.lede-project.org/releases/17.01.2/targets/ar71xx/generic/packages/kmod-usb3_4.4.71-1_mips_24kc.ipk
Installing kmod-usb-storage (4.4.71-1) to root...
Downloading http://downloads.lede-project.org/releases/17.01.2/targets/ar71xx/generic/packages/kmod-usb-storage_4.4.71-1_mips_24kc.ipk
Installing kmod-scsi-core (4.4.71-1) to root...
Downloading http://downloads.lede-project.org/releases/17.01.2/targets/ar71xx/generic/packages/kmod-scsi-core_4.4.71-1_mips_24kc.ipk
Configuring kmod-scsi-core.
Configuring kmod-usb-storage.
Configuring kmod-usb3.

Now the Mass Storage device has a proper driver ("Driver=usb-storage")

root@LEDE-MediaRoom:~# lsusb -t
/:  Bus 02.Port 1: Dev 1, Class=root_hub, Driver=ohci-platform/2p, 12M
/:  Bus 01.Port 1: Dev 1, Class=root_hub, Driver=ehci-platform/2p, 480M
    |__ Port 1: Dev 2, If 0, Class=Mass Storage, Driver=usb-storage, 480M
root@LEDE-MediaRoom:~# ls -l /dev

At that point, the remainder of the procedure (mkfs.ext4, etc.) worked as desired.

Update: Added error messages after initial mkfs.ext4 for complete history

1 Like

Ok, thanks for taking the time to do that. :smiley:

That's probably because you don't understand what step 3 does. What you're basically doing is copying the overlay partition (including old fstab) to your external storage and since you've not switched to that new overlay yet you're still effectively changing routers flash overlay contents when you edit fstab. So next time you boot you will again be using the old version of the overlay you copied earlier. So better switch step 3 - 4 and you'll be fine,

Please remove this, this is only used for file systems like vfat(fat32 etc) and such and you're only installing ext4 this would not make any sense.

Thank you @Timeless for the tip.

As for the kmod-nls packages... they are included in the default 17.01.x lede images (at least for my WRT1900ACS), and I thought my "you may also need" phrase was self explanatory. Sorry for that.

So I think it's better for someone to check if those kmod's are pre-installed and not to remove them (there is no need after all) or decide if he needs them.

Mmh they are not in all images I suppose. It would not make any sense. It's just a language pack for fat file systems. So without installing kmod-fs-vfat this would not make any sense to me.

The kernel driver mentions this:

The base Native Language Support. A number of filesystems depend on it (e.g. FAT, JOLIET, NT, BEOS filesystems), as well as the ability of some filesystems to use native languages (NCP, SMB).

I don't think "you probably need this" is self explanatory for some people. They would think ah of.. I need that and blindly executing those commands without thinking. Not that it is bad, but it will take unnecessary storage space :slight_smile:

1 Like

I'm pretty sure too that the nls packages are not in all images.

But since we're talking about extroot, I don't think some kilobytes are a big deal and I find it kind of ironic to worry about "unnecessary storage space".

I personally have installed packages that I don't need (and I may never need), like gcc, unzip, unrar, gdb, screen, netdiscover etc...

1 Like

You have a valid point. But still multiple "some kilobytes" can add up. And that was not the point I was trying to make. I just mentioned the given information about NLS packages was incomplete. And hopefully I made it more clear where they are good for so people can actually decide if they need them instead of just blindly installing stuff.

1 Like

Thank you for this, I just copy pasted all your commands and it worked fine for me.

I have been trying this for a while and couldn't get it to work properly until now.

If anyone wants to know my router is a TP-Link WDR4300 and using LEDE 17.01.4

Timeless gave us a useful tip, to switch 4 to 3, that means to first create fstab and then copy the overlay partition to the usb disk. And that makes sense.

Haven't tried it yet but I will the next time I want to setup my box.

A post was split to a new topic: Squid installation on extroot

This topic was automatically closed after 13 hours. New replies are no longer allowed.