GL-AXT 1800 syncthing setup issue

completely noob here pls point me to the right direction if I missed the obvious…

been trying to setup syncthing using both sdcard and external usb ssd. they are both working using the router buildin samba service.

installed the package from the plugins list. got 1.18 version of syncthing. it’s not working at out of the box. After some research. i edited the /etc/syncthing/config.xml changing 127.0.0.1 into 0.0.0.0.

when I do “service synching status”
always show up “enable but inactive”.

I changed some “root” into “synching” at /etc/in.it.d/syncthing ( don’t know why I have to change it to made it work, anotherwise the service does not start)
also /etc/config/syncthing some “0” into “1”
and also “root” into “synching”

Anyway ! I have finally got he web GUI working now …

but when I add the mounted path into the synching /tmp/mountd/disk?_part1/

it’s show “permission denied”

I even tried to chmod or chown the “mountd” folders but it’s said "operation not allowed , real only file system! "

can any openwrt expert can point me into the right direction to proper set up my synching ?!

I do believe the answer it’s in the /etc/in.it.d/ synching startup config . but I have limited knowledge openwrt. ;(

thx in advance if you can help me with this :wink:

Have the SD card and SSD drive been mounted as Read/Write? You can check on LuCI → System → Mount Points.

I do not work for and I do not have formal association with GL.iNet

thx for suggestion … but i have tried that :wink: the mount point it’s automatically done by itself and it’s working :wink:

so the buildin smb sharing working perfectly :wink:

but the synching dont have right to write on those /tmp/montd/ which i trying to solve .

Can you post the SSH output from:

df
ls -l /tmp/mountd

Personally, I always manually set up mount points myself, under /mnt via LuCI → System → Mount Points and with the option of rw.

root@TOP-AXT1800:~# df
Filesystem 1K-blocks Used Available Use% Mounted on
mtd:ubi_rootfs 44288 44288 0 100% /rom
tmpfs 201148 2736 198412 1% /tmp
/dev/ubi0_2 55620 12436 40308 24% /overlay
overlayfs:/overlay 55620 12436 40308 24% /
tmpfs 512 0 512 0% /dev
/dev/mmcblk0p2 30955520 3168 30952352 0% /tmp/mountd/disk1_part1
root@TOP-AXT1800:~# ls -l /tmp/mountd
drwxr-xr-x 4 root root 32768 Aug 6 14:09 disk1_part1
root@TOP-AXT1800:~#

this is the result of ls -l /tmp/mountd

but it’s doesn’t show the mount option

i use cat /proc/mounts:

root@TOP-AXT1800:~# cat /proc/mounts



/dev/mmcblk0p2 /tmp/mountd/disk1_part1 exfat rw,relatime,fmask=0022,dmask=0022,allow_utime=177777,iocharset=utf8,errors=remount-ro 0 0

it’s show it’s mounted as rw

as i mention before the samba it’s work perfectly fine with write and read . but just synching dont have permission .

i here to show my /etc/config/syncthing in case any help :

config syncthing ‘syncthing’
option enabled ‘1’

    option gui_address 'http://0.0.0.0:8384'

    # Use internal flash for evaluation purpouses. Use external storage
    #   for production.
    # This filesystem must either support ownership/attributes or
    #   be readable/writable by the user specified in
    #   'option user'.
    # Consult syslog if things go wrong.
    option home '/etc/syncthing'

    # Changes to "niceness"/macprocs are not picked up by "reload_config"
    #   nor by "restart": the service has to be stopped/started
    #   for those to take effect
    option nice '19'

    # 0 to match the number of CPUs (default)
    # >0 to explicitly specify concurrency
    option macprocs '0'

    # Running as 'root' is possible, but not recommended
    option user 'syncthing'

here is my /etc/init.d/syncthing :

#!/bin/sh /etc/rc.common

START=90
STOP=10

USE_PROCD=1

PROG=/usr/bin/syncthing

service_triggers()
{
procd_add_reload_trigger “syncthing”
}

start_service() {
local gui_address home enabled nice macprocs user
config_load “syncthing”

config_get_bool enabled syncthing enabled 1
[ “$enabled” -gt 0 ] || return 0

config_get user syncthing user ‘root’
config_get gui_address syncthing gui_address “http://0.0.0.0:8384
config_get home syncthing home “/etc/syncthing”

IDX_DB=$(readlink -n “$home”/index-v0.14.0.db)
if [ ! -z “$IDX_DB” ]; then
[ -d “$IDX_DB” ] || mkdir -p “$IDX_DB”

[ -d "$IDX_DB" ] && chown -R $user:$user "$IDX_DB"

fi

[ -d “$home” ] || mkdir -p “$home”

[ -d “$home” ] && chown -R $user:$user “$home”

config_get nice syncthing nice “0”

config_get macprocs syncthing macprocs 0
if [ $macprocs -le 0 ]; then
# Default to the number of cores in this case
macprocs=$(grep -c ^processor /proc/cpuinfo)
fi

procd_open_instance
procd_set_param command “$PROG”
procd_set_param file /etc/config/syncthing
procd_set_param env GOMAXPROCS=“$macprocs” STNOUPGRADE=1
procd_append_param command -gui-address=“$gui_address”
procd_append_param command -home=“$home”
procd_append_param command -no-browser
procd_set_param nice “$nice”
procd_set_param term_timeout 15
procd_set_param user “$user”
procd_set_param respawn
procd_set_param stdout 1
procd_set_param stderr 1
procd_close_instance
}

also …i found something funny going on …if i try to use option user ‘root’ at /etc/config/syncthing. as soon as i restart the service .

the /proc/mounts will automaticly change itself into ro. then the syncthing web GUI change from “permission denied” into "read only file system only "

and all my samba share are becoming readonly even the official GLinet web GUI say it’s writeable.

i need to reboot the axt1800 to recover that into rw.

furthermore, i also try as root to change ownership /tmp/mountd/disk1_part1/test ( the mounted path ) …but it’s said “Operation not permitted”

root@TOP-AXT1800:/tmp/mountd/disk1_part1# chown -R syncthing test/
chown: test/: Operation not permitted

haha i got a feeling i shouldn’t do this …but at least i tried :wink:

WOW !!! i got it worked !! finally !

just wanna share my founding …i m not gonna point all details ( i properly forgot anyway )

but what made it works if the method i use are not perfect PLEASE PLEASE PLEASE give me a better solution or another way around :wink:

so basically /etc/config/syncthing “0” into “1”; “root” into “synching”
in /etc/in.it.d/syncthing “root” into “synching”

then
uci set fstab.@mount[-1].options=“umask=000”
uci commit fstab
block umount
block mount

this set the basic level my monts as everyone can read and write . which is the only way i can think of including syncthing .

if you have a way to change the permission of mounted device. to allow syncthing RW. without breaking the stock samba ( /proc/mounts auto change into ro ) pls do share with me. ;)))))

1 Like

When I manually set up mount points under /mnt with option of rw, Everyone (owner, group, other) have read/write access because the permissions are rwxrwxrwx.

In the following, LEXAR16-1 is the inserted and mounted SD card with permissions rwxrwxrwx. The USB drive is not plugged in, but permissions will change to rwxrwxrwx when plugged in and mounted.

OMG …i think i have create more problems then i try to solve …my previous way to made umask=000 did work for like 10 min …

but then somehow something change the mount automatically again as RO …i notice when i do (cat /proc/mounts ) that the line error=remount-ro option…

so i do some mount man reading . i set it as errors=continue to stop the bloodily auto remounting…but then things got even weirder …

the syncthing keep saying there is no .stfolder and .stignore…so i manually created one there, and after a few min . it’s magically disappear ! as if some program keep delete for me .

anyone have any idea ?

mine doesn’t mount in /mnt/ like any other linux i experienced before …it’s mount in /tmp/mountd/disk2_part1…since it’s default setting i dont to changing it as i still want the stock samba service works …

i only just find out they use block-mount. which is new to me, be honest . i only have some experience using normal mount, changing fstab file before. which is empty now ha ! so it’s very difficult for me. guess i need to keep update my linux skill .

i forget to mention …i did try to use the luci GUI to manually change some mount …but it’s didn’t take effect after reboot …

see when i cat /proc/mounts it’s still on /tmp/mountd/disk2_part1. but when use uci show fstab it’s did have all my manually added config .

my syncthing still can’t write the path …( i did create the .stfolder and .stignore again ) but it’s just disappear itself .ha

the my config as follow:
image

execute command: ps

find the “syncthing” process run as “root” ,as:
image

and the share directory as:

=============================

first time, you can share the “/tmp” path, check the “syncthing” program run ok

1 Like

After testing on another router, it seems SD/USB mounting has changed in the latest GL.iNet/OpenWRT firmware. It always mounts on /tmp/mountd even after I specified /mnt in /etc/config/fstab. As you have also experienced, I can manually mount in /mnt, but this is not retained after reboot.

Regardless of the mount point, at least Samba works and I still get permissions rwxrwxrwx for Everyone to have read/write access.,

did you actually try to share and sync something ? as I mentioned before …this was my 1st attempt. to use as root for simple sake.

but the internal block-mount automaticlly switch it as readonly.( cat /proc/mounts ) it’s also affected all my samba become unwritable .

yea …but I never thought it’s a problem …as long as I know the path and put it on synching.

may be it’s the block-mount thing ?

another attempt to use root as option user…

now everything as predicted failed …try to reshare the entry from another machine and reaccept it… after few sec …

then I check the FS status by cat /proc/mounts

for some reason it’s automaticlly switch/lock/remount as ro …

then when I try to create a simple folder on my samba …it’s become readonly… I can play a movie or whatever …it’s just can’t write anymore .

Screenshot 2022-08-09 at 7.42.59 AM

I suspect there is some errors occurring every time synching try to write something on either my SSD or Sdcard. which cause whatever responsible to mount my storage (block-mount?) to remount as ro ( errors=remount-ro)

My choice of format is exfat for both my sdcard and my ssd as it’s will be plug into many different OS. OSx , GoPro, different DC camera , sometime windows … but don’t think it’s the FS issues …?

question is why this happen ? or how to avoid ? pls let me know if I missed something .

hello ?

does anyone managed to get synching working ?

Working I mean it’s doesn’t break the build-in stock smb share from the web GUI( it’s change to readonly by itself).

if so pls kindly share your method !

many thx !