Posted: Wed Oct 11, 2023 13:07 Post subject: Mount HDD at the same location - Asus RT-N18U
Hello,
On my Asus RT-N18U running the latest DDWRT, i attached 3 HDDs. I noticed that (sometimes) the automount mounts the drives at different locations. This messes up my paths and i need to restart / redo settings.
How can I make sure that a drive is mounted always at the same location.
Here are the current mounts, but sometimes sdc1 and sdb1 are mounted one on the place of the other. I would like that the 150gb drive stays sdb1 and the 80 gb one always sdc1. sda1 is always ok.
root@Zenobiu:/jffs# [b]sh ddwrt-mount-usb-drives.sh[/b]
' '
: not found-usb-drives.sh: line 3:
' '{
: not found-usb-drives.sh: line 28: {
' '
: not found-usb-drives.sh: line 30:
+ OPT='-o rw,nodev,noatime'
' '
: not found-usb-drives.sh: line 33:
+ CLEAN_PARTITIONS=
' '
: not found-usb-drives.sh: line 36:
' '
: not found-usb-drives.sh: line 39:
' '
: not found-usb-drives.sh: line 43:
' mkdir -p '/tmp/mnt/sda1
' mkdir -p '/tmp/mnt/sdb1
' mkdir -p '/tmp/mnt/sdc1
' '
: not found-usb-drives.sh: line 48:
+ findfs 'UUID=9CE0DABC-0013-4F5A-86DF-DD664E725230'
ddwrt-mount-usb-drives.sh: line 50: findfs: not found
' mount -o rw,nodev,noatime '/tmp/mnt/sda1
in /etc/fstabind /tmp/mnt/sda1
+ findfs 'UUID=52801DF9-7536-43B1-AAB3-8FEEA0E4B36F'
ddwrt-mount-usb-drives.sh: line 51: findfs: not found
' mount -o rw,nodev,noatime '/tmp/mnt/sdb1
in /etc/fstabind /tmp/mnt/sdb1
+ findfs 'UUID=B1D54A7C-A88D-9683-130A-211AE9FC2E87'
ddwrt-mount-usb-drives.sh: line 52: findfs: not found
' mount -o rw,nodev,noatime '/tmp/mnt/sdb1
in /etc/fstabind /tmp/mnt/sdb1
' '
: not found-usb-drives.sh: line 53:
' '
: not found-usb-drives.sh: line 62:
' '
: not found-usb-drives.sh: line 65:
+ :
' '}
: not found-usb-drives.sh: line 67: }
' '
: not found-usb-drives.sh: line 69:
ddwrt-mount-usb-drives.sh: line 86: syntax error: unexpected word (expecting "do")
I also tried to run this:
Code:
root@Zenobiu:/jffs#mount $(findfs UUID=9CE0DABC-0013-4F5A-86DF-DD664E725230) -o rw,nodev,noatime /tmp/mnt/sda1
-sh: findfs: not found
mount: can't find /tmp/mnt/sda1 in /etc/fstab
Also, i did this, beforehand:
Quote:
1. enable jffs2 (administration->jffs2)
# 2. enable syslogd (services->services->system log)
# 3. set services->usb->usb support options as follows:
# core usb support = enable
# usb storage support = enable
# automatic drive mount = disable
Joined: 26 Mar 2013 Posts: 1886 Location: Hung Hom, Hong Kong
Posted: Thu Oct 12, 2023 9:38 Post subject:
forza.stiinta wrote:
I just want to make it so that the mount points are always the same. At reboot sdb1 and sdc1 are switched one with the other
I think I saw the same thing in my RT-N18U. Because right now I am ONLY using the USB 3.0 port, "sda" remained "sda".
I suspect the UUIDs of partitions would not change. Use UUIDs to set up your mount points, if and only if it's possible. Because / is read-only, you cannot change /etc/fstab easily. You might consider using remount with option bind.
I haven't gotten time to study about this ever-changing /dev/sdx behavior yet. _________________ Router: Asus RT-N18U (rev. A1)
Drink, Blink, Stretch! Live long and prosper! May the Force and farces be with you!
I suspect the UUIDs of partitions would not change. Use UUIDs to set up your mount points, if and only if it's possible. I don't have time for this behaviour as well.
The UUIDs are always the same, and it seems that the script provided above should do the job, but is does not work...
Joined: 26 Mar 2013 Posts: 1886 Location: Hung Hom, Hong Kong
Posted: Thu Oct 12, 2023 9:44 Post subject:
forza.stiinta wrote:
The UUIDs are always the same, and it seems that the script provided above should do the job, but is does not work...
I could be wrong: in general you could NOT use mount command the way you do with a normal Linux. DD-WRT's USB mounting seemed to be "fixed" during startup. But as I said, don't have time to probe further. SO I am using only one drive at the USB 3.0 port.
Edit:
Be reminded in the old days (802.11b era), most routers did NOT have USB ports. DD-WRT is very old in terms of history. There might be old design issues.
Edit 2:
USB support in very old Linux kernels might do the same. UUID mounting is relatively new. _________________ Router: Asus RT-N18U (rev. A1)
Drink, Blink, Stretch! Live long and prosper! May the Force and farces be with you!
In the Gui i can only mount at jffs and opt locations using the UUID. This could be a trick, however, i would like to have them separate at my locations.
Joined: 26 Mar 2013 Posts: 1886 Location: Hung Hom, Hong Kong
Posted: Thu Oct 12, 2023 14:10 Post subject:
forza.stiinta wrote:
Per Yngve Berg wrote:
Use the UID. You can enter them in the Gui.
In the Gui i can only mount at jffs and opt locations using the UUID. This could be a trick, however, i would like to have them separate at my locations.
Only the programmers of DD-WRT can clearly describe the mounting process... and whether it could be changed to suit modern needs.
A normal Linux can mount things freely, with or without UUID. _________________ Router: Asus RT-N18U (rev. A1)
Drink, Blink, Stretch! Live long and prosper! May the Force and farces be with you!