Mount HDD at the same location - Asus RT-N18U

Post new topic   Reply to topic    DD-WRT Forum Index -> Broadcom SoC based Hardware
Author Message
forza.stiinta
DD-WRT User


Joined: 30 Jun 2010
Posts: 62

PostPosted: Wed Oct 11, 2023 13:07    Post subject: Mount HDD at the same location - Asus RT-N18U Reply with quote
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.






Capture_sdc1.PNG
 Description:
 Filesize:  26.5 KB
 Viewed:  6951 Time(s)

Capture_sdc1.PNG



Capture_sdb1.PNG
 Description:
 Filesize:  41.84 KB
 Viewed:  6951 Time(s)

Capture_sdb1.PNG



Capture_sda1.PNG
 Description:
 Filesize:  38.52 KB
 Viewed:  6951 Time(s)

Capture_sda1.PNG


Sponsor
bushant
DD-WRT Guru


Joined: 18 Nov 2015
Posts: 2221

PostPosted: Wed Oct 11, 2023 15:57    Post subject: Reply with quote
Please tell us which "latest DDWRT" you are using.

https://download1.dd-wrt.com/dd-wrtv2/downloads/betas/2023/10-03-2023-r53562/


There is a script by @eibgrad that addresses this issue.

https://pastebin.com/VDZ32r2D

I have never used it, I just eliminated extra drives running on the router.

_________________
Forum Guide Lines (with helpful pointers about how to research your router, where and what firmware to download, where and how to post and many other helpful tips!)
How to get help the right way

Before asking for help - Read the forum guidelines AND Upgrade DD-WRT!
egc
DD-WRT Guru


Joined: 18 Mar 2014
Posts: 13879
Location: Netherlands

PostPosted: Wed Oct 11, 2023 16:09    Post subject: Reply with quote
+1

I had no time to look it up but that was what I was looking for Smile

_________________
Routers:Netgear R7000, R6400v1, R6400v2, EA6900 (XvortexCFE), E2000, E1200v1, WRT54GS v1.
Install guide R6400v2, R6700v3,XR300:https://forum.dd-wrt.com/phpBB2/viewtopic.php?t=316399
Install guide R7800/XR500: https://forum.dd-wrt.com/phpBB2/viewtopic.php?t=320614
Forum Guide Lines (important read):https://forum.dd-wrt.com/phpBB2/viewtopic.php?t=324087
forza.stiinta
DD-WRT User


Joined: 30 Jun 2010
Posts: 62

PostPosted: Thu Oct 12, 2023 8:47    Post subject: Reply with quote
I am running DD-WRT v3.0-r53562 std (10/03/23)

I tried the script but i get errors:

Code:
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
egc
DD-WRT Guru


Joined: 18 Mar 2014
Posts: 13879
Location: Netherlands

PostPosted: Thu Oct 12, 2023 8:53    Post subject: Reply with quote
You cannot enable jffs2 and use an USB drive with jffs!


DDWRT USB storage and NAS v3.pdf
 Description:

Download
 Filename:  DDWRT USB storage and NAS v3.pdf
 Filesize:  534.31 KB
 Downloaded:  1438 Time(s)


_________________
Routers:Netgear R7000, R6400v1, R6400v2, EA6900 (XvortexCFE), E2000, E1200v1, WRT54GS v1.
Install guide R6400v2, R6700v3,XR300:https://forum.dd-wrt.com/phpBB2/viewtopic.php?t=316399
Install guide R7800/XR500: https://forum.dd-wrt.com/phpBB2/viewtopic.php?t=320614
Forum Guide Lines (important read):https://forum.dd-wrt.com/phpBB2/viewtopic.php?t=324087
forza.stiinta
DD-WRT User


Joined: 30 Jun 2010
Posts: 62

PostPosted: Thu Oct 12, 2023 9:32    Post subject: Reply with quote
egc wrote:
You cannot enable jffs2 and use an USB drive with jffs!


I am not trying to use jffs2 and usb drive as jffs.

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
mwchang
DD-WRT Guru


Joined: 26 Mar 2013
Posts: 1886
Location: Hung Hom, Hong Kong

PostPosted: Thu Oct 12, 2023 9:38    Post subject: Reply with quote
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. Smile

_________________
Router: Asus RT-N18U (rev. A1)

Drink, Blink, Stretch! Live long and prosper! May the Force and farces be with you!

Facebook: https://www.facebook.com/changmanwai
Website: https://sites.google.com/site/changmw
SETI@Home profile: http://setiathome.berkeley.edu/view_profile.php?userid=211832
GitHub: https://github.com/changmw/changmw


Last edited by mwchang on Thu Oct 12, 2023 9:41; edited 1 time in total
forza.stiinta
DD-WRT User


Joined: 30 Jun 2010
Posts: 62

PostPosted: Thu Oct 12, 2023 9:41    Post subject: Reply with quote
mwchang wrote:
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...
Per Yngve Berg
DD-WRT Guru


Joined: 13 Aug 2013
Posts: 7199
Location: Romerike, Norway

PostPosted: Thu Oct 12, 2023 9:42    Post subject: Reply with quote
Use the UID. You can enter them in the Gui.
mwchang
DD-WRT Guru


Joined: 26 Mar 2013
Posts: 1886
Location: Hung Hom, Hong Kong

PostPosted: Thu Oct 12, 2023 9:44    Post subject: Reply with quote
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. Smile
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. Smile

_________________
Router: Asus RT-N18U (rev. A1)

Drink, Blink, Stretch! Live long and prosper! May the Force and farces be with you!

Facebook: https://www.facebook.com/changmanwai
Website: https://sites.google.com/site/changmw
SETI@Home profile: http://setiathome.berkeley.edu/view_profile.php?userid=211832
GitHub: https://github.com/changmw/changmw


Last edited by mwchang on Thu Oct 12, 2023 9:49; edited 4 times in total
forza.stiinta
DD-WRT User


Joined: 30 Jun 2010
Posts: 62

PostPosted: Thu Oct 12, 2023 9:45    Post subject: Reply with quote
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.
mwchang
DD-WRT Guru


Joined: 26 Mar 2013
Posts: 1886
Location: Hung Hom, Hong Kong

PostPosted: Thu Oct 12, 2023 14:10    Post subject: Reply with quote
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. Smile

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!

Facebook: https://www.facebook.com/changmanwai
Website: https://sites.google.com/site/changmw
SETI@Home profile: http://setiathome.berkeley.edu/view_profile.php?userid=211832
GitHub: https://github.com/changmw/changmw
egc
DD-WRT Guru


Joined: 18 Mar 2014
Posts: 13879
Location: Netherlands

PostPosted: Thu Oct 12, 2023 14:15    Post subject: Reply with quote
forza.stiinta wrote:
egc wrote:
You cannot enable jffs2 and use an USB drive with jffs!


I am not trying to use jffs2 and usb drive as jffs.

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


In an earlier post you wrote that you enabled JFFS2 on administration tab.

I know about the switching mount points that is what the script from @eibgrad is supposed to deal with.
But it cannot work if you have JFFS2 enabled.

_________________
Routers:Netgear R7000, R6400v1, R6400v2, EA6900 (XvortexCFE), E2000, E1200v1, WRT54GS v1.
Install guide R6400v2, R6700v3,XR300:https://forum.dd-wrt.com/phpBB2/viewtopic.php?t=316399
Install guide R7800/XR500: https://forum.dd-wrt.com/phpBB2/viewtopic.php?t=320614
Forum Guide Lines (important read):https://forum.dd-wrt.com/phpBB2/viewtopic.php?t=324087
forza.stiinta
DD-WRT User


Joined: 30 Jun 2010
Posts: 62

PostPosted: Thu Oct 12, 2023 14:28    Post subject: Reply with quote
egc wrote:

In an earlier post you wrote that you enabled JFFS2 on administration tab.

I know about the switching mount points that is what the script from @eibgrad is supposed to deal with.
But it cannot work if you have JFFS2 enabled.


So, i should disable the jffs2, and mount one of the drives to jffs? or just try without it?

Will try and let you know.
Sp1derman
DD-WRT User


Joined: 16 Jun 2006
Posts: 238
Location: Germany, BW

PostPosted: Wed Oct 25, 2023 21:50    Post subject: Reply with quote
maybe this works for you
https://forum.dd-wrt.com/phpBB2/viewtopic.php?t=335297
Display posts from previous:    Page 1 of 1
Post new topic   Reply to topic    DD-WRT Forum Index -> Broadcom SoC based Hardware All times are GMT

Navigation

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum