LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 07-23-2015, 06:56 AM   #1
sailschooner
LQ Newbie
 
Registered: Jun 2015
Posts: 25

Rep: Reputation: Disabled
network folder alignment


I hope this is a Linux problem, it's a bit mixed. I'm trying to write an output file from a fortran program to another machine on a network so that I can plot the output on one machine, file by file, as the other machine crunches the numbers. One of the machines has W7, the others are Suse 13.1. I am constrained to use the W7 machine for the plots because the linux machines don't run the legacy plot programs I need. So far I can write to a file and pick the data up provided only that its W7 to W7 or linux to linux, in either case the file being on the same output and read machine. I can copy files complete, one by one, across the network manually by drag and drop but I want the output to go straight to another machine as it is generated. It looks to me, the usual Samba problems notwithstanding, that the network is ok as such, w7 and Linux happily integrated etc.

My question then is

None of the combinations of hostnames/filenames seem to work as intended. So e.g. the W7 machine (hostname slave2) filename testfile.dat is written to a folder with”Computer Local Disk Users user Desktop Transfer” across the top and a second program on the W7 can read the data from there. So the W7 machine to this folder works. Ditto the linux version (on machine hostname slave 5) using “file1='/usr/local/lf9561/examples/fortran/Rescued/inputoutput/testfile.dat' works within the linux machine.

But when I change the filename in the linux version to “smb:/slave 2/Computer/Local Disk... etc. it doesn't work. I've tried all the combinations of these titles I can think of and also cifs and a password file but still nix. I think the problem there may be related to the fact that Samba allows access to the Home folder whereas Transfer is written to the Root. I'm very much a networking beginner so I'd be really grateful if someone could just tell me which hostname/filenames to use? I realize that it looks as if I'm going the wrong way, W7 to Linux, whereas eventually I want to transfer in the other direction, but I'm not too bothered by that at the moment. Many thanks, Adrian
 
Old 07-23-2015, 04:05 PM   #2
michaelk
Moderator
 
Registered: Aug 2002
Posts: 15,816

Rep: Reputation: 1784Reputation: 1784Reputation: 1784Reputation: 1784Reputation: 1784Reputation: 1784Reputation: 1784Reputation: 1784Reputation: 1784Reputation: 1784Reputation: 1784
Can your linux PCs see your W7 PCs in the file browser as well vice versa with the W7 PCs in network in its file browser?

Make sure you not using homegroups on your W7 PCs. Homegroup is not compatible with samba. Also make sure the work group name is the same for all computers.

The smb:// is a linux file browser thing but you need to mount the W7 share via cifs.

Try this, you can move the username password options to a credentials file.
//W7/share /mnt/share cifs username=username,password=password,rw,nounix,iocharset=utf8,file_mode=0777,dir_mode=0777 0 0
 
Old 07-23-2015, 06:05 PM   #3
sailschooner
LQ Newbie
 
Registered: Jun 2015
Posts: 25

Original Poster
Rep: Reputation: Disabled
Thanks for the reply. The W7 machine can see and access files on all the linux machines. The linux machine I want to work with (slave 5) can see slave 2 (the W7 machine) (I haven't settled all the samba passwords yet, some of the other machines can see each other immediately, some need a password, some can only see some others) The homegroup is as far as I can tell by-passed, so I can drag, drop files around and open them subject to these limitations easily enough. The machines (slave 2, slave 5) I want to use are quite happy to communicate at this level. It's the actual titles of the files I need to start with. At the moment I can't unravel how to line the files up, what do I need to call the files in the programs. The W7 fortran program saves correctly to "c:\Users\user\Desktop\Transfer\testfile.dat". The linux program which should read it is set to interrogate "smb:slave2\Users\user\Desktop\Transfer/testfile.dat". What should I call this file? As I say for each machine test programs to read these data are happy on that machine. It's the connecting that's the problem. Here are the other programs I think I need:

sambapasswords.txt

username = amoran
password = ********

fstab contains

//smb:slave2/Transfer /root/usr/lf9561/examples/fortran/Rescued/inputoutput cifs auto,gid=users,file_mode=0664,dir_mode=0775,iocharset=iso8859-15,credentials=/etc/sambapasswords.txt 0 0

Do these have the same effect as those you suggest? But the sticking point for me at the moment is how to make sure that the file on one machine is registering at the other.

Many grateful thanks, Adrian
 
Old 07-23-2015, 06:44 PM   #4
michaelk
Moderator
 
Registered: Aug 2002
Posts: 15,816

Rep: Reputation: 1784Reputation: 1784Reputation: 1784Reputation: 1784Reputation: 1784Reputation: 1784Reputation: 1784Reputation: 1784Reputation: 1784Reputation: 1784Reputation: 1784
To "line up" the directory share name for c:\Users\user\Desktop\Transfer\ should match the share name in the fstab file (//server/Transfer) I assume it is Transfer.

The fstab entry should be:

//slave2/Transfer /root/usr/lf9561/examples/fortran/Rescued/inputoutput cifs ...
or
//slave2_IP_address/Transfer /root/usr/lf9561/examples/fortran/Rescued/inputoutput cifs ...

The smb:// is just valid in the linux file browser to access windows PC shares. Typically unless you have slave2's IP address in the /etc/hosts file linux will not find it without using its IP address if not using a local DNS. If slave2 does not have a static address then I suggest setting up a reserved address in your router. Might need to provide more information on your network configuration.

The linux program should read the file from /root/usr/lf9561/examples/fortran/Rescued/inputoutput/testfile.dat However, the program needs to be run as root to access the file /root directory.

Last edited by michaelk; 07-23-2015 at 06:48 PM.
 
Old 07-24-2015, 05:25 PM   #5
sailschooner
LQ Newbie
 
Registered: Jun 2015
Posts: 25

Original Poster
Rep: Reputation: Disabled
Hi. Some progress. I set the fstab up as you said:

//slave2/Transfer /usr/local/lf9561/examples/fortran/Rescued/inputoutput cifs auto,gid=users,file_mode=0664,dir_mode=0775,iocharset=iso8859-15,credentials=/etc/sambapasswords.txt 0 0

I tidied the W7 program, so Testfile.dat is now in Transfer there. It's also visible on all the linux machines, can be opened and examined. It still can't be read by the fortran program though (using 'file1='/usr/local/lf9561/examples/fortran/Rescued/inputoutput/testfile.dat'). Using 'slave2' in fstab has so far returned 'No such file or directory (open, errno=2, unit= 5)' but after changing to '192.168.0.9' it now returns 'Permission denied (open, errno=13, unit= 5)' or hangs.

I notice that the lefthand column in Dolphin shows the IP method and allows me to open it, but won't allow access via the hostname method.

I'm running all this as root. Many thanks, Adrian
 
Old 07-24-2015, 05:36 PM   #6
michaelk
Moderator
 
Registered: Aug 2002
Posts: 15,816

Rep: Reputation: 1784Reputation: 1784Reputation: 1784Reputation: 1784Reputation: 1784Reputation: 1784Reputation: 1784Reputation: 1784Reputation: 1784Reputation: 1784Reputation: 1784
Can you change to /usr/local/lf9561/examples/fortran/Rescued/inputoutput/ via the cd command in a terminal window and see the file (ls)

Post the output of (after you cd to the directory)
ls -l testfile.dat
 
Old 07-24-2015, 06:27 PM   #7
sailschooner
LQ Newbie
 
Registered: Jun 2015
Posts: 25

Original Poster
Rep: Reputation: Disabled
Here it is:

slave5:/usr/local/lf9561/examples/fortran/Rescued/inputoutput # ls -l testfile.dat

-rw-r--r-- 1 root root 0 Jul 24 22:20 testfile.dat

The file is empty though - I think the fortran version creates it if it doesn't already exist, so its not the one on the W7 machine.
 
Old 07-24-2015, 07:21 PM   #8
michaelk
Moderator
 
Registered: Aug 2002
Posts: 15,816

Rep: Reputation: 1784Reputation: 1784Reputation: 1784Reputation: 1784Reputation: 1784Reputation: 1784Reputation: 1784Reputation: 1784Reputation: 1784Reputation: 1784Reputation: 1784
Ok so post the output of the mount command (no options)
 
Old 07-25-2015, 03:35 PM   #9
sailschooner
LQ Newbie
 
Registered: Jun 2015
Posts: 25

Original Poster
Rep: Reputation: Disabled
Hope this is correct - fstab mounts peripherals etc?

slave5:/usr/local/lf9561/examples/fortran/Rescued/inputoutput # mount //192.168.0.9/Transfer /usr/local/lf9561/examples/fortran/Rescued/inputoutput
Password for root@//192.168.0.9/Transfer: ********

Not sure what to leave out, so I cut everything, statement by statement from the right. Each step until this one gave me the mount help/man file. Since this seemed ok, I tried the compiled fortran file:

slave5:/usr/local/lf9561/examples/fortran/Rescued/inputoutput # ./a.out
Permission denied (open, errno=13, unit= 5).
Error occurs at or near line 6 of MAIN__

Thanks, Adrian
 
Old 07-25-2015, 03:42 PM   #10
michaelk
Moderator
 
Registered: Aug 2002
Posts: 15,816

Rep: Reputation: 1784Reputation: 1784Reputation: 1784Reputation: 1784Reputation: 1784Reputation: 1784Reputation: 1784Reputation: 1784Reputation: 1784Reputation: 1784Reputation: 1784
By running the command mount without options you will see all of the filesystems and their mount points. This will verify if //192.168.0.9/Transfer is actually mounted. i.e.

mount (press enter key)
 
Old 07-25-2015, 04:07 PM   #11
sailschooner
LQ Newbie
 
Registered: Jun 2015
Posts: 25

Original Poster
Rep: Reputation: Disabled
Sorry to bother you with another post before you've digested the last. I think that the previous failure may be due to the absence of an a.out file - when I looked at folder inputoutput it seemed to have the data file and no program file. I don't know how that happened. When I recopied them from a USB and recompiled and exec'd, the program hung. Nothing at all. The mount was still in operation so I unmounted and tried again, same result. I also notice that when I open inputoutput via dolphin the header label says "Transfer on 192.168.0.9" rather than "inputoutput" seemingly whether it is mounted or not.

Adrian
 
Old 07-25-2015, 04:10 PM   #12
sailschooner
LQ Newbie
 
Registered: Jun 2015
Posts: 25

Original Poster
Rep: Reputation: Disabled
And "mount" confirms that the folder is mounted.
 
Old 07-25-2015, 04:15 PM   #13
michaelk
Moderator
 
Registered: Aug 2002
Posts: 15,816

Rep: Reputation: 1784Reputation: 1784Reputation: 1784Reputation: 1784Reputation: 1784Reputation: 1784Reputation: 1784Reputation: 1784Reputation: 1784Reputation: 1784Reputation: 1784
Since your running the FORTRAN program as root I'm not sure why it isn't writing the file to /usr/local/lf9561/examples/fortran/Rescued/inputoutput.

Can you successfully
cd /usr/local/lf9561/examples/fortran/Rescued/inputoutput
touch testfile.txt

And verify it exists on the W7 PC.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Hot folder on network graphicsmanx1 Programming 16 11-16-2012 09:29 AM
How to set up public folder/ share folder for my network? Kiwi89 Linux - Server 6 10-31-2011 05:10 AM
Sharing a folder on the network philvd Linux - Newbie 3 06-03-2011 05:54 PM
Mount network folder nodopro Linux - Newbie 17 03-07-2010 07:28 PM
network folder through ssh jani_fedora Linux - Networking 1 03-26-2008 03:50 AM


All times are GMT -5. The time now is 04:20 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration