DSM-G600, DNS-3xx and NSA-220 Hack Forum

Unfortunately no one can be told what fun_plug is - you have to see it for yourself.

You are not logged in.

Announcement

#1 2011-01-04 21:10:36

acfarrey
New member
Registered: 2011-01-04
Posts: 1

Windows Machines Losing Connectivity via drive mappings

I have 3 different machines on my network - 1 running Windows XP, 1 running Windows 7 Ultimate, and 1 running Windows 7 Home.  All three of these machines have a drive mapped to the DNS-323.  Several months ago, I started getting a problem where all of the PCs on the network would lose the connection to the mapped drive.

I have tried mapping the drive using both the NAS name (i.e. \\MYNAS\Volume_1) and the IP Address (i.e \\192.168.1.120\Volume_1) and it doesn't appear to matter which way I do it.  If i reboot the NAS, it seems to fix the problem and the connections are restored.  If I reboot the Windows machines (but not the NAS) - the connection is not able to be restored.  This leads me to believe it is something on the NAS.  I am able to access the NAS via a web browser and telnet - which leads me to believe it's something with Samba.

As a result, I have messed around with the samba settings using some of the BetterSamba instructions in the Wiki and that hasn't resolved the problem either (and it is not affecting the file mask).

Here is my latest smb.conf file

Code:

[ global ]
interfaces = egiga0
unix charset = UTF8
workgroup = XXXXXXX #changed in post - verified that workgroup matches on all devices
netbios name = MYNAS
server string = DNS-323
hosts allow =
hosts deny =
security = USER
encrypt passwords = yes
max log size = 0
socket options = TCP_NODELAY SO_RCVBUF=65536 SO_SNDBUF=65536
max xmit = 65535
create mask = 0664
directory mask  = 0775
force create mode = 0664
force directory mode = 0775
load printers = Yes
printcap name = /usr/local/LPRng/etc/printcap
min print space = 2000
max print jobs = 1000
printing = lprng
print command = /usr/local/LPRng/bin/lpr -P%p -r %s
lpq command = /usr/local/LPRng/bin/lpq -P%p
lprm command = /usr/local/LPRng/bin/lprm -P%p %j
lppause command = /usr/local/LPRng/sbin/lpc hold %p %j
lpresume command = /usr/local/LPRng/sbin/lpc release %p %j
queuepause command = /usr/local/LPRng/sbin/lpc -P%p stop
queueresume command = /usr/local/LPRng/sbin/lpc -P%p start
use sendfile =yes


[ web_page ]
comment = Enter Our Web Page Setting
path = /mnt/web_page
valid users =
read only = yes
guest ok = yes

[printers]
path = /mnt/HD_a4/.lpd
guest ok = Yes
printable = Yes
use client driver = Yes
browseable = No

[ Volume_1 ]
comment =
path = /mnt/HD_a2
valid users =
read only = no
guest ok = yes
oplocks = no
map archive = no

[ Volume_2 ]
comment =
path = /mnt/HD_b2
valid users =
read only = no
guest ok = yes
oplocks = no
map archive = no

To swap out the smb.conf files I have created a shell script called sambafix.sh in the /mnt/HD_a2/ffp/start directory.  I have verified that the script is executable and getting executed in the start-up as I am seeing the output of the smb restart in the ffp.log.  Below is the sambafix.sh script.

Code:

# Copy local copy of samba config file to samba directory and restart samba
cp /mnt/HD_a2/ffp/start/smb.conf /etc/samba/smb.conf
smb restart

Anyone have some advice on what to look at next?

Offline

 

#2 2011-01-05 12:22:09

scaramanga
Member
Registered: 2010-08-04
Posts: 251

Re: Windows Machines Losing Connectivity via drive mappings

I ran into a similar problem a while ago (One machine, XP SP3).
I, eventually, came to the conclusion that it was a master browser election problem. I ended up writing my own script that edits the smb.conf file instead of replacing it. The advantage of that approach being I probably won't need to re-create the file whenever I make changes to SMB shares.

The discussion that lead to it can be found here: http://forums.dlink.com/index.php?topic=14522.0

Here's my script:

Code:

#!/bin/sh

# After rebooting the DNS-323, often you can't access your shares from
# windows machines. This script "should" fix this by adding the following
# three lines to the [ global ] stanza of /etc/samba/smb.conf:
#   domain master = yes
#   local master = yes
#   preferred master = yes
# What this does is make the DNS-323 the master browser of its workgroup,
# subnet and also make it force an election for master browser after it
# is booted.
#
# INPORTANT: If anything goes wrong here, you might not be able to access
#            your data. Only use this if you know how to recover from such
#            a problem by yourself.

#
# Commands
#
echoCmd="/bin/echo"
cpCmd="/bin/cp"
sedCmd="/ffp/bin/sed" # Couldn't get it to work with /bin/sed
smbCmd="/usr/bin/smb"

#
# Files
#
smbConf="/etc/samba/smb.conf"
smbConfBackup="/etc/samba/smb.conf.old"


${echoCmd} "Backing-up ${smbConf} to ${smbConfBackup}"
${cpCmd} -a ${smbConf} ${smbConfBackup}

${echoCmd} "Modifying ${smbConf}"
${sedCmd} -e '/\[ global \]/adomain master = yes' -e '/\[ global \]/alocal master = yes' -e '/\[ global \]/apreferred master = yes' ${smbConfBackup} > ${smbConf}
if test $? -eq 0; then
    ${echoCmd} "Done! Restarting smb and nmb daemons"
    ${smbCmd} restart
else
    ${echoCmd} "Error! Recovering ${smbConf} from backup ${smbConfBackup}"
    ${cpCmd} -fa ${smbConfBackup} ${smbConf}
fi

DNS-323 HW Rev. C1 FW 1.10 fun-plug 0.5
2 x WD10EARS-00Y5B1 in Standard mode (LCC set to 5 min; Aligned to 4K)
Transmission with Transmission Remote GUI

Offline

 

#3 2011-06-20 15:22:06

TomyManic
New member
Registered: 2011-06-20
Posts: 1

Re: Windows Machines Losing Connectivity via drive mappings

Thanks scaramanga, I was in a same problem, and your post really helped me out.

Offline

 

#4 2011-06-21 01:28:56

ivan1
Member
Registered: 2011-05-02
Posts: 17

Re: Windows Machines Losing Connectivity via drive mappings

Over many years I have learned to look for the simple things first.  In this case the first thing I would look at is the router, it could be creating problems because of temperature, ageing components etc.  Once you have eliminated that as the cause of the problem then it is time to start looking at SAMBA.  I have encountered a problem something like the one mentioned here - the cause, a network cable wasn't fully plugged into the switch and every so often would break contact and do all manner of nasty things to the network.

Offline

 

#5 2011-06-21 15:41:06

fordem
Member
Registered: 2007-01-26
Posts: 1938

Re: Windows Machines Losing Connectivity via drive mappings

ivan1 wrote:

Over many years I have learned to look for the simple things first.  In this case the first thing I would look at is the router, it could be creating problems because of temperature, ageing components etc.  Once you have eliminated that as the cause of the problem then it is time to start looking at SAMBA.  I have encountered a problem something like the one mentioned here - the cause, a network cable wasn't fully plugged into the switch and every so often would break contact and do all manner of nasty things to the network.

Whilst looking for the simple things first IS a good approach - an analytical approach may be better.

The router plays a very minor role in LAN~LAN communication - it acts as a DHCP server and leases ip addresses to the hosts on the LAN - and once a host as an ip address, it's pretty much done talking to the router, unless it's being used to access the internet.

As a matter of fact - since most of us are likely to use the internet more than we do our NAS, chances are we will notice that we are unable to access the internet long before we notice we can't access the NAS, and if we can access the internet, chances are the router is doing what it should - in your case the loose network cable would/should have prevented internet access.

Many people underestimate the importance of the network cables, and an incorrectly terminated network cable can cause some very elusive problems - for example - internet access may work fine, but data transfer to/from the NAS fails - for most of us, our internet connection is no where near as fast as the NAS, and ethernet's "self healing" capabilities, allow the slower internet connection to work, but the higher speed of the NAS causes the fault to become obvious - problems of this nature can best be detected by analyzing the situation to determine when the problem occurs, what are the circumstances under which it occurs, etc.

I'm not certain if you know this - but you can build a small LAN without a router using the DNS-323 as the DHCP server - all you need is a network switch the clients and the cables - of course without a router there's no internet access, but, you can do a workgroup, half a dozen people storing data on the DNS-323 and printing to a shared printer on the DNS-323's USB port - what else do you need for a small business, say a little grocery store with two point of sale terminals?

Offline

 

#6 2011-06-21 18:15:15

ivan1
Member
Registered: 2011-05-02
Posts: 17

Re: Windows Machines Losing Connectivity via drive mappings

I must admit I was thinking about routers with built in switches where the switch section starts acting up.  In fact I have seen one where you had a 50/50 chance of two of the ports working, although if they did work  they worked without problems until the next startup.

That loose network cable was one of the hardest to find with the cleaner moving the cables so that sometimes it would work for days without problems only to have someone move something and problems started.

Your last point is well worth noting and should be of help to same people.  In fact that is how I setup a small network for a friend because his internet connection is by dialup modem.  The DNS-323 is connected to a 10/100/1000 switch and a printer, three workstations connect to each other, the printer and NAS.  He's happy with his spreadsheets and his wife with her graphic arts.  They had been quoted an astronomic figure for upgrading the telephone line and then there was no guarantee it would be any better, so for the cost of the DNS-323 and a switch they carry on working.

Offline

 

Board footer

Powered by PunBB
© Copyright 2002–2010 PunBB