• September 18, 2019, 01:12:12 AM
  • Welcome, Guest
Please login or register.

Login with username, password and session length
Advanced search  

News:

This Forum Beta is ONLY for registered owners of D-Link products in the USA for which we have created boards at this time.

Pages: 1 [2] 3

Author Topic: Shares are not accessible after reboot (1.08)  (Read 19166 times)

gunrunnerjohn

  • Level 11 Member
  • *
  • Posts: 2717
Re: Shares are not accessible after reboot (1.08)
« Reply #15 on: August 15, 2010, 01:50:45 PM »

Read the whole installation for fun_plug, you can enable SSH and then disable Telnet.  You have a secure and encrypted channel to the unit.
Logged
Microsoft MVP - Windows Desktop Experience
Remember: Data you don't have two copies of is data you don't care about!
PS: RAID of any level is NOT a second copy.

scaramanga

  • Level 2 Member
  • **
  • Posts: 99
Re: Shares are not accessible after reboot (1.08)
« Reply #16 on: August 15, 2010, 03:05:02 PM »

I haven't done this myself. You should be VERY careful with what you do here because if this might end very badly - you'll be unable to access your shares and be left with only the telnet access. So unless you're confident that you can recover from such mistakes I suggest you don't do it.

This change should be reboot persistent. Right?
Unfortunately, no. These files are not located on some persistent storage - they're in a filesystem that's entirely in memory. You'll need to:
1. Create a script in /ffp/start/ containg a similar line of code that adds some configuration to the original.
The content of the script should be something like this:
Code: [Select]
#!/bin/sh

#Add the following three lines to the [ global ] stanza of /etc/samba/smb.conf:
#domain master = no
#local master = no
#preferred master = no
mv /etc/samba/smb.conf /etc/samba/smb.conf.old
/ffp/bin/sed -e '/\[ global \]/adomain master = no' -e '/\[ global \]/alocal master = no' -e '/\[ global \]/apreferred master = no' /etc/samba/smb.conf.old > /etc/samba/smb.conf

#restart the smb and nmb daemons with the new configuration
smb restart


That script needs more code to stop and then start nmbd and smbd. That's the part I'm the least confident about, since my samba/cifs skills are not that hot.

2. Make sure that the script's permissions allow its execution (chmod +x <script-file-name>).

Another thing, once installed ffp the telnet server is always running , right? I'm behind a Firewall (NETGEAR WNR3500) but I don't like the idea to leave some door open.
Is it possibile to shutdown the telnet service or uninstall FFP? Should I simply delete files from Volume 1 ???

You won't be able to delete ffp completely, because you'll still need it to run that script on every boot. You can, however, disable it from running the telnet daemon. What people ussualy do is follow the instructions to run ssh and after that disable the telnet daemon by removing its execution permissions. See instructions here: http://wiki.dns323.info/howto:1st_steps

« Last Edit: August 15, 2010, 05:09:37 PM by scaramanga »
Logged
DNS-323 HW Rev. C1 FW 1.08 fun_plug 0.5
2 x Western Digital WD10EARS-00Y5B1 in Standard mode
(LLC changed to 5 minutes. Partitions aligned to 4K boundary)

gunrunnerjohn

  • Level 11 Member
  • *
  • Posts: 2717
Re: Shares are not accessible after reboot (1.08)
« Reply #17 on: August 15, 2010, 03:14:12 PM »

Gosh, starting and stopping SMB is the easy part! :D

smb stop

smp start


If you put your script into a new file in the /ffp/start directory and call it rconfig.sh, it'll be called whenever the NAS is booted.
Logged
Microsoft MVP - Windows Desktop Experience
Remember: Data you don't have two copies of is data you don't care about!
PS: RAID of any level is NOT a second copy.

scaramanga

  • Level 2 Member
  • **
  • Posts: 99
Re: Shares are not accessible after reboot (1.08)
« Reply #18 on: August 15, 2010, 05:01:29 PM »

Gosh, starting and stopping SMB is the easy part! :D

smb stop

smp start


If you put your script into a new file in the /ffp/start directory and call it rconfig.sh, it'll be called whenever the NAS is booted.


Wasn't sure if smb stop/start would also start nmbd or not. Just tried it. It does.
(was also a bit uncertain at what stage of boot /ffp/start is processed. I have the box about a week)
I've edited the script above to include that missing part.
« Last Edit: August 15, 2010, 05:11:27 PM by scaramanga »
Logged
DNS-323 HW Rev. C1 FW 1.08 fun_plug 0.5
2 x Western Digital WD10EARS-00Y5B1 in Standard mode
(LLC changed to 5 minutes. Partitions aligned to 4K boundary)

gunrunnerjohn

  • Level 11 Member
  • *
  • Posts: 2717
Re: Shares are not accessible after reboot (1.08)
« Reply #19 on: August 15, 2010, 05:15:25 PM »

Let us know how it works out. :)
Logged
Microsoft MVP - Windows Desktop Experience
Remember: Data you don't have two copies of is data you don't care about!
PS: RAID of any level is NOT a second copy.

scaramanga

  • Level 2 Member
  • **
  • Posts: 99
Re: Shares are not accessible after reboot (1.08)
« Reply #20 on: August 16, 2010, 04:06:43 AM »

It works. I restarted the DNS-323 and was able to access my shares without a problem from the XP SP3 box. I also tried restarting my PC and had no problems as well.

I've cleaned the script up a bit more, and made it slightly more safer to use: smb restart will only be called if editing smb.conf succeeded. Otherwise, restore smb.conf from backup.

Here it is: editsmbconf.sh
Code: [Select]
#!/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 = no
#    local master = no
#    preferred master = no
#
# 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 = no' -e '/\[ global \]/alocal master = no' -e '/\[ global \]/apreferred master = no' ${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

Logged
DNS-323 HW Rev. C1 FW 1.08 fun_plug 0.5
2 x Western Digital WD10EARS-00Y5B1 in Standard mode
(LLC changed to 5 minutes. Partitions aligned to 4K boundary)

gunrunnerjohn

  • Level 11 Member
  • *
  • Posts: 2717
Re: Shares are not accessible after reboot (1.08)
« Reply #21 on: August 16, 2010, 05:10:26 AM »

Actually, stopping and starting SMB is not a problem, it won't hurt anything.  No need to make the script conditional on anything, just stop it when you start, and start it before you exit the script.

Did you test this and verify that the lines are being properly added to the configuration file?

I also note that if you only have one device like the DNS-323 in the system, having it be the master browser isn't necessarily a bad thing, it's nice to have a device that's always there doing this function.  I have my Synology DS209 as my browse master since it's always on.


If you're interested in seeing a listing of the master browsers on the network, I use LAN Scanner from this page: http://scottiestech.info/downloads/.  It will list all the hosts that think they're the master browser, there should be only one.


« Last Edit: August 16, 2010, 05:16:08 AM by gunrunnerjohn »
Logged
Microsoft MVP - Windows Desktop Experience
Remember: Data you don't have two copies of is data you don't care about!
PS: RAID of any level is NOT a second copy.

scaramanga

  • Level 2 Member
  • **
  • Posts: 99
Re: Shares are not accessible after reboot (1.08)
« Reply #22 on: August 16, 2010, 05:55:22 AM »

Actually, stopping and starting SMB is not a problem, it won't hurt anything.  No need to make the script conditional on anything, just stop it when you start, and start it before you exit the script.
Not sure I understand. I was worried that if editing smb.conf somehow corrupts it restarting smb will leave me without shares. Couple that with a telnet/ssh problem and you've got yourself a real issue.

Did you test this and verify that the lines are being properly added to the configuration file?
Yup. Mind you, I don't have a printer, and only one PC (XP SP3).

I also note that if you only have one device like the DNS-323 in the system, having it be the master browser isn't necessarily a bad thing, it's nice to have a device that's always there doing this function.  I have my Synology DS209 as my browse master since it's always on.
So far, in my case this proved only to cause this minor grievance when restarting the DNS-323. That (restart) should be rare thing. But I'm still fooling around with it (fun fun fun) so while I'm at it this should help a little.

If you're interested in seeing a listing of the master browsers on the network, I use LAN Scanner from this page: http://scottiestech.info/downloads/.  It will list all the hosts that think they're the master browser, there should be only one.
I used: nbtstat from the command line.
Logged
DNS-323 HW Rev. C1 FW 1.08 fun_plug 0.5
2 x Western Digital WD10EARS-00Y5B1 in Standard mode
(LLC changed to 5 minutes. Partitions aligned to 4K boundary)

gunrunnerjohn

  • Level 11 Member
  • *
  • Posts: 2717
Re: Shares are not accessible after reboot (1.08)
« Reply #23 on: August 16, 2010, 06:02:37 AM »

I guess since you're talking to this with Telnet or SSH, I can't see how starting and stopping SMB is going to break that.  I must be an optimist. :D  Do you really see this as a real possibility?
Logged
Microsoft MVP - Windows Desktop Experience
Remember: Data you don't have two copies of is data you don't care about!
PS: RAID of any level is NOT a second copy.

scaramanga

  • Level 2 Member
  • **
  • Posts: 99
Re: Shares are not accessible after reboot (1.08)
« Reply #24 on: August 16, 2010, 06:14:12 AM »

I guess since you're talking to this with Telnet or SSH, I can't see how starting and stopping SMB is going to break that.  I must be an optimist. :D  Do you really see this as a real possibility?
Not really. One of my try runs with sed from the CLI resulted with an empty file. That's why I came up with that double checking.

Following what you wrote about the benefits of an always-on machine being the master browser I realized that I've gone about this wrong. The reason why after reboot the DNS-323's shares aren't imidiately accessible is becuase, by default, preferred master = no, which means after reboot the DNS-323 doesn't force an election of the master browser.

I changed the script so that the DNS-323 will be the master browser of it's workgroup and subnet and also force an election for master browser after it boots
Code: [Select]
#!/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

Logged
DNS-323 HW Rev. C1 FW 1.08 fun_plug 0.5
2 x Western Digital WD10EARS-00Y5B1 in Standard mode
(LLC changed to 5 minutes. Partitions aligned to 4K boundary)

gunrunnerjohn

  • Level 11 Member
  • *
  • Posts: 2717
Re: Shares are not accessible after reboot (1.08)
« Reply #25 on: August 16, 2010, 06:24:05 AM »

Yep, if it's the only device that insists on being the master browser, it's usually beneficial to let it assume that role. :)

The situation you don't want it multiple machines trying to assume that role.  Before my modifications, I had the DNS-321, DNS-323, and the Synology all trying to assume that role!  I also had some issues with delays and occasionally a machine would get "lost" on the network.  Since shutting the two D-Link boxes up, that stopped happening. :)
Logged
Microsoft MVP - Windows Desktop Experience
Remember: Data you don't have two copies of is data you don't care about!
PS: RAID of any level is NOT a second copy.

Ita_gsxr

  • Level 1 Member
  • *
  • Posts: 9
Re: Shares are not accessible after reboot (1.08)
« Reply #26 on: August 16, 2010, 06:39:14 AM »

First of all let me thank you Scaramanga and Gunrunnerjohn for your help!!

Unfortunately I don't feel so confident to try this approach. I have poor linux basic. And my NAS is now full of data.

I have also noticed that after all things seems to run smoother on my network when 323 is the master browser.

Meanwhile I found a Microsoft tool called BROWSTAT.EXE (you can find it here: http://www.microsoft.com/downloads/details.aspx?familyid=49ae8576-9bb9-4126-9761-ba8011fabf38&displaylang=it ) that could be useful:

browstat getmaster (search for Master Browser)
browstat tickle (force remote master service to stop)

Now I have multiple choice:
1) Boot NAS, log on to the 323, go to the NETWORK ACCESS section and modify one rule to get access to the shares

2) Force Master Browser to stop on both my pc using Browstat before booting the 323 so it can be the MBrowser.

3) Boot the 323 before pc.

Oh I even found that is possible to set some xp registry key to prevent a machine to become the master. But this way for me it's not good because when the 323 is off one my pc need to be the Mbrowser.

------------------- Found in others forum
http://www.tomsguide.com/us/how-to-xp-share-fix,review-215-7.html

Master Browser requires NetBT (NetBIOS over Tcp)

HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Browser\Parameters\.

MaintainServerList = Auto (default) choices are Auto, Yes, No
IsDomainMaster =FALSE (default) choices are True and False

Set it to:

MaintainServerList = No
IsDomainMaster =FALSE
-------------------------
Logged

gunrunnerjohn

  • Level 11 Member
  • *
  • Posts: 2717
Re: Shares are not accessible after reboot (1.08)
« Reply #27 on: August 16, 2010, 06:43:59 AM »

Why do you turn your DNS-323 off?  It uses about 6 watts in idle, I'd just leave it on. :)
Logged
Microsoft MVP - Windows Desktop Experience
Remember: Data you don't have two copies of is data you don't care about!
PS: RAID of any level is NOT a second copy.

Ita_gsxr

  • Level 1 Member
  • *
  • Posts: 9
Re: Shares are not accessible after reboot (1.08)
« Reply #28 on: August 16, 2010, 06:45:27 AM »

I forgot the most important feature:

BROWSTAT ELECT - Force election on remote domain

 :D
Logged

Ita_gsxr

  • Level 1 Member
  • *
  • Posts: 9
Re: Shares are not accessible after reboot (1.08)
« Reply #29 on: August 16, 2010, 06:50:38 AM »

Why do you turn your DNS-323 off?  It uses about 6 watts in idle, I'd just leave it on. :)

It's not for the power consumption, simply I don't have a UPS. What happens to my data in case of power failure?
Logged
Pages: 1 [2] 3