Need help adding an external USB hard drive

I'm planning on formatting the drive as ext4. I found these two guides with a conflicting command.

One says to
opkg update opkg install kmod-usb2 insmod ehci-hcd

Then

opkg install usbutils

The other says to
opkg update && opkg install block-mount kmod-fs-f2fs kmod-usb-storage mkf2fs f2fsck kmod-usb-ohci kmod-usb-uhci fdisk

I'm not sure which one is right.


https://lede-project.org/docs/user-guide/extroot_configuration

f2fs filesystem is intended to be used on flash devices; for a hard drive formatted as ext4, you do not need it at all.
You need packages block-mount, usbutils, kmod-usb-core, kmod-usb-storage, kmod-fs-ext4, e2fsprogs.

Thank you, that is what I thought but I wasn't sure.

I'm not sure if the device is mounted. Is it mounted under /dev/ubi0_1?

root@OpenWrt:~# block info
/dev/ubiblock0_0: UUID="22894b44-2f15b614-4c8b8510-265e24bd" VERSION="1024.0" TY PE="squashfs"
/dev/ubi0_1: UUID="3218724d-e407-49e9-8410-b6c526067dda" VERSION="w4r0" TYPE="ub ifs"

You most likely want exfat or ext4 on your external HDD depending on if you want cross platform compatibility or not.
Just edit /etc/config/fstab to allow anon mount and you'll be fine.

No, definitively it is not related at all with any /dev/ubi device; leave those alone, or you might en bricking your router. Execute logread -f, plug your device in, and see what messages appear. If all goes as expected, it should pop up as /dev/sda1.

The block info command will output a mount point if the drive is mounted. eg.

/dev/ubiblock0_0: UUID="a9b3df51-b0242996-6945f8f5-4e49fddb" VERSION="4.0" MOUNT="/rom" TYPE="squashfs"
/dev/ubi0_1: UUID="9e911c1e-04f9-497a-8ce7-c0e879f63006" VERSION="w4r0" MOUNT="/overlay" TYPE="ubifs"
/dev/sda1: UUID="6c0fdf50-5a7d-4a3e-bf99-467505480f4e" TYPE="crypto_LUKS"
/dev/mapper/external: UUID="40cd829e-9861-44e4-b6f6-f9bb40a8db40" LABEL="HELIAN-DRIVE" VERSION="1.0" MOUNT="/mnt/external" TYPE="ext4"

Generally, I follow the LEDE user documentation over instructions you find elsewhere on the web, including the OpenWrt documentation.

I've had success following these instructions to get an external USB drive setup (haven't needed extroot though): https://lede-project.org/docs/user-guide/drives &
https://lede-project.org/docs/user-guide/fstab_configuration

I will reinstall the necessary packages in a few days and try again. Right now I'm having a more pressing issue in my other thread, help installing packages.

I believe I've found the issue, my router only supports NTFS and FAT32 for windows. I don't want to use fat32 since my drive is bigger than 100gb.

I reformatted my drive at NTFS and will be reinstalling this package.
ntfs-3g
ntfsprogs_ntfs-3g

Do I need these other ones? Are there any packages I'm missing?
kmod-fs-ntfs
ntfs-3g-utils
ntfs-3g-low

Unless you plan to move that drive to a Windows machine, I would advise against using NTFS; with the packages I listed, your device should be able to use EXT4.

My router on stock firmware and according to the Linksys documentation can't use ext4.

By flashing lede would this allow my router to now use ex4?

I wasn't able to execute logread -f with the drive connected in ext4

I'm confused now... do you have one router? or do you have several of them? what operating system does each one run? where are you going to put that drive? ...?

You may wish to look at the OpenWrt guides for USB here: https://wiki.openwrt.org/start?do=search&id=usb
You need at least the USB Basics and USB Storage. You may also want Samba (and the Luci counterpart).

You have not stated exactly what hardware you are using. Be aware that at least some travel routers with USB do not work well with mechanical hard drives if the power supply is not on the larger side (ie 2..1A or better) Not sure if this is an issue with any 12V product.

Have you followed this guide? Step by Step?
https://wiki.openwrt.org/doc/howto/usb.storage

I personally would format the drive with ext4, because the performance will be better than with ntfs.

The file system support of the original firmware is irrelevant.

NTFS performance is notoriously slow especially when compared to EXT4. Do not expect transfer speeds of much more than 30MBPS, and I get typically less than 10MBPS on FAT32. I chose FAT32 as I am on Windows and wanted to have the flexibility to plug into any PC with out having to add EXT file support to Windows. The only downside is the 2 GB file size limitation.

While USB storage technically works, performance wise it's a poor second to a NAS. If you want a NAS, get a NAS.

Is that 30M b per second or 30M B per second?

Yes Bytes, not Bits. This is from a 64bit PC (Windows) with GB Ethernet to a USB 2.0 thumb drive. I have both a FAT32 and EXT3 devices with nearly identical results. The 30 value is what I recall reading from other OpenWrt posts, but probably could not find it. Same test to my Synology with 5400 RPM drives is at least 8 times faster.
http://www.totusoft.com/lanspeed1
Great tool. No install. Unzip and run.

ended up getting another usb drive to test it out and it turns out the first drive I was using was defective....

Please, pay attention!
ExFAT on a Linux machine includes a major danger!
If you do the mistake and tick the check disk option, or do a check disk with any other way (that I know), you can end-up with an unreadable and almost unrecoverable disk.
I had a bad experience with a friends 500GB SATA HDD formated ExFAT, I checked it during a boot-repair-disk live USB session. Result: all the data hided, testdisk did more damage (perhaps I used it wrong). The friend had a backup of most important data, but not all.
At that point I had most of my HDDs formated ExFAT, on my Xubuntu/Windows desktop. I spend important time, but I converted all to NTFS (because of the Windows dual-boot), converted taking backup with rsync and re-writing with rsync after formating! Not just change disk format, with data in disk!