mounting usb 3 partitions to run scripts and save data

Post new topic   Reply to topic    DD-WRT Forum Forum Index -> Broadcom SoC based Hardware
Author Message
LRCbns
DD-WRT Novice


Joined: 22 Jan 2017
Posts: 7

PostPosted: Fri Jun 07, 2019 11:03    Post subject: mounting usb 3 partitions to run scripts and save data Reply with quote
Archer C8 rev 1
build: v3.0-r39944 std
Now I used my linux debian pc to format a usb with a 1GB swap. 4 GB jffs, 4 GB opt and 5 GB data.
in the webpage it had a line for jffs with the uuid that I entered and repeated the same for opt. There was no other line for another partition which I called data even though I did see an example with a data partition possible. I did toggle the automount drive to on. when I first filled in the info ddwrt recognized it as correct and promptly ran its script setting up jffs and opt. but then a few moments later it unmounted and has not mounted again.
Looking around almost all info is related to k2.4 I am on k3.x and so somethings have changed a lot. How do I get jffs and opt to be mounted all the time so that I can run an install script and that it can be used. I intend to setup an adblock, but other how the script works there is very little help as far as getting the usb to work as they want it to work.
Could I be missing a step in making sure the usb is always mounted?
Or could there be a bug in this version and I need to use and older one?
Also is there a way to mount a data partition so more scripts can use that to store they're files?
Sponsor
LRCbns
DD-WRT Novice


Joined: 22 Jan 2017
Posts: 7

PostPosted: Fri Jun 07, 2019 13:09    Post subject: Reply with quote
Many thanks for your hard work. I am going to try it as soon as I can. The instructions that were given for setting things up ended in failure because somewhere alone the line one of the settings broke all my connections with my laptop. My viop provider phone was fine and my roku was fine. Could be an issue with the fact I am running debian.
I do agree with your assessment about scripts. I do not have the brains for doing my own scripts, but usually can figure out what is going on enough to do modifications. I have been using linux for almost 20 years now and I can tell you scripting has made linux from a geek to a point the everyday person can handle linux.
Again many thanks.
vroemm
DD-WRT Novice


Joined: 13 May 2019
Posts: 12

PostPosted: Mon Jun 17, 2019 16:22    Post subject: Reply with quote
eibgrad wrote:
The GUI's automount feature is limited, and makes certain assumptions

..
Quote:
But beyond that, it's of no help.


Nice.. Smile
I like dd-wrt since long. Thats why i could not belief the above was true. I kept running around, like a rat in a maze looking for food. I could not belief there was no solution.

Now i see you came to the same conclusion as me.
It is a big relief for me. There is no solution.

I do not know much about these things.
So i have a question about your script.

If i leave the BEGIN OPTIONS.. to END OPTIONS unchanged, would that be OK ?

I would not know what to do with this part..

Thanks you very much, although i still have to try it, hope it works for me Smile

vroemm
vroemm
DD-WRT Novice


Joined: 13 May 2019
Posts: 12

PostPosted: Mon Jun 17, 2019 16:38    Post subject: Reply with quote
I get a error:

root@DD-WRT:~# curl -kLs bit.ly/ddwrt-installer|tr -d '\r'|sh -s VDZ32r2D startup
warning: /jffs not mounted; using /tmp
info: script installed: /tmp/ddwrt-mount-usb-drives.startup

Can the ddwrt-mount-usb-drives.startup script be run from this /tmp/ folder ?

Using: DD-WRT v3.0-r37495M kongat (10/28/1Cool
vroemm
DD-WRT Novice


Joined: 13 May 2019
Posts: 12

PostPosted: Tue Jun 18, 2019 18:32    Post subject: Reply with quote
For some unknown reason "findfs" is missing on my version of dd-wrt.

The solution is in this thread:
https://forum.dd-wrt.com/phpBB2/viewtopic.php?t=317108&postdays=0&postorder=asc&start=30

Your script :
mount $(findfs UUID=<the UUID> ) $OPT /opt

Becomes:
mount $(blkid | grep <the UUID> | cut -d ':' -f 1) $OPT /opt

And now it works..

Thanks for your script.
vroemm
DD-WRT Novice


Joined: 13 May 2019
Posts: 12

PostPosted: Thu Jun 20, 2019 7:37    Post subject: Reply with quote
You could use the same check you used for modprobe.
And then put both findfs and blkid in the script.

if [ "$(which findfs)" ]; then
< the findfs way >
else
< the blkid way >
fi

Or would this not work ?

Vroemm.
vroemm
DD-WRT Novice


Joined: 13 May 2019
Posts: 12

PostPosted: Thu Jun 20, 2019 16:48    Post subject: Reply with quote
Hmm.
It would worry me a bit to give users the illusion they are using findfs.
Maybe this can lead to false assumptions somehow.

I wonder, how difficult is it to change the source code of dd-wrt ?
Make selection based on UUID or LABEL possible in dd-wrt and the problem is solved..

A few days ago i tried to find the place in the dd-wrt source code where the service->usb stuff is done.

Found the adv_usb.webusb file with the html code for the service->usb page.
Thats as far as i got.

But the thought keeps itching me a little bit Smile

Vroemm.
Display posts from previous:    Page 1 of 1
Post new topic   Reply to topic    DD-WRT Forum 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