Saturday, November 5, 2011

Mounting an iDisk on Linux (Quick and Dirty)

Here's how to get your iDisk mounted in your home directory on a linux machine.  You'll need to have sudo privileges.  Also, you'll need to type your iDisk username and password by hand, when prompted.  You could automate all of this quite nicely, but I'm only interested in an as-needed one-liner that I'll copy and paste (or script).

First-time, you'll need the davfs2 package installed.  If you're on debian (ubuntu) apt already knows where it is.  If you're on redhat (centos) you'll need to add Dag's rpmforge repo, before yum will be able to find davfs2.

  sudo apt-get davfs2  # for debian/ubuntu users.
  sudo yum install davfs2  # for redhat/centos users who have rpmforge enabled.
  # if yum can't find it, you need to install the rpmforge repo from http://repoforge.org/use/

Then, you can issue this one-liner to make a mountpoint (fine if it exists already); and mount your idisk on it, owned by you.  (You might make this is a script in your home directory, for easy access.)

  sudo mkdir $HOME/idisk ; \
  sudo mount -t davfs https://idisk.me.com/YOURICLOUDUSERNAME \
    $HOME/idisk -o rw,uid=`id -u`,gid=`id -g`

After, when you're done, unmount your idisk, to make sure that all of your changes have been uploaded.

  sudo umount $HOME/idisk

Hopefully this is a good starting point for someone who wants to automate this when a user logs in.  You may need/want to have FUSE involved in that.  I'm not talking about just adding it to /etc/fstab .. there's a "right" way to do it magically per user, and only when they're logged in.  Extra points for letting it remember your password.  Please add a comment if you've done it!

No comments:

Post a Comment