?
Solved

Help mounting a directory in UNIX

Posted on 2011-10-26
12
Medium Priority
?
344 Views
Last Modified: 2012-05-12
Can somone give me the exact steps to mount a remote directory in Linux Ubuntu using the following:

Machine to mount to - User: MachineA@Ubunt
Machine to mount from User MachineB@Centos
MachineB@Centos IP = 10.117.17.24
Folder beign mounted on MachineB@Centos  . "FolderA"


The machine that I am mounting from is a remote machine.

Please do not send links I have explored this before but did not understand
0
Comment
Question by:wademi
  • 4
  • 3
  • 2
  • +2
12 Comments
 
LVL 4

Accepted Solution

by:
xanandu earned 1600 total points
ID: 37034859
sudo apt-get install sshfs
sudo modprobe fuse
sudo adduser <your username> fuse
sudo chown  root:fuse /dev/fuse
sudo chmod +x /dev/fusermount
makedir ~/remotedir
sshfs <username>@10.117.17.24:/<pathonremoteservertomount> ~/remotedir
0
 
LVL 19

Assisted Solution

by:xterm
xterm earned 200 total points
ID: 37034871
On Machine B:
- You will need to make sure portmap and nfsd is installed and running
- Put in /etc/exports "/path/to/FolderA  [IP Address of MachineA](rw,no_root_squash,async)"
- type "exportfs -A" as root

On Machine A:
- You will need to make sure portmap is running
- mkdir /mnt/machineb  (this creates a mount point)
- mount -t nfs MachineB:/path/to/FolderA /mnt/machineb

Then when you do "ls /mnt/machineb" you should see everything in MachineB:/path/to/FolderA

Keep in mind that if you have firewalls on either machine, this could cause the inability to mount the share as well.
0
 
LVL 31

Expert Comment

by:farzanj
ID: 37034888
Just issue this command


mount 10.117.17.24:/path/to/folder/on/remote /complete/path/FolderA
0
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 31

Expert Comment

by:farzanj
ID: 37034891
After issuing this command, you should be able to go to folderA and have the contents of the remote directory.
0
 
LVL 31

Expert Comment

by:farzanj
ID: 37034902
To see what folders are available on the remote, issue the following.
showmount -e 10.117.17.24

I am telling you the client side commands.  So all the above commands are issued on MachineB to connect to machineA
0
 

Author Comment

by:wademi
ID: 37034907
I tried the following on the machine I am mounting to:

sshfs root@10.117.17.24:/ /FolderA
The authenticity of host '10.117.17.24 (10.117.17.24)' can't be established.
RSA key fingerprint is 87:56:c6:15:ef:ed:e5:04:61:bf:08:6c:a2:a4:fa:1d.
Are you sure you want to continue connecting (yes/no)? yes
root@10.117.17.24's password:
fuse: bad mount point `/FolderA': No such file or directory

FolderA definetly exsist on machineB. SSh is running on machineB.

What am I doing wrong here?
0
 
LVL 19

Expert Comment

by:xterm
ID: 37034916
@farzan:
The mount command in your comment won't work because no mount type has been specified. Remember, NFS may not be all set up.  Additionally, the mount has to be permitted on the server side in /etc/exports.  Furthermore, showmount -e does not take an IP address as an argument.  xanandu has proposed a very valid sshfs solution, and my way will work for NFS.

*** edited by Mod_MarlEE, 26 Oct 2011 ***
0
 
LVL 31

Expert Comment

by:farzanj
ID: 37034917
Use simple NFS.  Just issue a mount command.
0
 
LVL 4

Expert Comment

by:xanandu
ID: 37034922
You have a doubleslash in the mounting command sshfs, here is an example
Sshfs root@ipaddress:/root
This will mount the root users home directory, but just replace the /root with the fullpath to the destination folder
0
 

Author Comment

by:wademi
ID: 37034989
Thanks for your help guys.
xanandu: I am now getting the following fuse error



milligram@ubuntu:~$ ls
AdobePackager  Desktop  Documents  Downloads  examples.desktop  Mtest  Music  Pictures  Public  Templates  Videos
milligram@ubuntu:~$ ls
AdobePackager  Desktop  Documents  Downloads  examples.desktop  Mtest  Music  Pictures  Public  Templates  Videos
milligram@ubuntu:~$ mkdir mnt
milligram@ubuntu:~$ ls
AdobePackager  Desktop  Documents  Downloads  examples.desktop  mnt  Mtest  Music  Pictures  Public  Templates  Videos
milligram@ubuntu:~$ sshfs root@10.117.17.24:/mtest2 /mnt
root@10.117.17.24's password:
root@10.117.17.24:/mtest2: No such file or directory
milligram@ubuntu:~$ sshfs root@10.117.17.24:/root/mtest2 /mnt
root@10.117.17.24's password:
fuse: mountpoint is not empty
fuse: if you are sure this is safe, use the 'nonempty' mount option
milligram@ubuntu:~$ sshfs root@10.117.17.24:/root/mtest2 /mnt
root@10.117.17.24's password:
fuse: mountpoint is not empty
fuse: if you are sure this is safe, use the 'nonempty' mount option
0
 
LVL 21

Assisted Solution

by:Papertrip
Papertrip earned 200 total points
ID: 37035000
I'm assuming the directory below is not / but rather your homedir
milligram@ubuntu:~$ ls
AdobePackager  Desktop  Documents  Downloads  examples.desktop  Mtest  Music  Pictures  Public  Templates  Videos
milligram@ubuntu:~$ mkdir mnt

Open in new window

But you are using /mnt in your syntax, and apparently something is already mounted there.
milligram@ubuntu:~$ sshfs root@10.117.17.24:/root/mtest2 /mnt

Open in new window


Assuming the directory is your homedir, then use the following as described in the first answer.
milligram@ubuntu:~$ sshfs root@10.117.17.24:/root/mtest2 ~/mnt

Open in new window

0
 

Author Comment

by:wademi
ID: 37035044
That worked: milligram@ubuntu:~$ sshfs root@10.117.17.2:/root/mtest2 ~/mnt

Thanks All.

Special TTTTHHHAAANKS!!!! TO >>>>>>>>>xanandu: , Papertrip:,xterm:
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Have you ever been frustrated by having to click seven times in order to retrieve a small bit of information from the web, always the same seven clicks, scrolling down and down until you reach your target? When you know the benefits of the command l…
Why Shell Scripting? Shell scripting is a powerful method of accessing UNIX systems and it is very flexible. Shell scripts are required when we want to execute a sequence of commands in Unix flavored operating systems. “Shell” is the command line i…
Learn several ways to interact with files and get file information from the bash shell. ls lists the contents of a directory: Using the -a flag displays hidden files: Using the -l flag formats the output in a long list: The file command gives us mor…
In a previous video, we went over how to export a DynamoDB table into Amazon S3.  In this video, we show how to load the export from S3 into a DynamoDB table.
Suggested Courses
Course of the Month17 days, 13 hours left to enroll

830 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question