Best way to "mount" a debian server on another one? Need to share storage

alfa147x

Lifer
Jul 14, 2005
29,307
106
106
What is the best way for me to mount the hard drive space of a server onto another one?

I have one where most of the activity takes place and then another that is mostly empty but has a lot more space. I need to connect the two for 2 or so weeks.

Both are running Debian “wheezy” with no GUI.

Thanks for the help!
Alfa
 

Red Squirrel

No Lifer
May 24, 2003
70,182
13,576
126
www.anyf.ca
You can lookup NFS or iSCSI. NFS is probably more what you want. It's sorta like windows file sharing, to put it in simple terms. Of course, there's always Samba if you want to do actual windows file sharing but for Linux to Linux NFS is probably the preferred method.
 

alfa147x

Lifer
Jul 14, 2005
29,307
106
106
Okay That's what I thought. So I setup an NFS Export on the file server but on the client I can't get it to connect. I think I don't quite understand how a user is authenticated.

On the client I tried:
Code:
mount 198.xx.xxx.xx:/Remote /root/Remote
that gets me no where

On the server I tried:
Code:
root@files:~# mount --bind /Remote /export/remote
root@files:~# showmount -e 127.0.0.1
clnt_create: RPC: Program not registered

I think I'm missing one key peice to undertanding how NFS should work. Once I understand it I should be able to figure out my issue.

Thanks for the help.
Alfa
 

Red Squirrel

No Lifer
May 24, 2003
70,182
13,576
126
www.anyf.ca
NFS authentication is kinda primitive. I've been reading up on it myself, but seems the only way to have something actually secure is to use Kerberos. Otherwise the way it works is by IP and by userID/guserID. That basically means anyone who has access to that network can setup the same IP on their own computer and make a user/group with matching IDs (would require some trial and error) and gain access to everything.

As for your issues what's your /etc/exports look like? Also I'm using mount.nfs to mount, I don't know if that makes a difference.

mount.nfs -v server.loc:/path/on/server /path/on/client/
 

themillak

Member
Feb 2, 2011
120
0
0
i can never remember the mount.nfs command so I add it to my fstab:

192.168.123.140:/media/USBdrive/ /media/USBdrive nfs rw,noauto,user 0 0

noauto=when i reboot my laptop away from home it doesn't hang for 5 minutes trying to connect
user=i can mount it, don't need to "sudo mount -a" when I get home.
 

alfa147x

Lifer
Jul 14, 2005
29,307
106
106
NFS authentication is kinda primitive. I've been reading up on it myself, but seems the only way to have something actually secure is to use Kerberos. Otherwise the way it works is by IP and by userID/guserID. That basically means anyone who has access to that network can setup the same IP on their own computer and make a user/group with matching IDs (would require some trial and error) and gain access to everything.

As for your issues what's your /etc/exports look like? Also I'm using mount.nfs to mount, I don't know if that makes a difference.

Hmm. I'll have to look into Kerberos. These two servers are not on the same network.

Thanks for the help. I'll post /etc/exports when I get home.

i can never remember the mount.nfs command so I add it to my fstab:

192.168.123.140:/media/USBdrive/ /media/USBdrive nfs rw,noauto,user 0 0

noauto=when i reboot my laptop away from home it doesn't hang for 5 minutes trying to connect
user=i can mount it, don't need to "sudo mount -a" when I get home.

with noauto do you still have to trigger the mount? I'm a bit confused as to what it's not doing automatically.

Thanks!
 

themillak

Member
Feb 2, 2011
120
0
0
i actually don't remember. I have the line commented out actually, i replaced that machine with a raspberry pi about 6 months ago, never fully removed the line. i assume it would just not auto-mount, rather than try to mount and fail in seconds rather than minutes.

http://linux.die.net/man/5/fstab said:
The fourth field, (fs_mntops), describes the mount options associated with the filesystem.

It is formatted as a comma separated list of options. It contains at least the type of mount plus any additional options appropriate to the filesystem type. For documentation on the available options for non-nfs file systems, see mount(8). For documentation on all nfs-specific options have a look at nfs(5). Common for all types of file system are the options ''noauto'' (do not mount when "mount -a" is given, e.g., at boot time), ''user'' (allow a user to mount), and ''owner'' (allow device owner to mount), and ''comment'' (e.g., for use by fstab-maintaining programs). The ''owner'' and ''comment'' options are Linux-specific. For more details, see mount(8).

I have smb for my wife's windows computer so i've been lazily using that more than not lately. based on my fstab line, i assume my command would've had to be "mount /media/USBdrive" but i think "mount -a" should still work, it just gets skipped at boot.
 

alfa147x

Lifer
Jul 14, 2005
29,307
106
106
I got it to work. Looks like I didn't install portmap but everything looks good. I just need to have the file server setup the mounts on boot.

Thanks!