Posted by & filed under Internet, Linux.

I recently signed up for a free 50gb account at Box.net. At the time of this writing, Box.net does not have an application to sync files from a Linux machine to their servers. I followed this guide and this post to mount the service to a local directory. I did:

sudo apt-get install davfs2
emacs -q -nw /etc/davfs2/secrets
## added the following to the end of the file: "https://www.box.net/dav username password"
mkdir /mnt/box.net
## added the following to /etc/fstab
## following equivalent to defaults except noauto instead of auto; http://www.tuxfiles.org/linuxhelp/fstab.html
https://www.box.net/dav /mnt/box.net    davfs   rw,suid,dev,exec,noauto,nouser,async,uid=vinh,gid=vinh  0       0

Now do sudo mount /mnt/box.net to have have it mounted. Note that the account will automatically mount at startup.

Input/Ouput error

If you get an input/output error when copying files to your box.net folder, then add the following to your /etc/davfs2/davfs2.conf (per this post):

use_locks       0

Automount

I have the noauto option in /etc/fstab because I don’t want the box.net directory to be mounted at boot time. Why? Mounting requires an internet connection, and a network cable might not always be plugged; a mount error would require manual intervention (Skip or Manual mount) at startup. Instead, we should automatically mount the box.net directory whenever a network connection is made by placing the following script,

#! /bin/bash

mount /mnt/box.net

as /etc/network/if-up.d/mountBoxDotNet; remember to make it executable with chmod +x.

11 Responses to “Mount box.net on Ubuntu Linux via webDAV”

  1. Aivars

    Automount

    in fstab you can add option ‘_netdev’ – the fstab then will know that’s a network device, and will mount after network is up

    Reply
    • Vinh Nguyen

      @Aivers I’ve never used the “_netdev” option, but what happens if your network disconnects? Does fstab automatically unmount? I have a feeling it doesn’t.

      Reply
  2. Jørgen Thulstrup

    Cool to be able to mount 50Gb of cloud storage :-)
    I’ve successfully been able to mount using the steps above … but I am prompted for an e-mail address and a password … even though I have added it to /ets/davfs2/sectrets

    Could that be related to the uid and gid in /etc/fstab?
    I have changed it to uid=1000,gid=1000 because that is the uid and gid of the user I’m logged in with.

    Is there a service that need to be restarted before I can successfully mount with the stored credentials?

    Reply
  3. Jørgen Thulstrup

    Another bump … I can mount (manually) but I only have read permissions :-(
    What’s the point :-(

    Reply
  4. U. Buntu

    @Jorgen – sudo chmod -R 777 /media/Box (or wherever you mounted it) Then you’ll have read/write permissions on everything in your Box.

    Reply
  5. Rodo

    Hello! Thank you for taking the time to post this. I had discovered the intitial post — but was getting the Input/Output error. After a few more searches – and dead end paths, I found your post.

    Ideally I would have liked to get this working in Ubuntu 11.10 Nautilus “Home Folder > File > Connect to Server” then use secure webdav. Then be able to save username and password to the login keyring in a secure fashion. Unfortunately, connecting this way seems broken as I would only receive “302 Moved permanently” errors.

    So, I’m grateful to have your method!

    Reply
  6. Brian Thompson

    getting this error

    sudo mount /mnt/box.net
    mount: can’t find /mnt/box.net in /etc/fstab or /etc/mtab

    Reply
  7. boxer

    hi guys

    you need to replace the box.net by box.com and it will work again

    HTH

    Reply
  8. Tapasvi Moturu

    UID and GID need to replaced with the user id and group id of the user who can have read write access to the mounted folder…

    Otherwise only rood will have write acesss

    Reply
  9. daster

    Why is it that in order to open a directory, it has to read over the network the equivalent of the total amount of data in that directory? For example, just to LIST the files in my /mnt/box.com/Backups directory, which has over 2 GB of data, I get 2 GB of throughput? Why does this happen, and is there a fix?

    Reply
  10. box

    @daster
    If you remove “async” from the mount params, it should solve your problem.

    Reply

Trackbacks/Pingbacks

  1.  Easy Autoconfiguration for Ubuntu - Page 23 - webOS Nation Forums
  2.  Accede a tu cuenta de Box.net de 50 GB desde Ubuntu | El atareao
  3.  Box.net offering 50GB free for lifetime « Old Papyrus
  4.  Accede a tu cuenta de Boxnet de 50 GB desde Ubu
  5.  How to sync your box.com account in Linux | gstoyanov

Leave a Reply

  • (will not be published)