Install USB drives with splitter

Hi there,
I have (had) a working conf with a Linksys WRT32X OpenWrt 19.07.8 and one WD element USB3 storage attached through a HaetFire USB 3.0 Hub Splitter 4 Port. I use NFS and It was working until then.
I tried to install a second WD element USB3 storage but I have some troubles.

1 - Is it possible to use it as I try? 2 drives in a USB3 hub connected on the Router USB3.
2 - So far I have the pkg kmod-usb-ehci installed. In the how-to there is kmod-usb-storage-uas. What is the best kmod to use.
3 - I notice that reboot doesn't validate the USB drive setup I have to switch power off then on. Is it usual?
Thanks

There probably isn't enough DC power available from the router port to spin two drives. Multiple mechanical drives are going to require a powered hub or powered drives.

There's no software reason you can't have two drives. The mounts should be specified by UUID so the order of plugging in or starting up does not matter.

WD element storage has an external power supply. No problem here.
Any answer for 2 and 3?
I add
4 - What is the purpose of "service fstab boot" in this how-to at 9?

Thanks

ehci is for USB2.0 ports, so it isn't relevant here at all. The next layer is kmod-usb-storage for older drives or kmod-usb-storage-uas for newer drives that support UAS. UAS has higher performance.

There are reports that the reboot command does not cause a proper reboot of the WRT3200 / 32X so you have to cut the power anyway. Make sure the drives are unmounted before an intentional power cut. You could try poweroff to initiate a kernel shutdown-- the actual switch off has to be done externally by hardware though.

I think that should be service fstab restart. Anyway it should re-mount the drives, which is only likely to succeed if no directories or files are open on them.

Thank you for your valuable answers.
I think I had the issue when I power off/on the router, something didn't restart well.
So, I'll reset it up with the new kmod
I'll let you know
Thanks again

If you mean the drives did not mount, try increasing the bootdelay number (default is 5 seconds) in /etc/config/fstab. If the drives did mount but samba etc was unable to find them (because the service started before the filesystem mounted), configure those services to have a delayed startup.

More than that, I lost LAN connection and had to reset the box.

Should I keep both kmod if I want to use USB2 and USB3; kmod-usb-ehci and kmod-usb-storage-uas?
How to check the UAS and not ehci is used with the USB3 storage?

After many hours I still didn't succeed to share the second drive.
I really need help now
As I said I have 2 similar USB storages drives. HD6 is working well for 1 year.
In the following troubleshooting, I connected only the new HD7 but the HD6 config is still present
Router/Server side

~# uci show fstab
fstab.@global[0]=global
fstab.@global[0].anon_swap='0'
fstab.@global[0].anon_mount='0'
fstab.@global[0].auto_swap='1'
fstab.@global[0].auto_mount='1'
fstab.@global[0].delay_root='5'
fstab.@global[0].check_fs='0'
fstab.@mount[0]=mount
fstab.@mount[0].target='/mnt/hd6'
fstab.@mount[0].uuid='c6584879-c77b-42c6-9acf-a3996fb15442'
fstab.@mount[0].enabled='1'
fstab.@mount[1]=mount
fstab.@mount[1].enabled='1'
fstab.@mount[1].uuid='8864d950-f513-4eab-a6d2-ed7da6e5e757'
fstab.@mount[1].target='/mnt/hd7'

~# block info
/dev/mtdblock6: UUID="1431149825" VERSION="1" TYPE="ubi"
/dev/mtdblock8: UUID="469652220" VERSION="1" TYPE="ubi"
/dev/ubiblock0_0: UUID="b28d4e9e-5451dc49-133c1a49-dd884e53" VERSION="4.0" MOUNT="/rom" TYPE="squashfs"
/dev/ubi0_1: UUID="b0198136-9141-4bfd-8978-d684bff2944a" VERSION="w4r0" MOUNT="/overlay" TYPE="ubifs"
/dev/sda1: UUID="8864d950-f513-4eab-a6d2-ed7da6e5e757" LABEL="HD7" VERSION="1.0" MOUNT="/mnt/hd7" TYPE="ext4"

~# block detect
config 'global'
	option	anon_swap	'0'
	option	anon_mount	'0'
	option	auto_swap	'1'
	option	auto_mount	'1'
	option	delay_root	'5'
	option	check_fs	'0'

config 'mount'
	option	target	'/mnt/hd7'
	option	uuid	'8864d950-f513-4eab-a6d2-ed7da6e5e757'
	option	enabled	'0'

~# exportfs -v
/mnt/hd6      	192.168.1.0/255.255.255.0(async,wdelay,hide,no_subtree_check,fsid=0,sec=sys,rw,secure,root_squash,all_squash)
/mnt/hd7      	192.168.1.0/255.255.255.0(async,wdelay,hide,no_subtree_check,fsid=0,sec=sys,rw,secure,root_squash,all_squash)

~# showmount -e 192.168.1.1
Export list for 192.168.1.1:
/mnt/hd7 192.168.1.0/255.255.255.0
/mnt/hd6 192.168.1.0/255.255.255.0

~# ls /mnt/hd7
lost+found  test

Note that block info shows /mnt/hd7 "enabled 0". The same with hd6 and working (?)
I make a directory named test with ssh, I can "ls" it.
Server-side looks good
PC/Client-side
I started the PC (Opensuse leap 15.2) after the router
I use autofs

~> cat /etc/auto.misc
#
# This is an automounter map and it has the following format
# key [ -mount-options-separated-by-comma ] location
# Details may be found in the autofs(5) manpage

cd		-fstype=iso9660,ro,nosuid,nodev	:/dev/cdrom

# the following entries are samples to pique your imagination
#linux		-ro,soft,intr		ftp.example.org:/pub/linux
#boot		-fstype=ext2		:/dev/hda1
#floppy		-fstype=auto		:/dev/fd0
#floppy		-fstype=ext2		:/dev/fd0
#e2floppy	-fstype=ext2		:/dev/fd0
#jaz		-fstype=ext2		:/dev/sdc1
#removable	-fstype=ext2		:/dev/hdd
HD6		-fstype=nfs		192.168.1.1:/mnt/hd6
HD7		-fstype=nfs		192.168.1.1:/mnt/hd7

~> sudo showmount -e 192.168.1.1
Export list for 192.168.1.1:
/mnt/hd7 192.168.1.0/255.255.255.0
/mnt/hd6 192.168.1.0/255.255.255.0

~> ls /mnt
cd  HD6  HD7
~> ls /mnt/HD7
ls: cannot open directory '/mnt/HD7': No such file or directory

In /etc/fstab HD6 line is commented #
df doesn't show HD7
I can't understand. What do I miss?

Thanks for your help

Edit:
I did a router poweroff then connected both drives with USB hub, then restarted.
Now from the PC/client:

~> ls /mnt/HD6
lost+found  media
~> ls /mnt/HD7
lost+found  media

~> df
...
192.168.1.1:/mnt/hd6 11716304256 11534480000  64619392 100% /mnt/HD6

~> sudo systemctl restart autofs
~> df
...
192.168.1.1:/mnt/hd7 11716304256 11534480000  64619392 100% /mnt/HD7

First, HD7 is seen as HD6 :upside_down_face:
df see only HD6
after restarting autofs, df see only HD7
"ls" still see HD7 as HD6

I don't know what to do now. Any help is welcome.

Thanks

As far I understand, the mismatch when using a USB hub is due to the mount config.
When I mount HD6 and HD7 all subfolders and files are mixed. However, when I go inside a subfolder there is no mix.
The fix could be to export a subfolder.
I tried the following without succeed
Server side
HD6 has a subfolder hd6/media. HD6 is mounted in /mnt/hd6

~# block info
...
/dev/sda1: UUID="c6584879-c77b-42c6-9acf-a3996fb15442" LABEL="HD6" VERSION="1.0" MOUNT="/mnt/hd6" TYPE="ext4"

~# uci show fstab
fstab.@global[0]=global
fstab.@global[0].anon_swap='0'
fstab.@global[0].auto_swap='1'
fstab.@global[0].auto_mount='1'
fstab.@global[0].delay_root='5'
fstab.@global[0].check_fs='0'
fstab.@global[0].anon_mount='0'
fstab.@mount[0]=mount
fstab.@mount[0].target='/mnt/hd6'
fstab.@mount[0].uuid='c6584879-c77b-42c6-9acf-a3996fb15442'
fstab.@mount[0].enabled='1'

and export /mnt/hd6/media

showmount -e 192.168.1.1
Export list for 192.168.1.1:
/mnt/hd6/media 192.168.1.0/255.255.255.0
/mnt/hd5       192.168.1.0/255.255.255.0

Client side

~> sudo systemctl restart autofs
~> cat /etc/auto.misc
...
HD6/media		-fstype=nfs		192.168.1.1:/mnt/hd6/media

~> sudo showmount -e MainRouter
Export list for MainRouter:
/mnt/hd6/media 192.168.1.0/255.255.255.0
/mnt/hd5       192.168.1.0/255.255.255.0

In client, df doesn't show the mount point. No mount point in /mnt/

Question to sum up; Is it possible to export a subfolder of a mount point?
Where is my mistake?

I got it working thanks to some help on the Opensuse forum.
As mentioned in the exports man

NFS needs to be able to identify each filesystem that it exports. Normally it will use a UUID for the filesystem (if the filesystem has such a thing) or the device number of the device holding the filesystem (if the filesystem is stored on the device)

So I changed the file /etc/exports

~# cat /etc/exports
/mnt/hd6	192.168.1.0/255.255.255.0(fsid=c6584879c77b42c69acfa3996fb15442,rw,all_squash,async,no_subtree_check)
/mnt/hd7	192.168.1.0/255.255.255.0(fsid=d7d5bc171fa14d16966ba2240d4b114e,rw,all_squash,async,no_subtree_check)

Now it's working fine
Hope this will help other

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.