Jump to content

Simple Home Network


Recommended Posts

Hi, I would like to set up my to PC's to be able to access files from one another. One PC is running Debian (sid), the other is running 64studio. They are both connect to a 4 port router. I would like 2 way access, eg, PC1 can access PC2, and PC2 can access PC1. I have followed several NFS Howto's on the subject, they all tell you to set up 1 PC as a server, and one as a client. I have set things up as described, and was able to access the server from the client, but not the client from the server. So, do I need to set each PC up as both server and client to acheive what I want? installing nfs-kernel-server on both?

 

I realize that my not being able to connect from the server to the client may be caused by a myriad of other things, but just thought that it may be reasonable to assume that both would need to be servers as well as clients to allow 2 way access. I have fresh installs of both OS's, and would like some confirmation/help, before I make another attempt.

 

I am by no means a Linux expert, but am not a complete beginner (although closer to beginner than to expert), I have used Mandriva on and off over the last 2 years, and tried several flavours of 'buntu, Suse, PCLinuxOS, Fedora, etc, but have settled with Debian, and 64studio (Debian based), I know only what I need to know to do what I have to, so please keep that in mind.

 

Thanks for your help.

Edited by qandd
Link to comment
Share on other sites

  • Replies 31
  • Created
  • Last Reply

Top Posters In This Topic

just a suggestion,

 

since you already setup the other pc as an nfs server, what if you will create a folder on that PC and make that one folder a repositories of files you want to access on both pc... assuming that you have setup an nfs rw share. On your nfs server, you can access that locally, and from your other end, you can access read and write on that remotely, mounting that just like a local folder, then thats it, you have a folder being access on both machine.. you don't need to create share on both, unless on some circumstances..

 

:D

Link to comment
Share on other sites

Hi, thanks, yes that has been thought of, but I would much prefer to be able to access at will from one PC to another, then I don't have to worry about having files in a certain directory, juggling them around, if I wanted to access a file on the client machine, from the server, I would have to physically go to the client, put the file in the 'repository' then go back to the server and access, much easier just to be able to have access to everything no mater which PC I am at.

 

I don't really know how it functions properly in Linux, it is something that until lately, I have never bothered to try, because I didn't really understand it, and the howto's and guides I read made it seem overly complicated. It was so easy under Windows. But this is not Windows.

 

Oh, and at present I haven't got anything set up for this, I have 2 relatively fresh OS installs, and was waiting for advice before attempting again. I like to keep things as clean as possible, and hate having stuff installed that I don't use or doesn't work, I'm a bit obsessive compulsive like that.

 

Thanks

Link to comment
Share on other sites

hmmn... well, you can configure both the other way around, nfs (server-client / client-server).

 

Another way to access / manage both pc, enable ssh daemon on them, that way, you can remote access on each side.. just enable it

/etc/init.d/sshd start

if not mistaken, it's already enabled by default.

 

then you can access your other pc via konqueror, open it up then at the url, type:

sftp://ip-add-of-other-pc

and it will ask you a username and password, those are the user/passwd of the remote machine.

 

that's another way of accessing/sharing your pc

Link to comment
Share on other sites

Wouldn't it be a lot less messy setting both machines as a client and server? That way you have access to what ever you want to share on either pc. I forget how debian handles this, but it seems logical to me.

 

This is what I want to do, I want to know if that is how it is supposed to be done, as all the howto's I have read only say, 1 PC as server, and 1 PC as client, which suggests to me that you can only access the server from the client, not the client from the server, or something, it confuses me.

 

I have had each set up as both server and client, but still only managed to be able to access PC1 from PC2, and not the other way around. I know this could be caused be many things, but.

 

I guess I really just need to know what is the correct way to achieve what I am after, I want both PC's to be able to access each others files, not just one being able to access the other.

Edited by qandd
Link to comment
Share on other sites

What you are trying to do can be done with mandriva, I do this very same thing myself with three pc's. The only thing to watch out for is that you are not trying to share the same directory back to the server. I tried that by mistake. Other than that no problem. As I said I'm not familiar with how debian does this so I can't comment any further on that one.

Link to comment
Share on other sites

And It would be better if you mount nfs shared folder with automount or autofs, that way, you dont have to make a permanent mount which sometimes can cause the other host to freeze when the nfs-server being accessed is not accessible. I mean with autofs, you can set a time-out so it will released the network mounted drive when being idle for certain period (set) and will re-mount it on demand. Please forgive me, it should be another topic, but sort of related to what you want...

 

just a suggestion though....

Link to comment
Share on other sites

Thank you all, I just thought I would try and make sure I was heading in the direction, doing things correctly before I attempted it again, with your reassurances, and those I got from Debian folk, I feel confidant to proceed. [plus now I have more people to blame when I mess things up :lol2: j/k]

 

Please forgive me, it should be another topic, but sort of related to what you want...

 

No, no, I am glad you mentioned it, something else to look into, and if it helps to avoid problems, all the better, Thank you.

 

I'll go now and try, I'm sure I'll be back with more questions, when PC2 fails to be able to access PC1. [Hows that for confidence]

Link to comment
Share on other sites

Well, I just installed nfs-kernel-server package on both machines, they both already had nfs-common and portmap installed, and then just edited the 'exports', 'hosts', 'hosts.deny' and 'hosts.allow' files, adding the required info, restarted the nfs-kernel-server, and that was it.

 

I also edited the fstab file, so as it would mount the shares automatically, but descided to remove that before I shutdown last night, in favour of mounting them manually, just incase I ran into any such problems as aioshin mentioned above when I booted up today. Still have to look into 'automount or autofs' and what he mentioned in his post.

 

All is not well today though, when I booted up, just as I thought, PC1 could not access PC2. I will however start a new thread for that, seeing how this has been marked solved. [Hope that's ok]

Link to comment
Share on other sites

Hi all, ok, after getting everything working fine yesterday, today when I boot up my 2 PC's, PC2 has access to the share on PC1, but PC1 cannot access the share on PC2. Last night before I shut down everything, all was working fine. [Though I thought that when I booted up today that this would be the case, and I think the problem may be something to do with below]

 

When I go to mount the share, this is what I get, the ****** are of course added be me here,

 

mount.nfs: 64studio:/home/****** failed, reason given by server: Permission denied

 

PC2 has a file in the /etc/media directory called .hal-mtab-lock plus on PC1 the file /etc/mtab does not have an entry for PC2, such as,

 

64studio:/home/****** /media/****** nfs rw,addr=192.168.1.102 0 0

 

but /etc/mtab on PC2, has an entry for PC1,

 

debian:/home/****** /media/****** nfs rw,addr=192.168.1.101 0 0

 

Now if I delete the .hal-mtab-lock file on PC2, and do a /etc/init.d/nfs-kernel-server restart all will be fine, and everything will work as expected, and /etc/mtab on PC1 gets updated with the entry for PC2,

 

64studio:/home/****** /media/****** nfs rw,addr=192.168.1.102 0 0

 

But of course, on next boot, the file /etc/media/.hal-mtab-lock will be back on PC2, and the entry for PC1 in PC2's /etc/mtab will be not there, and I will again get the mount.nfs: 64studio:/home/****** failed, reason given by server: Permission denied error.

 

So, is my assumptions as to the problem correct? and if so how do I fix it?

 

Thanks

Edited by qandd
Link to comment
Share on other sites

What I see is as follows:-

When you close down PC1 before PC2, PC2 does not have indication that PC1 has shutdown and therefore still has an entry (lock) in /etc/mtab and is not unmounted. When you come to reboot PC2, it tries to remount an already mounted network file system. Hence the permission denied.

If you did the opposite and shutdown PC2 first I think you would find the opposite happening.

This is difficult to explain and I don't know how you would get round it. I have to 'unmount' and then 'mount' whichever PC I shutdown last. Otherwise I cannot access whichever PC I shutdown first.

Cor my head is shutting down with this one. :P

Edited by SilverSurfer60
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share


×
×
  • Create New...