LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
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 03-05-2010, 01:57 AM   #1
nodopro
Member
 
Registered: Oct 2008
Posts: 48

Rep: Reputation: 16
Mount network folder


How do I mount a folder from different server in the same network? For instance, I have a server named A having IP=192.168.1.1 and a server B having IP=192.168.1.2. I try this command from server A but it does not work. Do I have to install samba in order to mount network folder? Please help. Thanks in advance.

Code:
mount //192.168.1.2/test /test/
 
Old 03-05-2010, 02:01 AM   #2
evo2
LQ Guru
 
Registered: Jan 2009
Location: Japan
Distribution: Mostly Debian and Scientific Linux
Posts: 5,753

Rep: Reputation: 1288Reputation: 1288Reputation: 1288Reputation: 1288Reputation: 1288Reputation: 1288Reputation: 1288Reputation: 1288Reputation: 1288
You will need the samba file system. In Debian this is packaged as "smbfs". Then you should be able to mount with something like

Code:
mount -t cifs //192.168.1.2/test /test/
Evo2.
 
Old 03-05-2010, 02:06 AM   #3
propofol
Member
 
Registered: Nov 2007
Location: Seattle
Distribution: Debian Wheezy & Jessie; Ubuntu
Posts: 331

Rep: Reputation: 59
Try:

Code:
mkdir /mnt/test
mount -t cifs -o 'username=smbuser,password=whatever,rw,uid=loginname,gid=loginname' //192.168.1.2/test /mnt/test
Older version is: -t smbfs

Regards,
Stefan
 
Old 03-05-2010, 02:08 AM   #4
nodopro
Member
 
Registered: Oct 2008
Posts: 48

Original Poster
Rep: Reputation: 16
Thanks for quick reply evo2 and propofol. Do I need to install samba on both system?
 
Old 03-05-2010, 02:19 AM   #5
Sayan Acharjee
Member
 
Registered: Feb 2010
Location: Chennai, India
Distribution: Manjaro
Posts: 616

Rep: Reputation: 64
@ nodopro, I think you should configure nfs in server B to mount a specific folder from the 'B' server.

In the 'B' server, open /etc/exports and add the following line:

Quote:
foldername_with_absolute_path 192.168.1.0/24(ro,sync)
then start both nfs and portmap service.

Now from server A issue the follwing command:

Quote:
mount 192.168.1.2:foldername_with_absolute_path /mnt
Regards.....
 
Old 03-05-2010, 03:17 AM   #6
nodopro
Member
 
Registered: Oct 2008
Posts: 48

Original Poster
Rep: Reputation: 16
Quote:
Originally Posted by sayan_acharjee View Post
@ nodopro, I think you should configure nfs in server B to mount a specific folder from the 'B' server.

In the 'B' server, open /etc/exports and add the following line:

then start both nfs and portmap service.

Now from server A issue the follwing command:

Regards.....
Work great as following your instruction. However, try to add mount automatically each time the system starts up but does not work. You know what I did wrong?

under /etc/fstab
Code:
server-B:/test /test nfs
 
Old 03-05-2010, 03:24 AM   #7
evo2
LQ Guru
 
Registered: Jan 2009
Location: Japan
Distribution: Mostly Debian and Scientific Linux
Posts: 5,753

Rep: Reputation: 1288Reputation: 1288Reputation: 1288Reputation: 1288Reputation: 1288Reputation: 1288Reputation: 1288Reputation: 1288Reputation: 1288
Quote:
Originally Posted by nodopro View Post
Thanks for quick reply evo2 and propofol. Do I need to install samba on both system?
The machine 192.168.1.2 has to have a configured samba server otherwise there is nothing to mount. Have you not set this up?

The client needs to have smbfs, but no samba server.

Evo2.

PS. As pointed out by another poster you could use nfs instead of samba.
 
Old 03-05-2010, 03:25 AM   #8
i92guboj
Gentoo support team
 
Registered: May 2008
Location: Lucena, Córdoba (Spain)
Distribution: Gentoo
Posts: 4,063

Rep: Reputation: 381Reputation: 381Reputation: 381Reputation: 381
Lines in fstab have six fields (separated by either spaces or tabs), and it's important that they have exactly six. That line has only three.

Check the fstab man page.
 
Old 03-05-2010, 04:05 AM   #9
nodopro
Member
 
Registered: Oct 2008
Posts: 48

Original Poster
Rep: Reputation: 16
Quote:
Originally Posted by i92guboj View Post
Lines in fstab have six fields (separated by either spaces or tabs), and it's important that they have exactly six. That line has only three.

Check the fstab man page.
Thanks for suggestion.

Code:
server-B:/test /test nfs defaults 0 0
still does not work. Any other suggestion?
 
Old 03-05-2010, 04:06 AM   #10
Sayan Acharjee
Member
 
Registered: Feb 2010
Location: Chennai, India
Distribution: Manjaro
Posts: 616

Rep: Reputation: 64
@nodopro, try this line:
Quote:
server-B:/test /test nfs rsize=8192,wsize=8192,timeo=14,intr

more help:
http://www.redhat.com/docs/manuals/l...nfs-mount.html

Last edited by Sayan Acharjee; 03-05-2010 at 04:11 AM.
 
Old 03-05-2010, 04:38 AM   #11
i92guboj
Gentoo support team
 
Registered: May 2008
Location: Lucena, Córdoba (Spain)
Distribution: Gentoo
Posts: 4,063

Rep: Reputation: 381Reputation: 381Reputation: 381Reputation: 381
Quote:
Originally Posted by nodopro View Post
Thanks for suggestion.

Code:
server-B:/test /test nfs defaults 0 0
still does not work. Any other suggestion?
What's the error message?

When you have a line like that on fstab, you should be able to mount the relevant fs by doing just

Code:
mount /test
What does mount say if you do so?
 
Old 03-05-2010, 05:15 AM   #12
Absent Minded
Member
 
Registered: Nov 2007
Location: Washington State U.S.A.
Distribution: Debian testing
Posts: 74

Rep: Reputation: 21
to mount an nfs share on my network I use something like this:
192.168.0.186:/mnt/share /mnt/ISO nfs rw 0 0

I am using Debian so i don't know if that makes a differance. I do know that it is important that the tabs be used to seperate things as my fstab file refused to load my share on boot without them. I hope this helps.

AM
 
Old 03-05-2010, 10:21 AM   #13
nodopro
Member
 
Registered: Oct 2008
Posts: 48

Original Poster
Rep: Reputation: 16
Quote:
Originally Posted by i92guboj View Post
What's the error message?

When you have a line like that on fstab, you should be able to mount the relevant fs by doing just

Code:
mount /test
What does mount say if you do so?
Oh I got it now. Eventhough I have those lines setup in fstab file, I have to manually type mount /test in order to get folder mounted. I thought if I have those lines in fstab file, it automatically mount every time the system boot up.
 
Old 03-05-2010, 10:25 AM   #14
i92guboj
Gentoo support team
 
Registered: May 2008
Location: Lucena, Córdoba (Spain)
Distribution: Gentoo
Posts: 4,063

Rep: Reputation: 381Reputation: 381Reputation: 381Reputation: 381
Quote:
Originally Posted by nodopro View Post
Oh I got it now. Eventhough I have those lines setup in fstab file, I have to manually type mount /test in order to get folder mounted. I thought if I have those lines in fstab file, it automatically mount every time the system boot up.
That depends on your distro. In Gentoo which is what I use you need to enable a service called "nfsmount" at bootup for that. In yours it should be something similar, though the way to configure the boot services will vary from distro to distro.
 
Old 03-05-2010, 11:21 AM   #15
nodopro
Member
 
Registered: Oct 2008
Posts: 48

Original Poster
Rep: Reputation: 16
I am using Fedora 10. Yes I have nfs service turn on but I don't see nfsmount service. I follow this link
Code:
http://www.techotopia.com/index.php/Sharing_Fedora_Linux_Folders_with_Remote_Linux_and_UNIX_Systems
 
  


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
Mount folder on samba network HDD miros84 Linux - Software 2 12-16-2009 03:39 PM
How to mount folder in network with samba? miros84 Linux - Software 16 09-04-2009 05:42 PM
Best way to mount linux folder in windows through network brgsousa Linux - Software 2 11-06-2008 10:43 AM
Mount folder on local network Paris Heng Linux - Newbie 2 05-04-2008 11:00 AM
Mount Network Location to Folder Cottsay General 1 01-31-2007 12:52 PM


All times are GMT -5. The time now is 11:04 AM.

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