[Solved] How i automount multiple HDD as Tomato

With my WNR3500 and Tomato firmware when i connect multiple HDD / volumes with a USB HUB i have sda1, sda2 … sdb1, sdb2 … sdc1, sdc2 …

How i program a script for automount as with the tomato firmware ?

By automount I presume you mean you just want the devices to mount when attached, you can do this by editting /etc/config/fstab appropriately see things like [Solved] Auto mount USB storage

1 Like

no ..

With your exemple that is not automatic ( requiert to edit fstab )

I search a script for automount USB storage disks and partitions and share
as Windows mount disks E: F: G: … when i plug a disk

exist lsblk but after ?
/tmp# lsblk /dev/sd* -o KNAME,TYPE,SIZE,MODEL
KNAME TYPE SIZE MODEL
sda disk 14.9G USB Flash Drive
sda1 part 14.9G
sda1 part 14.9G
sdb disk 57.8G USB DISK 3.0
sdb1 part 32G
sdb1 part 32G
sdc disk 14.6G USB Flash Drive
sdc1 part 14.6G
sdc1 part 14.6G

I have this with my WNR3500 with Tomato firmware
When i plug a disks i have automatcly sda1 , sda2 , sdax … sdb1,sdb2,sdbx ... sdx1, sdx2, sdxx, …

When you plug in a drive, a /dev/sdX will be generated, and the partition table will be read to create /dev/sdX1, sdX2 etc. That is part of the kernel scsi and usb-storage drivers, which are not included in a base image so you need to install them.

This is not "mounting a drive". The /dev/sd devices are just a blob of raw sectors on the disk or flash device. To make sense of them in terms of directories and files, a filesystem driver needs to be loaded and the filesystem mounted into the file tree. This is usually done by associating the partition's UUID to a mounting point (and a filesystem type, if it can't be auto detected) in a configuration file.

In OpenWrt this file is /etc/config/fstab and the block-mount package enables and manages automatic mounting. In the wiki page below, scroll down to automount.

https://openwrt.org/docs/guide-user/storage/usb-drives

1 Like

sorry i cannot modify the tittle of the topic ( sure the disks are mounted ) but i search to share disks and partitions

After the external disk's filesystem is mounted (e.g. on /mnt/shared) then you need a file sharing package such as samba to make that part of the file tree available on the network.

Tomato is like a desktop distribution in that a lot of optional features are all built into one initial install. That is not how OpenWrt is set up. You have to install packages to gain more than basic routing functionality.

If you are connecting multiple drives as a permanent group of storage, you really need to reference them by UUID because the /dev/sd names will not be consistent depending on the order that the drives are plugged in and/or detected.

1 Like

Tomato give disks and partitions names with infos find in hdd structure

I install which package ?

luci-app-samba4
samba4-utils
samba4-admin

Tomato uses Kernel 2.6 so some things will be different from OpenWrt.

look next : solved

i have found :

i download git clone https://github.com/arduino/openwrt-yun.git

i find folder package/block-mount and i copy in openwrt source in package folder
menuconfig and make -j4

after flash the new firmware i have pnp fnctionnality when i plug a USB key

i find sda1, sda2,... sdb1, sdb2 … ( if exist)

Glad you got it wokring. I'm not sure why you had to compile an image - instead of installing the packages.

i install what packages ?

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