Linux: Mount Box.net Account Locally

Cloud storage nowadays has create a trend on storing and accessing data from any where around the world. 2 most popular cloud storage providers are Dropbox and Box.net. In this post, I am going to show you on how to mount Box.net account inside the Linux box. You are required to have a Box.net account, which is free if you register for personal plan and it comes with 5 GB online storage space.

We will use davfs2 to mount Box.net account via WebDAV. Dropbox do not offer this feature at the moment. Variable that I used as follows:

OS: CentOS 6.2 64bit
Box.net username: [email protected]
Box.net password: MyGu1234
Mount point: /mnt/box/

1. To use the simplest way on installation, we will use RPMforge repository:

$ cd /usr/local/src
$ rpm --import http://apt.sw.be/RPM-GPG-KEY.dag.txt
$ wget http://packages.sw.be/rpmforge-release/rpmforge-release-0.5.2-2.el6.rf.x86_64.rpm
$ rpm -K rpmforge-release-0.5.2-2.el6.rf.x86_64.rpm

2. Once done, lets install davfs2 via yum:

$ yum install -y davfs2

3. Create the mount point:

$ mkdir /mnt/box

4. Add following line to /etc/fstab:

https://www.box.com/dav    /mnt/box    davfs    rw,user,noauto 0 0

5. Add Box.net account information into /etc/davfs2/secrets using text editor:

https://www.box.com/dav  [email protected]  MyGu1234

Notes: If you use special characters in your password use a forward slash in front of the special character (thanks to Keith for this highlight)

6. Change the lock mechanism of mounted filesystem. Open /etc/davfs2/davfs2.conf and find following value:

#use_locks    1

And change to:

use_locks     0

7. Mount the partition:

$ mount /mnt/box

Done! Now you can start to sync your files to your cloud storage by copying the files into /mnt/box directory. Login into Box.net account and verify that the files should be existed. Depending on the file size, you might need to wait for a while after copying process complete before it appears in the Box.net account.

Following screenshot is the Box.net account. I just sync my public_html backup files to the cloud storage.

Happy ‘clouding’. Cheers!