What's new
  • SNBForums Code of Conduct

    SNBForums is a community for everyone, no matter what their level of experience.

    Please be tolerant and patient of others, especially newcomers. We are all here to share and learn!

    The rules are simple: Be patient, be nice, be helpful or be gone!

elrengo

Regular Contributor
Hi! I have two routers: RT-AC3100 + RT-AC66U_B1. The AC3100 as main router and the AC66 as AiMesh node. Both with Assuswrt Merlin firmware up to date.

In AC3100 router I've a My Passwort USB3 HDD attached where I've two paritions. Ther first one where is installed Entware and installed rtorret to be a Seedbox. The second partition is a SWAP.
I've a scripts:

Code:
elrengo@RT-AC3100:/jffs/scripts# pwd
/jffs/scripts
elrengo@RT-AC3100:/jffs/scripts# ls -l
-rwxr-xr-x    1 elrengo  root         25889 Feb  8 17:19 amtm
-rwxrwxrwx    1 elrengo  root           237 Feb  8 18:21 firewall-start
-rwxr-xr-x    1 elrengo  root           247 May  9 22:32 post-mount
-rwxr-xr-x    1 elrengo  root           224 Feb  8 17:25 post-mount.div
-rwxr-xr-x    1 elrengo  root            77 Feb  8 17:25 services-stop

The post-mount script:

Code:
elrengo@RT-AC3100:/jffs/scripts# cat post-mount
#!/bin/sh

. /jffs/scripts/post-mount.div # Added by amtm Entware installer
swapon /dev/sda1
mount \\\\192.168.1.30\\Seagate_Expansion_Drive /cifs2 -t cifs -o "username=elrengo"
mount \\\\192.168.1.30\\My_Book /cifs1 -t cifs -o "username=elrengo"

The swapon is working. When I check with "free" command I found the swap:

Code:
elrengo@RT-AC3100:/jffs/scripts# free
             total       used       free     shared    buffers     cached
Mem:        515184     241284     273900          0       1376      18616
-/+ buffers/cache:     221292     293892
Swap:      1048572          0    1048572
elrengo@RT-AC3100:/jffs/scripts#

But alway I need to mount mannualy both cifs shares. They are attached to a media center, WD HD TV Live, I use to copy movies download via torrent to the mediacenter using wired connection instead of wirelles with better bandwith and transference rate.

What its happen that not will be mounted in each reboot.
Thanks!

El Rengo
 
I think this is how its supposed to be;

mount \\\\192.168.1.30\\My_Book /cifs1 -t cifs -o "username=elrengo,password=YOURTARGET-PASSWORD"
 
I think this is how its supposed to be;

mount \\\\192.168.1.30\\My_Book /cifs1 -t cifs -o "username=elrengo,password=YOURTARGET-PASSWORD"

It's no required the password. In previes versios work fine. Because the user is the same and have the same password.
 
It's no required the password. In previes versios work fine. Because the user is the same and have the same password.
IF you paste the commands via terminal and it mounts then most likely is a timing issue
try adding :
sleep 20 to post-mount script before the commands.
also run this comand: dos2unix /jffs/scripts/post-mount
 
Thanks for your support. The command: "dos2unix /jffs/scripts/post-mount" must be put on the script or must be executed to no restart the router?
 
Thanks for your support. The command: "dos2unix /jffs/scripts/post-mount" must be put on the script or must be executed to no restart the router?

The dos2unix command (if it's present on the router) only changes the line terminator from Windows convention to Unix convention. The line terminator can cause odd problems with scripts.

It need only be run on the script file once to ensure it has the needed line terminators.
 
The dos2unix command (if it's present on the router) only changes the line terminator from Windows convention to Unix convention. The line terminator can cause odd problems with scripts.

It need only be run on the script file once to ensure it has the needed line terminators.
Ok. Thanks! But all my script was write with vi on router through putty or moba xterm
 
I think @faria is correct and this is a timing issue. post-mount is running before the device at 192.168.1.30 has connected to the network.

Did you try @faria's suggestion of using a sleep command?
 
No. To night I update the script and restart the device.
 
Sorry for my delay in my answer. I'm focused to having samba sharing and DLNA on my second router I forgot this issue.
I do know now why it's mounted three times

Code:
elrengo@RT-AC3100:/# mount
rootfs on / type rootfs (rw)
/dev/root on / type squashfs (ro,relatime)
devtmpfs on /dev type devtmpfs (rw,relatime,size=257448k,nr_inodes=64362,mode=755)
proc on /proc type proc (rw,relatime)
tmpfs on /tmp type tmpfs (rw,relatime)
sysfs on /sys type sysfs (rw,relatime)
devpts on /dev/pts type devpts (rw,relatime,mode=600)
/dev/mtdblock4 on /jffs type jffs2 (rw,noatime)
usbfs on /proc/bus/usb type usbfs (rw,relatime)
\134\134192.168.1.30\134Seagate_Expansion_Drive on /cifs2 type cifs (rw,relatime,unc=\\192.168.1.30\Seagate_Expansion_Drive,username=elrengo,uid=0,noforceuid,gid=0,noforcegid,addr=192.168.1.30,posixpaths,serverino,acl,rsize=16384,wsize=57344)
/dev/sda2 on /tmp/mnt/entwareNG type ext4 (rw,nodev,relatime,user_xattr,barrier=1,data=ordered)
\134\134192.168.1.30\134Seagate_Expansion_Drive on /cifs2 type cifs (rw,relatime,unc=\\192.168.1.30\Seagate_Expansion_Drive,username=elrengo,uid=0,noforceuid,gid=0,noforcegid,addr=192.168.1.30,posixpaths,serverino,acl,rsize=16384,wsize=57344)
/dev/sdc1 on /tmp/mnt/logs type ext3 (rw,nodev,relatime,errors=continue,user_xattr,barrier=0,data=ordered)
\134\134192.168.1.30\134Seagate_Expansion_Drive on /cifs2 type cifs (rw,relatime,unc=\\192.168.1.30\Seagate_Expansion_Drive,username=elrengo,uid=0,noforceuid,gid=0,noforcegid,addr=192.168.1.30,posixpaths,serverino,acl,rsize=16384,wsize=57344)
elrengo@RT-AC3100:/#

but I have the connection.
 
I do know now why it's mounted three times
Because you have no conditional logic in your post-mount script. So it's repeating your mount command every time a disk partition is mounted (/dev/sda2, /dev/sdc1, etc.).
 
Because you have no conditional logic in your post-mount script. So it's repeating your mount command every time a disk partition is mounted (/dev/sda2, /dev/sdc1, etc.).
Where will be best file to add it? How conditional I require to add?
 
I would put it in services-start so it only runs once.
It's not working :(

Code:
elrengo@RT-AC3100:/jffs/scripts# cd /cifs2/
elrengo@RT-AC3100:/cifs2# ls
elrengo@RT-AC3100:/cifs2# cd -
/jffs/scripts
elrengo@RT-AC3100:/jffs/scripts# ls -l
-rwxr-xr-x    1 elrengo  root         25889 Feb  8 17:19 amtm
-rwxrwxrwx    1 elrengo  root           237 Feb  8 18:21 firewall-start
-rwxr-xr-x    1 elrengo  root            93 May 19 14:18 post-mount
-rwxr-xr-x    1 elrengo  root           224 Feb  8 17:25 post-mount.div
-rwxr-xr-x    1 elrengo  root           154 May 19 14:16 services-start
-rwxr-xr-x    1 elrengo  root            77 Feb  8 17:25 services-stop
elrengo@RT-AC3100:/jffs/scripts# cat services-start
mount \\\\192.168.1.30\\My_Book /cifs1 -t cifs -o "username=elrengo"
mount \\\\192.168.1.30\\Seagate_Expansion_Drive /cifs2 -t cifs -o "username=elrengo"
elrengo@RT-AC3100:/jffs/scripts#
 

Similar threads

Latest threads

Sign Up For SNBForums Daily Digest

Get an update of what's new every day delivered to your mailbox. Sign up here!
Top