FOR TIPS, gUIDES & TUTORIALS

subscribe to our Youtube

GO TO YOUTUBE

14455 questions

17168 answers

28195 comments

0 members

We are migrating to our new platform at https://community.teltonika.lt. Moving forward, you can continue discussions on this new platform. This current platform will be temporarily maintained for reference purposes.
0 votes
304 views 5 comments
by anonymous

Hello,

for different reasons, I have to connect 2 different USB Storages ( 1 external HDD and 1 USB Stick) via a USB Hub to my RUTX14.

This works fine. Both are visible in the WebUI  and are accessible via SSH / putty  as /dev/sda1 and dev/sdb1 , mountet as / mnt/sda1  or /mnt/sdb1.

Unfortuantly, the assignment to  sda1 or sdb1  depends on the order the devices are connected. So one drive may appear as sda1 or sdb1.

This makes it difficult to access data via Samba or via a bash script.

Is the any way to fix the assignment?

Thanks for your support

2 Answers

0 votes
by anonymous

Hello,

As an alternative method, to define mount points, you could try the following:

First, get UUID of storage device by running the command:

  • block info

The example output is below:

/dev/mtdblock5: UUID="5385a573-46532cb1-817cdc87-d2c06207" VERSION="4.0" MOUNT="/rom" TYPE="squashfs"
/dev/mtdblock6: MOUNT="/overlay" TYPE="jffs2"
/dev/mtdblock7: MOUNT="/log" TYPE="jffs2"
/dev/mmcblk0p1: UUID="ba13efc4-0ee1-4cab-b672-135d0b1bcb5e" LABEL="RUTOS_overlay" VERSION="1.0" 

SDcard is mounted at /mnt/mmcblk0p1 and UUID is ba13efc4-0ee1-4cab-b672-135d0b1bcb5e.

Now modify /etc/config/fstab file, add:

config 'mount'
        option target '/path/where/mount/is/needed'
        option uuid '<uuid>'
        option enabled '1'

For example:

config 'mount'
        option target '/mnt/test'
        option uuid 'ba13efc4-0ee1-4cab-b672-135d0b1bcb5e'
        option enabled '1'

Save this config, create /mnt/test path within the device and reboot the device. Before reboot it was mounted in /mnt/mmcblk0p1:

root@Teltonika-RUT955:/mnt# df -hT | grep mmc
/dev/mmcblk0p1       ext2           14.2G     16.8M     13.5G   0% /mnt/mmcblk0p1

After reboot:

root@Teltonika-RUT955:~# df -hT | grep mmc
/dev/mmcblk0p1       ext2           14.2G     16.8M     13.5G   0% /mnt/test

Best regards,

Best answer
by anonymous
Good description.
by anonymous
Thanks!

sorry for my late reply due to Christmas.  

Extremly helpful !

Martin
0 votes
by anonymous
Hello,

Do you have something in /dev/disk ? /dev/disk/by-id ?

Regards,
by anonymous

Unfortunatly not, even the directory /dev/disk doesn't exist. 

This is the content of my fstab:


root@Teltonika-RUTX14:/dev# cat /etc/fstab

# <file system> <mount point> <type> <options> <dump> <pass>

/dev/mtdblock15 /log            jffs2   defaults 0 0

by anonymous
Can you try the following commands:

echo p | fdisk /dev/sda

echo p | fdisk /dev/sdb

and check if you can see something different ? If so you can build manual mount commands with a known order.
by anonymous
That's a good idea!

Thant you for your idea!

There a differences that i can use to remount devices in the correct order!

I will try  this during the next days. This will also improve my very basic bash scripting skills ;-)