[SOLVED] network to external HD on PC "A" from second linux mint PC "B"

Connection sharing, Firewall, Samba..etc
Forum rules
Before you post please read how to get help
Post Reply
User avatar
majpooper
Level 5
Level 5
Posts: 916
Joined: Thu May 09, 2013 1:56 pm
Location: North Carolina, USA

[SOLVED] network to external HD on PC "A" from second linux mint PC "B"

Post by majpooper » Thu Sep 05, 2019 5:28 pm

I have looked all over this forum and elsewhere but cannot find a solution of exactly what I want to do with two LM 19.2 PCs
It seems networking has changed somehow in LM 19 so some of the old solutions may not work.

Anyway I have a 3TB external HD off my PC (majpooper) that I use for back up. I want to send backups from my wife's PC (fluffy) to that external HD as well. Again both PCs are on LM 19.3 Cinnamon. I don't need or really want to access anything else between the PCs.
Last edited by majpooper on Thu Sep 12, 2019 3:13 pm, edited 1 time in total.

rene
Level 11
Level 11
Posts: 3713
Joined: Sun Mar 27, 2016 6:58 pm

Re: network to external HD on PC "A" from second linux mint PC "B"

Post by rene » Thu Sep 05, 2019 5:41 pm

The eventually probably best solution is to invest in a NAS that both PCs can access over the network directly, but in the meantime it's going to be easiest to export your wife's disk as an NFS network share, mount it on yours and back it up exactly as you already do local files from your system.

User avatar
majpooper
Level 5
Level 5
Posts: 916
Joined: Thu May 09, 2013 1:56 pm
Location: North Carolina, USA

Re: network to external HD on PC "A" from second linux mint PC "B"

Post by majpooper » Thu Sep 05, 2019 6:31 pm

rene wrote:
Thu Sep 05, 2019 5:41 pm
The eventually probably best solution is to invest in a NAS that both PCs can access over the network directly, but in the meantime it's going to be easiest to export your wife's disk as an NFS network share, mount it on yours and back it up exactly as you already do local files from your system.
NAS of course is the right way to go . . . . . but I'm a cheap-skate and have an External 3T HD in a dock, so . . . . .
I will play around with the NFS network share but it almost may easier (NFS) and cheaper (NAS) just to stick a second external hard drive on her PC. She has one (500Gb) but it is ~75% full with documents and pics that go waaaaay back years which is why I want to move her backups over to the 3T external on my PC.

rene
Level 11
Level 11
Posts: 3713
Joined: Sun Mar 27, 2016 6:58 pm

Re: network to external HD on PC "A" from second linux mint PC "B"

Post by rene » Thu Sep 05, 2019 6:43 pm

Certainly simply plugging the USB drive to her system would work, but note that local networking is UNIX's bread and butter; has only due to the utter crap that is Windows networking/Samba an undeserved reputation for being hard on Linux.

I.e., assume "majpooper" resp. "fluffy" to be 192.168.0.x resp. 192.168.0.y. For convenience, let's make sure they can access each other by name by on both adding to /etc/hosts,

Code: Select all

192.168.0.x	majpooper
192.168.0.y	fluffy
Alternatively, you can use the computer names majpooper.local and fluffy.local without adding anything to /etc/hosts if both have Avahi running but it can be a little flaky.

On "fluffy", sudo apt-get install nfs-kernel-server and export whichever part(s) of its filesystem you want by adding to its /etc/exports e.g.

Code: Select all

/home/fluffy	192.168.0.0/24(ro,async,no_subtree_check,no_root_squash)
Of course "rw" instead of "ro" if fluffy wants to allow majpooper to write to her home directory rather than just read. sudo exportfs -av to have it take effect.

On "majpooper", sudo apt-get install nfs-client, mkdir /mnt/fluffy. To test, manually,

Code: Select all

$ sudo mount fluffy:/home/fluffy /mnt/fluffy
If it mounts on /mnt/fluffy, add to /etc/fstab,

Code: Select all

fluffy:/home/fluffy	/mnt/fluffy	nfs     noauto,user
if you'd like to manually mount it from "majpooper" each time or e.g.

Code: Select all

fluffy:/home/fluffy	/mnt/fluffy	nfs     noauto,x-systemd.automount,x-systemd.mount-timeout=10s,x-systemd.idle-timeout=10m
if you'd like to automount it; have it conceptually available always. Then just backup as e.g. rsync -av --delete /mnt/fluffy /media/majpooper/usbdrive/ or through whichever other backup method you have setup/prefer.

User avatar
majpooper
Level 5
Level 5
Posts: 916
Joined: Thu May 09, 2013 1:56 pm
Location: North Carolina, USA

Re: network to external HD on PC "A" from second linux mint PC "B"

Post by majpooper » Fri Sep 06, 2019 12:20 pm

rene wrote:
Thu Sep 05, 2019 6:43 pm

[/code]
if you'd like to automount it; have it conceptually available always. Then just backup as e.g. rsync -av --delete /mnt/fluffy /media/majpooper/usbdrive/ or through whichever other backup method you have setup/prefer.
OK this looks straight forward - one last question;
Can I put the automount rsync commands in contab (well actually root's crontab)?
something like this

Code: Select all

rsync -zarvh /home/fluffy/ majpooper@192.168.1.29:/media/majpooper/3Tusb/fluffy_bu
So I would delete fluffy_bu then rewriting it a few days or so

rene
Level 11
Level 11
Posts: 3713
Joined: Sun Mar 27, 2016 6:58 pm

Re: network to external HD on PC "A" from second linux mint PC "B"

Post by rene » Fri Sep 06, 2019 6:15 pm

It seems you are now suggesting a different method than through NFS, even though you might in fact like it better.

What I am suggesting/arranging for in the above is for machine "fluffy" to export /home/fluffy over NFS, after which machine "majpooper" would mount it over NFS. The suggested rsync was intended to be run from machine "majpooper", 192.168.1.29 apparently, and was not automount-specific. I.e., once you have machine "fluffy" its /home/fluffy mounted somewhere on machine "majpooper" you can back it up like anything else on machine "majpooper".

You are now however seemingly suggesting to run the backup directly from machine "fluffy" and, yes, that's possible as well, but has then nothing to do anymore with NFS. If user "fluffy" on machine "fluffy" can login on machine "192.168.1.29" simply as ssh majpooper@192.168.1.29 (i.e., you've set up public key authentication) then yes, doing as you suggest would also just work: rsync then uses scp. You can for that route forget anything in the above about NFS.

A detail is the public key authentication (you'd need to use sshpass if you hadn't set that up; not advised) and the user@ bit. Skip for later if not immediately clear but generally it's advisable to have both users available on both machines and with the same UID on either when networking locally (i.e., user "majpooper" being user 1000 on both, user "fluffy" 1001 on both) but if as in this case is expected both user "majpooper" on machine "majpooper" and user "fluffy" on machine "fluffy" are user 1000 there's relatively little issue.

But your reply changes things around a bit then. Sure, if you don't care for NFS, rsync'ing directly from machine "fluffy" to machine "majpooper" via SCP works as well, and if you want to automate the backup on machine "fluffy", it might be a bit easier: you'd not have to be/make sure that machine "fluffy" was up and reachable before backing it up from machine "majpooper".

User avatar
majpooper
Level 5
Level 5
Posts: 916
Joined: Thu May 09, 2013 1:56 pm
Location: North Carolina, USA

Re: network to external HD on PC "A" from second linux mint PC "B"

Post by majpooper » Sat Sep 07, 2019 7:21 pm

rene wrote:
Fri Sep 06, 2019 6:15 pm
It seems you are now suggesting a different method than through NFS, even though you might in fact like it better.
No No I was trying to get too slick and got a bit over my head - I want to stick with NFS.
Once I have, conceptually, /home/fluffy mounted on my machine I can add /home/fluffy to Back-In-Time with my stuff. initially I thought I would rather backup /home/fluffy separately and apart from majpooper. But the more I think it about it that really makes little sense - they are after all separate anyway. It's conceptually no different than backing up a second user on majpooper.

I kind of got out there in left field - should have thought this through a little more.
Thx for getting me straightened out again

User avatar
majpooper
Level 5
Level 5
Posts: 916
Joined: Thu May 09, 2013 1:56 pm
Location: North Carolina, USA

Re: network to external HD on PC "A" from second linux mint PC "B"

Post by majpooper » Wed Sep 11, 2019 12:09 pm

rene wrote:
Thu Sep 05, 2019 6:43 pm
Certainly simply plugging the USB drive to her system would work, but note that local networking is UNIX's bread and butter; has only due to the utter crap that is Windows networking/Samba an undeserved reputation for being hard on Linux.

I.e., assume "majpooper" resp. "fluffy" to be 192.168.0.x resp. 192.168.0.y. For convenience, let's make sure they can access each other by name by on both adding to /etc/hosts,

Code: Select all

192.168.0.x	majpooper
192.168.0.y	fluffy
Alternatively, you can use the computer names majpooper.local and fluffy.local without adding anything to /etc/hosts if both have Avahi running but it can be a little flaky.
I can add majpooper to fluffy and the other way around but can not add them to their respective host files as they already exsist @ 127.0.1.1 I believe from the PiHole DNS configuration ?????? I think anyway.

Both majpooper and fluffy have avahi running but I don't know where to add majpooper.local and fluffy.local - so that might help

fluffy does mount and I can see it in /media/majpooper but there is nothing there - just an empty file folder

Code: Select all

127.0.0.1	localhost
127.0.1.1	majpooper
192.168.46.105  fluffy

# The following lines are desirable for IPv6 capable hosts
::1     ip6-localhost ip6-loopback
fe00::0 ip6-localnet
ff00::0 ip6-mcastprefix
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters
Here is the result of running rsync -av --delete /mnt/fluffy /media/majpooper/

Code: Select all

$ rsync -av --delete /mnt/fluffy /media/majpooper/
sending incremental file list

sent 57 bytes  received 17 bytes  148.00 bytes/sec
total size is 0  speedup is 0.00

rene
Level 11
Level 11
Posts: 3713
Joined: Sun Mar 27, 2016 6:58 pm

Re: network to external HD on PC "A" from second linux mint PC "B"

Post by rene » Wed Sep 11, 2019 1:00 pm

When using an actual LAN it's usually in fact better to map the hostnames to the LAN IP; to e.g. change

Code: Select all

127.0.1.1	majpooper
192.168.46.105	fluffy
to

Code: Select all

192.168.1.29	majpooper
192.168.46.105	fluffy
on both. There is something weird here though; you earlier mentioned/implied 192.168.1.29 as machine majpooper's LAN IP. The expectation would then be that machine "fluffy" would have a LAN IP also of the form 192.168.1.x, or conversely, that if machine "fluffy" is 192.168.46.105, that machine "majpooper" would be 192.168.46.x. The 192.168.x.y networks are so-called class C IP networks in which hosts differ only in the last octet; the part after the last period.

Although the /etc/hosts stuff itself isn't all that important --- it's just a convenience thing so as to be able to address the machines by name rather than IP --- that network bit is in fact important so will need to be clarified.

I shall for now assume both machines to have 192.168.46.x addresses. In that case I take it that machine "fluffy" has now indeed had nfs-kernel-server installed, her /etc/exports edited to e.g.

Code: Select all

/home/fluffy	192.168.46.0/24(ro,async,no_subtree_check,no_root_squash)
and said export activated by sudo exportfs -av. This of course assumes that /home/fluffy is in fact the directory on machine "fluffy" that you wish to export over NFS.

Machine "majpooper" is assumed to have had nfs-client installed and the mountpount /mnt/fluffy created. It's not clear what you are referring to with "it" in /media/majpooper; the above had you mount it on /mnt/fluffy rather then under /media/majpooper. So, what happens on machine "majpooper" after

Code: Select all

$ sudo mount fluffy:/home/fluffy /mnt/fluffy
Any output? ls -l /mnt/fluffy on machine "majpooper" does not show machine fluffy's /home/fluffy? When nothing mounts certainly the rsync would have nothing to do indeed.

By the way... for now the directly above is the only bit where you in fact use "fluffy" as a machine name, i.e., that for which I wanted you to use the /etc/hosts file. You can as mentioned also (if "fluffy" is the actual hostname of machine "fluffy") just say

Code: Select all

$ sudo mount fluffy.local:/home/fluffy /mnt/fluffy
without needing to add anything to /etc/hosts if both systems have Avahi running and responsive; that last bit I have found to be a fairly frequent issue but YMMV.

In any case:

1. What's up with the 192.168.1.x or 192.168.46.x?
2. Preferebly be a bit more explicit about what you are in fact typing in, on which machine, where, and what the system responds with.

I'm afraid I have to be away; pardon if the next reply takes a day.

User avatar
majpooper
Level 5
Level 5
Posts: 916
Joined: Thu May 09, 2013 1:56 pm
Location: North Carolina, USA

Re: network to external HD on PC "A" from second linux mint PC "B"

Post by majpooper » Wed Sep 11, 2019 3:24 pm

rene wrote:
Wed Sep 11, 2019 1:00 pm
1. What's up with the 192.168.1.x or 192.168.46.x?
2. Preferebly be a bit more explicit about what you are in fact typing in, on which machine, where, and what the system responds with.

I'm afraid I have to be away; pardon if the next reply takes a day.
I really don't know where the 192.168.29.x came from I set my network to 192.168.46.x
The actual host names are hp700 which the user is fluffy 192.168.46.105
1150z which the user is majpooper 192.168.46.`09

I thought to keep the naming confusion down and since I refereed to the PCs as fluffy and majpooper (actuallu user names) I edited my replies to reflect same. Bad idea I see now as it through you a curve ball.

So my PC in reality is user majpooper ( host name 1150z) etc/hosts actually looks like this - wife's PC is user fluffy (host name hp700) looks the same as mine except with the following
127.0.1.1 hp700
192.168.46.109 1150z

Code: Select all

127.0.0.1	localhost
127.0.1.1	1150z
192.168.46.105  hp700

# The following lines are desirable for IPv6 capable hosts
::1     ip6-localhost ip6-loopback
fe00::0 ip6-localnet
ff00::0 ip6-mcastprefix
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters
fluffy appears in both /mnt and /media/majpooper

Code: Select all

majpooper@1150z:~$ ls -l /mnt/fluffy
total 0
majpooper@1150z:~$ cd /mnt
majpooper@1150z:/mnt$ ls
fluffy

majpooper@1150z:/media/majpooper$ ls
 USB3T  fluffy  PC_TWEAKS
Tried using hp700 rather than fluffy

Code: Select all

majpooper@1150z:~$ sudo mount fluffy:/home/hp700  /mnt/fluffy
[sudo] password for majpooper:           
mount.nfs: Failed to resolve server fluffy: Name or service not known

User avatar
majpooper
Level 5
Level 5
Posts: 916
Joined: Thu May 09, 2013 1:56 pm
Location: North Carolina, USA

Re: network to external HD on PC "A" from second linux mint PC "B"

Post by majpooper » Wed Sep 11, 2019 3:44 pm

here are the outputs from fluffy (hp700)

Code: Select all

fluffy@hp700:~$ sudo exportfs -av
[sudo] password for fluffy:           
exporting 192.168.46.105/24:/home/fluffy
fluffy@hp700:~$ sudo apt-get install nfs-kernel-server
Reading package lists... Done
Building dependency tree       
Reading state information... Done
nfs-kernel-server is already the newest version (1:1.3.4-2.1ubuntu5.2).
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.

etc/hosts
127.0.0.1	localhost
127.0.1.1	hp700
192.168.46.109  1150z 


# The following lines are desirable for IPv6 capable hosts
::1     ip6-localhost ip6-loopback
fe00::0 ip6-localnet
ff00::0 ip6-mcastprefix
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters


# /etc/exports: the access control list for filesystems which may be exported
#		to NFS clients.  See exports(5).
#
# Example for NFSv2 and NFSv3:
# /srv/homes       hostname1(rw,sync,no_subtree_check) hostname2(ro,sync,no_subtree_check)
#
# Example for NFSv4:
# /srv/nfs4        gss/krb5i(rw,sync,fsid=0,crossmnt,no_subtree_check)
# /srv/nfs4/homes  gss/krb5i(rw,sync,no_subtree_check)
#
/home/fluffy	192.168.46.105/24(rw,async,no_subtree_check,no_root_squash)

rene
Level 11
Level 11
Posts: 3713
Joined: Sun Mar 27, 2016 6:58 pm

Re: network to external HD on PC "A" from second linux mint PC "B"

Post by rene » Thu Sep 12, 2019 4:35 am

majpooper wrote:
Wed Sep 11, 2019 3:24 pm
I really don't know where the 192.168.29.x came from I set my network to 192.168.46.x
As to where it came from in this particular conversation, that was from viewtopic.php?p=1684590#p1682092 but never mind then.

The (not all that) important bit is that you can from hp700 address 1150z by name and vice versa; your current /etc/hosts files should allow you to do that: try ping -c3 1150z from hp700 and conversely ping -c3 hp700 from 1150z to confirm. And in fact, given that your IP addresses look DHCP-assigned (i.e., not necessarily stable) using the .local thing may be better for you if it works for you: try ping -c3 1150z.local from hp700 and conversely ping -c3 hp700.local from 1150z.

And please note that none of this is in fact about NFS yet; I just wanted you to set that up as a convenience thing only; using literal 192.168.46.109 instead of machine-name 1150z and 192.168.46.105 instead of machine-name hp700 would work as well. As such please also ignore the next sentence, but if you'd want to make life easier on yourself, you'd keep both machines retrieving their IP address through DHCP as now but configure your router to always hand out the same IP address to the same MAC-address and then give both ("all machines on your LAN") the same /etc/hosts file listing both machines under that now in practice "static" IP address. By far the largest Just Works factor --- but once again, feel for now free to not bother, assuming either of the ping tests above was successful.

Now then as to NFS. One odd/bad thing:
majpooper wrote:
Wed Sep 11, 2019 3:44 pm
here are the outputs from fluffy (hp700)

Code: Select all

fluffy@hp700:~$ sudo exportfs -av
[sudo] password for fluffy:           
exporting 192.168.46.105/24:/home/fluffy
Although there isn't in fact a functional difference you rather want 192.168.46.0/24 rather than 192.168.46.105/24; want to have hp700 export its /home/fluffy to any system with IP address 192.168.46.x. If you insist on exporting it only to 1150z you should moreover use address 192.168.46.109 rather than 105 and netmask 32 rather than 24: 192.168.46.109/32 (or "1150z/32" -- see how names are more convenient?). In any case, just make it be 192.168.46.0/24.
majpooper wrote:
Wed Sep 11, 2019 3:24 pm

Code: Select all

majpooper@1150z:~$ sudo mount fluffy:/home/hp700  /mnt/fluffy
[sudo] password for majpooper:           
mount.nfs: Failed to resolve server fluffy: Name or service not known
Nice one; you use the user name where you should the machine name and the machine name where you should the user name :) I.e., the syntax is sudo mount machine:export /mnt/point, more specifically,

Code: Select all

sudo mount hp700:/home/fluffy /mnt/fluffy
or

Code: Select all

sudo mount hp700.local:/home/fluffy /mnt/fluffy
or

Code: Select all

sudo mount 192.168.46.105:/home/fluffy /mnt/fluffy
If at that point still nothing mounts on /mnt/fluffy on 1150z that would be unexpected. Assuming it does, this concludes the NFS part.

Unfortunately we then still seem to have a next, final part to deal with, the rsync one. A directory "fluffy" existing in /media/majpooper on 1150z is due simply to the by you executed command rsync -av --delete /mnt/fluffy /media/majpooper/: it just faithfully copied the empty directory "fluffy" from under /mnt to under /media/majpooper. As originally advised, you'd rather use

Code: Select all

rsync -av --delete /mnt/fluffy /media/majpooper/usbdrive/
in which of course "usbdrive" is the actual mount point under /media/majpooper of your USB drive that you aim to backup to; don't miss the trailing slash, and just look in /media/majpooper to see what that actual mount point is; if you haven't explicitly labelled the USB drive it's usually a long UUID.

The rsync command was moreover a mere suggestion; if you have another, preferred method of backing up your own files from 1150z already be free to once hp700's /home/fluffy is mounted on 1150z's /mnt/fluffy use that method to backup /mnt/fluffy as well.

User avatar
majpooper
Level 5
Level 5
Posts: 916
Joined: Thu May 09, 2013 1:56 pm
Location: North Carolina, USA

Re: network to external HD on PC "A" from second linux mint PC "B"

Post by majpooper » Thu Sep 12, 2019 12:13 pm

rene wrote:
Thu Sep 12, 2019 4:35 am

Now then as to NFS. One odd/bad thing:

Code: Select all

fluffy@hp700:~$ sudo exportfs -av
[sudo] password for fluffy:           
exporting 192.168.46.105/24:/home/fluffy
rene wrote:
Thu Sep 12, 2019 4:35 am

Although there isn't in fact a functional difference you rather want 192.168.46.0/24 rather than 192.168.46.105/24; want to have hp700 export its /home/fluffy to any system with IP address 192.168.46.x. If you insist on exporting it only to 1150z you should moreover use address 192.168.46.109 rather than 105 and netmask 32 rather than 24: 192.168.46.109/32 (or "1150z/32" -- see how names are more convenient?). In any case, just make it be 192.168.46.0/24.
I fixed hp700 to 192.168.46.0/24

Code: Select all

fluffy@hp700:~$ sudo exportfs -av
[sudo] password for fluffy:           
exporting 192.168.46.0/24:/home/fluffy



# /etc/exports: the access control list for filesystems which may be exported
#		to NFS clients.  See exports(5).
#
# Example for NFSv2 and NFSv3:
# /srv/homes       hostname1(rw,sync,no_subtree_check) hostname2(ro,sync,no_subtree_check)
#
# Example for NFSv4:
# /srv/nfs4        gss/krb5i(rw,sync,fsid=0,crossmnt,no_subtree_check)
# /srv/nfs4/homes  gss/krb5i(rw,sync,no_subtree_check)
#
/home/fluffy	192.168.46.0/24(rw,async,no_subtree_check,no_root_squash)
I commented out fstab, at least for now - it was wrong anyway but I think I corrected it to reflect the machine name properly.
Not that I will need to use fstab as it turns out becuase if I understand correctly I can backup directly from /mnt to my 3T USB via Back-in-Time.

The problem is I still can not /home/fluffy to /mnt/fluffy
I also re-ran

Code: Select all

sudo apt-get install nfs-client, mkdir /mnt/fluffy
just to ensure that everything was kosher and I didn't miss a step.
I tried mounting /home/fluffy a couple of ways but - no joy.

Code: Select all

majpooper@1150z:~$ sudo mount 192.168.46.105:/home/fluffy /mnt/fluffy
mount.nfs: Connection timed out
majpooper@1150z:~$ sudo apt-get install nfs-client
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Note, selecting 'nfs-common' instead of 'nfs-client'
nfs-common is already the newest version (1:1.3.4-2.1ubuntu5.2).
The following packages were automatically installed and are no longer required:
  linux-headers-4.15.0-58 linux-headers-4.15.0-58-generic
  linux-image-4.15.0-58-generic linux-modules-4.15.0-58-generic
  linux-modules-extra-4.15.0-58-generic
Use 'sudo apt autoremove' to remove them.
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
majpooper@1150z:~$ mkdir /mnt/fluffy
mkdir: cannot create directory ‘/mnt/fluffy’: File exists
majpooper@1150z:~$ sudo mount hp700.local:/home/fluffy /mnt/fluffy
mount.nfs: Connection timed out

rene
Level 11
Level 11
Posts: 3713
Joined: Sun Mar 27, 2016 6:58 pm

Re: network to external HD on PC "A" from second linux mint PC "B"

Post by rene » Thu Sep 12, 2019 12:44 pm

majpooper wrote:
Thu Sep 12, 2019 12:13 pm

Code: Select all

majpooper@1150z:~$ sudo mount 192.168.46.105:/home/fluffy /mnt/fluffy
mount.nfs: Connection timed out
Does ping 192.168.46.105 work? Do you have a firewall enabled on either machine? If yes, sigh. Firewalls on a LAN and certainly behind a NAT router are not in any way worth their trouble on Linux; defend against nothing but you yourself contacting your own machines. You'd need to disable the dumb thing(s) or at the very least allow NFS through. I'll leave how to do latter up to you...

User avatar
majpooper
Level 5
Level 5
Posts: 916
Joined: Thu May 09, 2013 1:56 pm
Location: North Carolina, USA

[SOLVED] Re: network to external HD on PC "A" from second linux mint PC "B"

Post by majpooper » Thu Sep 12, 2019 1:04 pm

rene wrote:
Thu Sep 12, 2019 12:44 pm
majpooper wrote:
Thu Sep 12, 2019 12:13 pm

Code: Select all

majpooper@1150z:~$ sudo mount 192.168.46.105:/home/fluffy /mnt/fluffy
mount.nfs: Connection timed out
Does ping 192.168.46.105 work? Do you have a firewall enabled on either machine? If yes, sigh. Firewalls on a LAN and certainly behind a NAT router are not in any way worth their trouble on Linux; defend against nothing but you yourself contacting your own machines. You'd need to disable the dumb thing(s) or at the very least allow NFS through. I'll leave how to do latter up to you...
HOOOAH!
Yep, it was the firewall
Thank you, thank you, thank you
I am good2go

rene
Level 11
Level 11
Posts: 3713
Joined: Sun Mar 27, 2016 6:58 pm

Re: network to external HD on PC "A" from second linux mint PC "B"

Post by rene » Thu Sep 12, 2019 1:23 pm

Great, and apologies for the slightly grumpy tone of the above; I fundamentally deeply despise "secuwity" horsesh... things.

Your last message did still suggest you wouldn't need to add anything to /etc/fstab. If you care to manually mount each time, that's of course true, but I'd still suggest for 1150z's /etc/fstab a line of the form:

Code: Select all

hp700:/home/fluffy	/mnt/fluffy	nfs     noauto,x-systemd.automount,x-systemd.mount-timeout=10s,x-systemd.idle-timeout=10m
or, again, "hp700.local" or "192.168.46.105" instead of "hp700" if needed/desired. After a reboot of 1150z this would have /mnt/fluffy automagically available when in fact accessed.

In the case of "hp700" added to /etc/hosts or "192.168.46.105" you should of course note that that IP address would need to remain the same for the setup to remain stable. In that sense, now see that bit above somewhere where I said it pays to configure your router to give the same IP address to the same machine (as identified by its network interface's MAC address) each time. It'll be found in the router's DHCP setup section.

User avatar
majpooper
Level 5
Level 5
Posts: 916
Joined: Thu May 09, 2013 1:56 pm
Location: North Carolina, USA

Re: network to external HD on PC "A" from second linux mint PC "B"

Post by majpooper » Thu Sep 12, 2019 3:11 pm

rene wrote:
Thu Sep 12, 2019 1:23 pm
Great, and apologies for the slightly grumpy tone of the above; I fundamentally deeply despise "secuwity" horsesh... things.

Your last message did still suggest you wouldn't need to add anything to /etc/fstab. If you care to manually mount each time, that's of course true, but I'd still suggest for 1150z's /etc/fstab a line of the form:

Code: Select all

hp700:/home/fluffy	/mnt/fluffy	nfs     noauto,x-systemd.automount,x-systemd.mount-timeout=10s,x-systemd.idle-timeout=10m
or, again, "hp700.local" or "192.168.46.105" instead of "hp700" if needed/desired. After a reboot of 1150z this would have /mnt/fluffy automagically available when in fact accessed.

In the case of "hp700" added to /etc/hosts or "192.168.46.105" you should of course note that that IP address would need to remain the same for the setup to remain stable. In that sense, now see that bit above somewhere where I said it pays to configure your router to give the same IP address to the same machine (as identified by its network interface's MAC address) each time. It'll be found in the router's DHCP setup section.
Grumpy?? not that I noticed - anyway I'm the one who should apologise for throwing you a few curve balls along the way.

I would rather it mounted automatically so I added your suggested input for fstab.
All my IP addresses are static - I mainly did it for network printer access but then did it for everything on my LAN long ago.

THX much again

Post Reply

Return to “Other networking topics”