aspose file tools*
The moose likes Linux / UNIX and the fly likes mount one linux drive to another linux machine. Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » Linux / UNIX
Bookmark "mount one linux drive to another linux machine." Watch "mount one linux drive to another linux machine." New topic
Author

mount one linux drive to another linux machine.

Kevin P Smith
Ranch Hand

Joined: Feb 18, 2005
Posts: 362
Hi guys,

I need to mount a drive from one Linux server to another, I tried:

mount <servername>:/home/user/apps/tomcat/webapps/myApp/images /home/user/tomcat/webapps/myApps/images

but I get the following error:-
mount: Wrong fs type, bad option, bad superblock on <server> missing codepage or helper program, or other error
(for several filesystems (e.g nfs, cifs) you might need a /sbin/mount.<type> helper program)
In some cases useful info is found in syslog - try dmesg | tail or so
Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 16055
    
  21

There are several ways to mount remote filesystems, including the Windows-compatible Samba version and Sun's Unix NFS system.

The mount syntax you are using is NFS style. That means that you need to have exported the drive you want to share out by defining an entry in the owning machine's /etc/exports file, starting that machine's NFS server, and ensuring that it isn't blocked by the firewall. And NFS can be a real pain where firewalls are concerned.

Once the server machine is properly prepped, you can mount the exported filesystem. However it looks like you've issues a questionable mount command. For NFS, the usual mount is going to look something like:

mount servername:/export/home/images /mnt/images

If you don't supply a distinct mount point, it's going to mount on "images" in whatever your current working directory is.


Customer surveys are for companies who didn't pay proper attention to begin with.
Kevin P Smith
Ranch Hand

Joined: Feb 18, 2005
Posts: 362
Cheers for that,
I've created the follwing in the /etc/export file

/home/user/apps/tomcat/webapps/myApp/images <server-ip>(ro)

I had a problem when starting NFS, I get the fololwing error on daemon:-

Starting NFS services: [OK]
Starting NFS daemon:
Starting NFS daemon: rpc.nfsd: Setting version failed: errno 16 (Device or resource busy)
rpc.nfsd: Writting fd to kernal failed: errno 5 (Input/output error)
rpc.nfsd: unable to set any socket for nfsd
[FAILED]


My distinct mount point (I thought) was '/home/user/tomcat/webapps/myApps/images' on App2

Should I add to the /etc/hosts.deny the following or maybe leave this for now?
portmap: ALL
lockd:ALL
mountd:ALL
rquotad:ALL
statd:ALL

PS: Samba to purely for a Linux/Windows link right, or can it be used to do Linux/Linux?
Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 16055
    
  21

Actually, for years I used Samba for Unix/Unix instead of NFS. Ironically enough, because I felt it was more secure to use Windows Networking than NFS, which long held a pretty poor reputation in that regard. Plus Samba was more firewall-friendly.

These days I use NFS for Unix/Unix.

As far as your problem goes, I'd Google for it.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: mount one linux drive to another linux machine.