I recently installed openwrt-ar71xx-generic-tl-wr842n-v2-squashfs-factory.bin to my TL-WR842ND V2 router. Little later I upgraded it with this: lede-17.01.4-ar71xx-generic-tl-wr842n-v2-squashfs-sysupgrade.bin.
I was able to configure the basics on the web GUI. Now I would like to attach and share a drive via USB.
I used this description: https://lede-project.org/docs/user-guide/usb-drives
Here is the result:
opkg update - successful
opkg install kmod-usb-storage - successful
opkg install usbutils - successful
lsusb -t
/: Bus 01.Port 1: Dev 1, Class=root_hub, Driver=ehci-platform/1p, 480M
|__ Port 1: Dev 3, If 0, Class=Mass Storage, Driver=usb-storage, 480M
ls -l /dev/sd*
root@LEDE:~# ls -l /dev/sd*
brw------- 1 root root 8, 0 Jan 1 21:43 /dev/sda
brw------- 1 root root 8, 1 Jan 1 21:43 /dev/sda1
opkg install block-mount - successful
So far it's good I think. But by the next step I have no result.
block info | grep "/dev/sd"
As far as I understand the drive wasn't mounted.
Accordingly there is not visible by Mount Points at the GUI but can be seen by SWAP.
I tried 2 USB drive and a 2,5" HDD. The only thing wich was changed is the Device (and therefore its size) by SWAP at the Web GUI
Can somebody help me out what could be the problem?
Please post code output and commands within code back ticks (or use the </> button)
.
/dev/sda is the USB drive, and /dev/sda1 is the 1st partition on the drive (in this specific case, your drive currently only has one partition, but if there were more, they'd be listed in ascending chronological order [i.e. sda2, sda3, etc.])
You're also going to want to install some additional kmods:
What's the output of block detect(before and after installing the above packages)?
If wishing to setup network shares for Windows devices, see Samba Configuration(can also be used for BSD/Linux), for BSD/Linux environment, see NFS Configuration
Thanks for the quick reply!
I left out the successfully installed ones from the logs. Unfortunately I went through your post line by line therefore I only have the output of block detect after the installations. If it is necessary I roll back the system to default. Besides that the USB device still not mounted. Correct me if I wrong (I'm not an expert) but I think the drive must be first mounted and only after can be shared via SMB.
You installed a few things you shouldn't have, as it appears you either mis-typed or didn't copy & paste as a single line, as you installed kmod, which you don't need, as well as zlib, which you also don't need (it's a dependency of kmod), and extfat didn't install since the k was missing from kmod
When you issued block detect, is there a USB drive plugged in? If so, I'm not sure why it's not being detected, however I would recommend backing up your config. flashing again, and starting anew as the output above doesn't make sense
Yes, USB drive was connected. I flashed again and I configured only the basic settings on the web GUI. (pppoe, wifi, root password) Could you please recommend a guide with which I could mount a drive?
I rolled back the default image twice to have the default system again. Can there be something wrong with my router? The factory firmware sometimes recognized the USB devices sometimes not but mostly not.
Maybe it is time to buy a newer router...
I tried with 2 device. One with exfat and one with NTFS. Earlier I tried ext3 as well.
Devices are working well on win10. I used a 3rd party partition manager.
I reformatted on of the device to exfat and started over from sysupgrade.
I tried to mount again but still without success.
root@LEDE:~# block info
/dev/mtdblock2: UUID="babd86bf-59725bf1-d9cfae42-be909ef9" VERSION="4.0" MOUNT="/rom" TYPE="squashfs"
/dev/mtdblock3: MOUNT="/overlay" TYPE="jffs2"
root@LEDE:~# mount /dev/sda1 /mnt
root@LEDE:~# block info
/dev/mtdblock2: UUID="babd86bf-59725bf1-d9cfae42-be909ef9" VERSION="4.0" MOUNT="/rom" TYPE="squashfs"
/dev/mtdblock3: MOUNT="/overlay" TYPE="jffs2"
root@LEDE:~# mount /dev/sda1 /mnt
mount: mounting /dev/sda1 on /mnt failed: Resource busy
root@LEDE:~#
root@LEDE:~# df -h
Filesystem Size Used Available Use% Mounted on
/dev/root 2.3M 2.3M 0 100% /rom
tmpfs 13.8M 728.0K 13.0M 5% /tmp
/dev/mtdblock3 4.4M 1.6M 2.7M 38% /overlay
overlayfs:/overlay 4.4M 1.6M 2.7M 38% /
tmpfs 512.0K 0 512.0K 0% /dev
/dev/sda1 7.5G 192.0K 7.5G 0% /mnt
root@LEDE:~# ls -l /dev/sd*
brw------- 1 root root 8, 0 Jan 1 1970 /dev/sda
brw------- 1 root root 8, 1 Jan 1 1970 /dev/sda1
root@LEDE:~# mount /dev/sda1 /mnt
mount: mounting /dev/sda1 on /mnt failed: Resource busy
This implies there's some other resource accessing, or trying to access, the device, however your device is mounted:
root@LEDE:~# df -h
Filesystem Size Used Available Use% Mounted on
/dev/sda1 7.5G 192.0K 7.5G 0% /mnt
.
Just a general off-topic FYI: I personally don't recommend exfat for a filesystem format due to it's licensing, among other things.
If the USB drive/HDD is only ever going to be attached to the router, utilize F2FS or ext3 for USB drive file systems (as you don't want journaling on a USB drive, which ext4 will) and ext4 for the HDD (although xfs is a good file system for multimedia).
If the drive is going to be physically used across other devices, ext4 or NTFS are fine (as is HFS+ for Apple products)
Although if utilizing on an Android device at some point, it must be exfat unless you're rooted or running Lineage OS/other 3rd party firmware
If you have multiple OS architectures you use which include BSD/Linux, and you also utilize Windows, Paragon's Linux File Systems for Windows is worth the $20, as it provides transparent r/w access to BSD/Linux file system.
Thanks for the great summary and the great support!
I reformatted the USB device to ext3 once again and this time it can be mounted successfully. It is visible by block info and as well by mount points at LUCI. Probably I did something wrong last time when I tried ext3.
Exfat still doesn't work (installed packages for file systems: kmod-fs-exfat,kmod-fs-ext4,kmod-fs-ntfs) but for me it doesn't matter I just would like to use an HDD shared with the router. (current dirve is only for testing)
I would have one more question. It is off topic and please just ignore it if it doesn't fit to this forum.
What kind of and how large HDD could I use for this task and with which solution should I attach to the router? I didn't buy them yet. I was thinking about a 1 or 2 TB western digital red HDD with a one bay docking station.
There should be no issue with that, and the only downside is since your router only has a USB2 port, it will be limited to a max transfer speed of ~50MB/s.
Ensure you create a decent sized swap partition on the HDD, as it will likely be required for large file transfers.