Difference between revisions of "Linksys AC Series Router Configuration Tips for OpenWRT"

m
no edit summary
m
Line 2,639: Line 2,639:


And lastly, remember if one attempts to share the "Root Directory" ( / ), none of the sub directories will open, because of the way the OpenWRT file system works.
And lastly, remember if one attempts to share the "Root Directory" ( / ), none of the sub directories will open, because of the way the OpenWRT file system works.
==== Free Space Tip for Samba ====
In some circumstances Samba will not report the correct amount of free space.  This can be quite frustrating when one knows there is enough free space to copy a file, but an obnoxious error message pops up declaring that there needs to be X amount of more free space.
This can occur when one is accessing an external USB Flash Drive under /mnt (for example /mnt/sda1).  Samba will report the free space of the root drive of the router instead of the USB Flash Drive.  The root drive of the router is often time the internal NVRAM.  If one is using the overlay capability of OpenWRT (look it up), this often won't come up as the issue will be masked by the /overlay having an abundant amount of free space.
The hint was found here: https://superuser.com/questions/1423396/samba-reports-incorrect-disk-space-when-on-shared-mount-points-not-directly-bene
And that person was kind enough to cite the Samba Documentation: https://www.samba.org/samba/docs/current/man-html/smb.conf.5.html#idm2835<nowiki/>(although they didn't include the anchor link at the end, but it was added here so there wouldn't be any need to scroll down to find it, plus the Samba people that created the documentation page were also kind enough to include a name (ID would work too) attribute so a URL anchor could be used).
Below is the code (minus the comments if one wishes) that can be added in the LuCI GUI, Services, Network Shares, Edit Template Tab.<syntaxhighlight lang="text">
### The dfree command refers to a script (next two lines) that cause Samba to correctly calculate free space for each
### Directory.  This comes into play when accessing an external USB Flash Drive under /mnt/sda1 for instance.  Samba
### will incorrectly report the internal NVRAM size instead of the USB Flash Drive free space.
### #!/bin/sh
### df  $1 | tail -1 | awk '{print $2" "$4}'
dfree command = /usr/local/samba/dfree
</syntaxhighlight>Don't forget to create the script file (see code above or below);<syntaxhighlight lang="text">
#!/bin/sh
df  $1 | tail -1 | awk '{print $2" "$4}'
</syntaxhighlight>


====WINS (Windows Internet Naming Service) for Samba====
====WINS (Windows Internet Naming Service) for Samba====