Hoffman2:Sharing Filesystems: Difference between revisions

From Center for Cognitive Neuroscience
Jump to navigation Jump to search
No edit summary
(No difference)

Revision as of 02:15, 5 September 2013

Back to all things Hoffman2

There are apps for linking filesystems so that you can access data across machines. It's like mounting a shared drive. Here we present a GUI and a command line way of accomplishing this.


MacFusion

GUIs are nice, and things just work here.


Installation

  1. Go to http://osxfuse.github.com/ and download and install OSXFuse.
  2. Go to MacFusion and download and install MacFusion (Download a build of the development version).

Usage

Let's walk through how to connect to Hoffman2.

  1. Start up the MacFusion program.
  2. Let it start the macfusion agent process.
  3. Click the plus button and select "sshfs" from the drop-down menu
  4. In the first blank, fill in a name for this link, like "Hoffman2."
  5. Fill in the other blanks in the SSH tab:
    • Host - address of the server
      hoffman2.idre.ucla.edu
    • User Name - your username on the server
      joebruin
    • Password - leave this blank if you want to type your password (for the server) every time you connect (more secure). Or just plug in your password (to the server) for convenience.
    • Path - by default it will connect to your home folder on the server, but you can specify any part of the filesystem you have access to.
  6. In the "Advanced" tab:
    • Options - to stop the program from giving you a hard time about what you do and don't have permission to read, add the text
      -o defer_permissions
  7. In the Macfusion tab:
    • Mount Point - where on your local filesystem you want this drive mounted.
    • Volume Name - what name do you want the drive to have? This is the name that shows up under the icon that will appear on your desktop.
  8. Click "OK" when you are done.
  9. Click "Mount" on the new connection that appears and type in your password if


sshfs

This tool is pre-installed on all lab computers (type which sshfs on the command line to check). But if this is your own computer, follow the install instructions.


Installation

Command lines can be more extensible

  1. Install MacPorts. The instructions they have over there are great. This is a package distribution tool where you can easily find and install other tools like watch, different versions of python, and htop. The best part is that it installs all the dependencies for you.
  2. Execute
    $ sudo port install sshfs
  3. Type your password when asked
  4. Installation should complete smoothly.


Usage

Let's say you want to mount Hoffman2 locally. On the command line, execute

$ id
uid=1010(joebruinuser) gid=20(bruingroup1),23(bruingroup2),...
$ mkdir /Volumes/MOUNTPOINT
$ sshfs -o idmap=user -o uid=1010 -o gid=20 USERNAME@hoffman2.idre.ucla.edu:/path/to/mount /Volumes/MOUNTPOINT

Where

id
Gets information about your local user, including your numerical ID and group ID(s)
-o idmap=user -o uid=1010 -o gid=20
Translates your local user and group IDs to that of the remote user so you can read and write files as if you were on the remote machine. Make sure to put the correct user and group IDs that were returned by the id command.
USERNAME
Is your username at the remote computer
hoffman2.idre.ucla.edu
Is the address of the remote computer you are connecting to.
/path/to/mount
Could be left blank to mount your home directory from the remote computer, or it could specify any point in the remote filesystem
MOUNTPOINT
Is the name of the directory where the remote filesystem will be mounted.


To unmount:

  • Use the command
umount /Volumes/MOUNTPOINT

or

  • Right click on the desktop icon that appears and select "Eject."


External Links