Mount Box storage on RHEL or Centos Linux


Box provides online cloud storage to individuals and enterprises. The storage can be accessed via web interface or multi-platform client software. Box offers a WebDAV interface via http/https. Presented is a method of using the Box WebDAV server to export and mount a Box account making it available on a Linux server.

Mount Box Cloud storage using davfs2

davfs2 (WebDAV Linux File System) enables access to a remote WebDAV share via traditional file system interfaces.

To install davfs2 on CentOS, RHEL or Fedora

$ sudo yum install davfs2

Create a local mount point

$ mkdir ~/box
Box does not appears to support file locks via WebDAV. Disable file locks in the davfs2 configuration file located at /etc/davfs2/davfs2.conf. Without this adjustment “Input/output error” will happen attempting to create a file.
$ sudo vi /etc/davfs2/davfs2.conf
use_locks      	0

To mount Box as a non-root user on CentOS, RHEL or Fedora

$ sudo usermod -a -G davfs2 tates

Add the following line to /etc/fstab.

Note – “user” allows mounting Box as an unprivileged non-root user. Replace “/home/tates/box” with personal mount point.

https://dav.box.com/dav /home/tates/box davfs rw,user,noauto 0 0

Execute mount command.

$ mount box
Note – enter Username and password of Box account when prompted

Avoiding logon each time Box is mounted

$ chmod 600 ~/.davfs2/secrets
$ vi ~/.davfs2/secrets
https://dav.box.com/dav my_email@address.com my_box_com_password

To verify mount

$ mount
https://dav.box.com/dav on /home/tates/box type davfs (rw,nosuid,noexec,nodev,_netdev,user=tates)
$ df
Filesystem              1K-blocks      Used Available Use% Mounted on
/dev/mapper/root        953024420 131576980 773036612  15% /
udev                      4008844         4   4008840   1% /dev
tmpfs                     1607344       908   1606436   1% /run
none                         5120         0      5120   0% /run/lock
none                      4018352      1408   4016944   1% /run/shm
none                       102400        28    102372   1% /run/user
/dev/sda1                  233191     53518    167232  25% /boot
https://dav.box.com/dav  26666664  13333332  13333332  50% /home/tates/box
To un-mount Box
$ umount box
/sbin/umount.davfs: waiting while mount.davfs (pid 6824) synchronizes the cache .. OK

Leave a comment