You are Here:
Linux Lite 6.6 FINAL Released - Support for 22 Languages Added - See Release Announcement Section



network share drives me mad

Author (Read 13524 times)

0 Members and 1 Guest are viewing this topic.

Re: network share drives me mad
« Reply #22 on: January 16, 2015, 09:27:21 PM »
 

greenisland

  • New to Forums
  • *
  • 34
    Posts
  • Reputation: 6
  • Linux Lite Member
    • View Profile
WOW - Thank you for those suggestions!

I will implement them and eventually report back!
 

Re: network share drives me mad
« Reply #21 on: January 14, 2015, 06:44:22 AM »
 

Wirezfree

  • PayPal Supporter
  • Platinum Level Poster
  • *****
  • 1484
    Posts
  • Reputation: 405
  • Linux Lite "Advocate"
    • View Profile

  • CPU: i7-4790S

  • MEMORY: 16Gb

  • VIDEO CARD: Intel HD4600 (Integrated)
Hi greenisland,

Sorry for the late follow-up, having a couple of issue with a new install.
On this new install, I followed my own guide, and all my networking/sharing worked out fine.
Here are a couple of things I do,
They maybe redundant legacy things from when I had Windows/Linux, but they still work for me.

Before I start on network setup and sharing I install various packages:
Code: [Select]
sudo apt-get install system-config-samba cifs-utils libnss-winbind winbind gvfs-backends
Then when doing the samba.conf file, I also add these 2 lines in the Global section
name resolve order = bcast host lmhosts wins
local master = no
This helps in name resolution & lookup, and stops various PC's competing for "who is master browser"

Then I do:
Code: [Select]
gksu leafpad /etc/nsswitch.confand change the hosts line, add the wins:
Code: [Select]
hosts: files mdns4_minimal [NOTFOUND=return] dnsTo this:
Code: [Select]
hosts: files mdns4_minimal [NOTFOUND=return] wins dnsThis helps in name resolution & lookup.

A couple of commands that I have found useful in checking everything is showing up.?

Code: [Select]
smbtreeand
Code: [Select]
nmblookup -S <your_workgroup_name>
like:
Code: [Select]
nmblookup -S WORKGROUP
Can't think of anything else

Dave
Upgrades WIP 2.6 to 2.8 - (6 X 2.6 to 2.8 completed on: 20/02/16 All O.K )
Linux Lite 3.0 Humming on a ASRock N3070 Mobo ~ btrfs RAID 10 Install on 4 Disks :)

Computers Early days:
ZX Spectrum(1982) , HP-150 MS-DOS(1983) , Amstrad CPC464(1984) ,  BBC Micro B+64(1985) , My First PC HP-Vectra(1987)
 

Re: network share drives me mad
« Reply #20 on: January 08, 2015, 07:10:12 PM »
 

greenisland

  • New to Forums
  • *
  • 34
    Posts
  • Reputation: 6
  • Linux Lite Member
    • View Profile
Thank you Dave, I feel quite sure also that this is not a Linux Lite issue.  The difficulties of mounting network drives (especially those on Windows computers) have plagued me for years across PCLINUXOS, Puppy, Solydxk, and now my new favorite distribution.  I read similar posts elsewhere and my pet theory is that this is one of those things that results from networking, and especially networking to windows machines, not being a first priority in the linux world itself.
 

Re: network share drives me mad
« Reply #19 on: January 08, 2015, 09:46:07 AM »
 

Wirezfree

  • PayPal Supporter
  • Platinum Level Poster
  • *****
  • 1484
    Posts
  • Reputation: 405
  • Linux Lite "Advocate"
    • View Profile

  • CPU: i7-4790S

  • MEMORY: 16Gb

  • VIDEO CARD: Intel HD4600 (Integrated)
Hi greenisland,

Thanks for the update and trials.
Hang in there, I find it hard to believe it's a LL issue.
I'm doing another install tomorrow/Saturday.
I will be using the rc.local method, I will reverify my steps,
just in case I have missed something to pass on to you.

Dave
Upgrades WIP 2.6 to 2.8 - (6 X 2.6 to 2.8 completed on: 20/02/16 All O.K )
Linux Lite 3.0 Humming on a ASRock N3070 Mobo ~ btrfs RAID 10 Install on 4 Disks :)

Computers Early days:
ZX Spectrum(1982) , HP-150 MS-DOS(1983) , Amstrad CPC464(1984) ,  BBC Micro B+64(1985) , My First PC HP-Vectra(1987)
 

Re: network share drives me mad
« Reply #18 on: January 08, 2015, 08:13:59 AM »
 

greenisland

  • New to Forums
  • *
  • 34
    Posts
  • Reputation: 6
  • Linux Lite Member
    • View Profile
Thank you Wirezfree and N4RPS for the suggestions. 

Along the lines of the above suggestions using sleep, someone (I think on the PCLINUX forum in the past) suggested this as a script in the rc.local file to make sure that the device was connected to the network before attempting to mount.  I used this is in the past with some success, so thought it might be worth adding here:

RC.LOCAL
       
        ( until ping -q -W4 -c1 google.com &>/dev/null; do
            sleep 5
          done
          mount /mnt/<servername>
        ) &
 
----------------------------------------

But that doesn't seem to be doing the trick for me this time, probably for the reason wirezfree says -- there's something about issuing the command once that makes it work the second time through, and I don't think it's because the wireless came up at that point. 

Just in case I wasn't clear before, this is a concern for me because I use some windows programs in Crossover/wine that don't seem to work properly unless the network drive is "mounted" to the file system.  I realize that's a kind of rare need, so it may not affect most people, who simply want a method of transferring files back and forth.  I think, that having fully mounted through fstab may be important for programs that hold files open for a long period of time (such as database programs, perhaps).

I did some more reading on the links I posted earlier about the bug reports on mount.cifs, and that does seem related to what I am experiencing.

Again, thanks to all, and if I figure this out I will report back.
 

Re: network share drives me mad
« Reply #17 on: January 07, 2015, 09:29:11 PM »
 

N4RPS

  • Donator
  • Platinum Level Poster
  • **********
  • 1149
    Posts
  • Reputation: 155
  • Knows JUST ENOUGH Linux to be DANGEROUS
    • View Profile
    • Orphans for Christ, Self Advocates of Mecklenburg

  • CPU: Several Different 32-bit & 64-bit CPUs, 2-8 GB RAM

  • MEMORY: 8Gb

  • VIDEO CARD: Several Different AMD and Intel GPUs
Hello!

In your script, you might be able to use a wait loop (if/then) to look for the text of the error message that stops it when it's echoed back, and then have the script execute the second command after that.

Just a suggestion...

73 DE N4RPS
Rob



A gun in your hand is worth more than a whole police force on the phone.
 

Re: network share drives me mad
« Reply #16 on: January 07, 2015, 09:24:34 PM »
 

Wirezfree

  • PayPal Supporter
  • Platinum Level Poster
  • *****
  • 1484
    Posts
  • Reputation: 405
  • Linux Lite "Advocate"
    • View Profile

  • CPU: i7-4790S

  • MEMORY: 16Gb

  • VIDEO CARD: Intel HD4600 (Integrated)
Hi greenisland,

I'm now at the limits of my knowledge on this.?
I really don't understand why it's failing,
I'm sure there is a clue in the fact that when done manually, it works 2nd time.!!

This is a thought, I have no idea how to do it, not done any scripts.
Create a script with the relevant commands X 2, and have it in your Auto Start-up
Not pretty or elegant, but may work.?

Dave
Upgrades WIP 2.6 to 2.8 - (6 X 2.6 to 2.8 completed on: 20/02/16 All O.K )
Linux Lite 3.0 Humming on a ASRock N3070 Mobo ~ btrfs RAID 10 Install on 4 Disks :)

Computers Early days:
ZX Spectrum(1982) , HP-150 MS-DOS(1983) , Amstrad CPC464(1984) ,  BBC Micro B+64(1985) , My First PC HP-Vectra(1987)
 

Re: network share drives me mad
« Reply #15 on: January 07, 2015, 06:41:44 PM »
 

greenisland

  • New to Forums
  • *
  • 34
    Posts
  • Reputation: 6
  • Linux Lite Member
    • View Profile
Well after playing further with gigolo and also pyneighborhood, I have made zero progress.

However, what this has made me realize is that hitting the same command twice in the terminal window really isn't so bad after all.  Elegant it is not, but it is doing the trick.
 

Re: network share drives me mad
« Reply #14 on: January 07, 2015, 05:52:17 PM »
 

greenisland

  • New to Forums
  • *
  • 34
    Posts
  • Reputation: 6
  • Linux Lite Member
    • View Profile
Thank you Dave.  The reason for my issue is that I use a couple of programs that seem to work well when a network drive is "mounted" but do not work so well (or at all) when the connection is just a smb share such as gigolo sets up.  I don't know enough to understand the difference but maybe I can find a link from another forum.  At any rate, thank you for your efforts so far.

Here is something I read some time ago that gave a stab and explaining the difference:

"Is there any difference technically in the resulting connection between (1) adding the entry in fstab, and (2) using Dolphin in KDE to navigate over to the share? 

I realize that the fstab entry is "permanent" but I don't know if I should worry about getting it right in fstab if going through Dolphin creates the same technical result.

Yes, there is.

Using fstab will mount the network into the local filesystem, making it available to any other process like any other file.  It is completely application agnostic, and more in-line with the original Unix/Linux filesystem ideology.

Accessing it though Dolphin uses "kioslaves" (or, whatever their current KDE4 equivalent may be), without making the files "locally accessible".  Only (probably KDE/QT) aware applications will be able to properly access them, in even in those case, they may actually copy the file to "tmp" before accessing it.  This is most noticeable, for example, if you try to use LibreOffice in this way...opening the file will probably fail.

Personally, I would recommend the fstab approach, or manually (either at the command line, or through a batch file) mounting the resource into the local filesystem.

One thing I've noticed, that may be worth note, when I've manually mounted SMB shares:  on occasions where I've failed to un-mount them prior to shutting down or rebooting, the process would hang and require a hard boot.  I'm not 100% certain, but if it is in fstab, then un-mounting all mounted drives is part of the shut down process.
« Last Edit: January 07, 2015, 05:56:24 PM by greenisland »
 

Re: network share drives me mad
« Reply #13 on: January 07, 2015, 04:10:43 PM »
 

Wirezfree

  • PayPal Supporter
  • Platinum Level Poster
  • *****
  • 1484
    Posts
  • Reputation: 405
  • Linux Lite "Advocate"
    • View Profile

  • CPU: i7-4790S

  • MEMORY: 16Gb

  • VIDEO CARD: Intel HD4600 (Integrated)
Hi greenisland,

Not sure what to suggest at the moment, will do some digging...
Out of interest you could try Gigolo,
You can also configure it to Auto Connect to Shares

https://sites.google.com/site/easylinuxtipsproject/reserve-6

Dave
Upgrades WIP 2.6 to 2.8 - (6 X 2.6 to 2.8 completed on: 20/02/16 All O.K )
Linux Lite 3.0 Humming on a ASRock N3070 Mobo ~ btrfs RAID 10 Install on 4 Disks :)

Computers Early days:
ZX Spectrum(1982) , HP-150 MS-DOS(1983) , Amstrad CPC464(1984) ,  BBC Micro B+64(1985) , My First PC HP-Vectra(1987)
 

Re: network share drives me mad
« Reply #12 on: January 07, 2015, 02:38:13 PM »
 

greenisland

  • New to Forums
  • *
  • 34
    Posts
  • Reputation: 6
  • Linux Lite Member
    • View Profile
Many thanks again, Dave:

Your suggestions made a lot of sense, especially the one about maybe I was creating a problem by trying to mount directly to the /mnt folder.

Unfortunately, strangely, or whatever, NEITHER of the changes you suggested made any difference. 

It tried them incrementally, first adding the sec=ntlm switch, and tested just by adding to the rc.local file and rebooting.  Nothing - did not mount.
I think executed the same command (sudo mount...... with the ntlm switch set from terminal. 
Same result as before - error message on the first try, then on the second try it mounted.

I then tried your suggestion about mounting to the home directory.
Didn't work from rc.local, then when I tried it from the command line (after first creating a directory in my home folder of the same name) I got the same result.
Same error on first pass , then on second try i worked flawlessly. 

I am sorry to be asking such a precise question and to take up so much of your time.  Maybe someone else will profit from this somewhere down the road.  I am a classic windows refugee trying to make a small office network work, and maybe I am doing something that others will stumble on as well.
 

Re: network share drives me mad
« Reply #11 on: January 07, 2015, 01:23:15 PM »
 

Wirezfree

  • PayPal Supporter
  • Platinum Level Poster
  • *****
  • 1484
    Posts
  • Reputation: 405
  • Linux Lite "Advocate"
    • View Profile

  • CPU: i7-4790S

  • MEMORY: 16Gb

  • VIDEO CARD: Intel HD4600 (Integrated)
Hi,

Some what baffling..!!,, Couple of other things to try.

Try changing the sleep to 20 just in case there is a timing issue on when the "Network" is established.
I see you are mapping/binding to the mnt dir

Code: [Select]
mount -t cifs -o username=username,password=yourpassword,uid=username,gid=users //dellserver/cArchive /mnt/dellserver

I don't suspect it's the issue, but I'm mapping to specific folders in my /home/dave/zshare/<dir>

Also in my notes I had a note about security... and "sec=ntlm"
Try changing the line by adding it in:
Code: [Select]
mount -t cifs -o username=username,password=yourpassword,uid=username,gid=users,sec=ntlm //dellserver/cArchive /mnt/dellserver

I will try to investigate

Dave
Upgrades WIP 2.6 to 2.8 - (6 X 2.6 to 2.8 completed on: 20/02/16 All O.K )
Linux Lite 3.0 Humming on a ASRock N3070 Mobo ~ btrfs RAID 10 Install on 4 Disks :)

Computers Early days:
ZX Spectrum(1982) , HP-150 MS-DOS(1983) , Amstrad CPC464(1984) ,  BBC Micro B+64(1985) , My First PC HP-Vectra(1987)
 

Re: network share drives me mad
« Reply #10 on: January 07, 2015, 08:19:25 AM »
 

greenisland

  • New to Forums
  • *
  • 34
    Posts
  • Reputation: 6
  • Linux Lite Member
    • View Profile
Here is the exact line I am using (I have substituted xxx's but I have verified and reverified that I have typed them correctly):

mount -t cifs -o username=xxx,password=xxxx,uid=xxx,gid=users  //dellserver/c  /mnt/dellserver

When executed from terminal:

sudo mount -t cifs -o username=xxx,password=xxxx,uid=xxx,gid=users  //dellserver/c  /mnt/dellserver

Fails the first time with the error   mount error(5): Input/output error Refer to the mount.cifs(8) manual page (e.g. man mount.cifs)

And then when re-executed EXACTLY the same way, by hitting the up arrow in terminal to execute the same line, it works the second time without any error at all, and the drive is mounted.

But I am finding that putting multiple lines in the rc.local file does not achieve the same thing as executing it twice from terminal. ;-)
« Last Edit: January 07, 2015, 08:21:08 AM by greenisland »
 

Re: network share drives me mad
« Reply #9 on: January 07, 2015, 08:14:26 AM »
 

greenisland

  • New to Forums
  • *
  • 34
    Posts
  • Reputation: 6
  • Linux Lite Member
    • View Profile
Yes, they look very similar when I ping the name vs pinging the IP address.

I wonder if my problem is related to this: 

http://serverfault.com/questions/70762/allowing-a-user-to-mount-a-samba-share-from-fstab

http://www.samba.org/samba/docs/man/manpages-3/mount.cifs.8.html

"It is possible to set the mode for mount.cifs to setuid root to allow non-root users to mount shares to directories for which they have write permission."

share|improve this answer
answered Oct 2 '09 at 14:14

James Curbo
1014
         
Not anymore: bugs.launchpad.net/ubuntu/+source/cifs-utils/+bug/657900 –  Calmarius Feb 22 '13 at 10:23
         
That is only for Ubuntu - Debian has changed its behavior back to setting mount.cifs setuid (see here and here) based on upstream. In any case, it was still possible to set it setuid, just not recommended. –  James Curbo Feb 22 '13 at 17:31


-----------------------------------
And perhaps this explains why the setup I was using with Solydxk in the past (debian) does not work for me in this ubuntu environment?

Unfortunately I do not know what it means to "set the mode for mount.cifs to setuid"
 

Re: network share drives me mad
« Reply #8 on: January 07, 2015, 05:24:22 AM »
 

Wirezfree

  • PayPal Supporter
  • Platinum Level Poster
  • *****
  • 1484
    Posts
  • Reputation: 405
  • Linux Lite "Advocate"
    • View Profile

  • CPU: i7-4790S

  • MEMORY: 16Gb

  • VIDEO CARD: Intel HD4600 (Integrated)
Hi greenisland,

I have recently been through this again on a new LL2.2 install and it worked again for me...
It's baffling why it should work manually on the 2nd run of the manual sudo command.??

First, lets check network connectivity/timing,
try to ping the NAS by IP, then name, see if there are any name resolution/timing issues.?
((use your IP NAS address/name, and a ctrl c to stop the ping))

By I.P
Code: [Select]
dave@asus-mini-1:~$ ping 10.10.100.110
PING 10.10.100.110 (10.10.100.110) 56(84) bytes of data.
64 bytes from 10.10.100.110: icmp_seq=1 ttl=64 time=0.338 ms
64 bytes from 10.10.100.110: icmp_seq=2 ttl=64 time=0.313 ms
64 bytes from 10.10.100.110: icmp_seq=3 ttl=64 time=0.268 ms
^C
--- 10.10.100.110 ping statistics ---
8 packets transmitted, 8 received, 0% packet loss, time 6998ms
rtt min/avg/max/mdev = 0.268/0.306/0.338/0.023 ms
dave@asus-mini-1:~$
Then name
Code: [Select]
dave@asus-mini-1:~$ ping nas1-syn
PING nas1-syn (10.10.100.110) 56(84) bytes of data.
64 bytes from 10.10.100.110: icmp_seq=1 ttl=64 time=0.263 ms
64 bytes from 10.10.100.110: icmp_seq=2 ttl=64 time=0.298 ms
64 bytes from 10.10.100.110: icmp_seq=3 ttl=64 time=0.299 ms
^C
--- nas1-syn ping statistics ---
6 packets transmitted, 6 received, 0% packet loss, time 4998ms
rtt min/avg/max/mdev = 0.263/0.292/0.311/0.019 ms
dave@asus-mini-1:~$

I chopped a bit of the results out to keep post small.
Do both commands work & timings look similar.?

Dave
Upgrades WIP 2.6 to 2.8 - (6 X 2.6 to 2.8 completed on: 20/02/16 All O.K )
Linux Lite 3.0 Humming on a ASRock N3070 Mobo ~ btrfs RAID 10 Install on 4 Disks :)

Computers Early days:
ZX Spectrum(1982) , HP-150 MS-DOS(1983) , Amstrad CPC464(1984) ,  BBC Micro B+64(1985) , My First PC HP-Vectra(1987)
 

 

-->
X Close Ad

Linux Lite 6.6 FINAL Released - Support for 22 Languages Added - See Release Announcement Section