Thursday, July 30, 2015

How to mount Box.com Cloud Storage in Linux



Mount Box.com storage account via davfs2


You can use davfs2 (WebDAV Linux File System) which enables you to access a remote WebDAV share via traditional file system interfaces.

To install davfs2 on CentOS, RHEL

$ sudo yum install davfs2 

Next, create a local mount point.
$ mkdir /tmp/box

The WebDAV share exported by Box.com does not support file locks. Thus you need to disable file locks in the davfs2 configuration file located at /etc/davfs2/davfs2.conf. Otherwise, you will encounter "Input/output error" while attempting to create a file.

$ sudo vi /etc/davfs2/davfs2.conf
use_locks    
   0

Mount Box as a non-root user on CentOS, RHEL
Add yourself to a Linux group called "davfs2"
Simply run the following command.
$ sudo usermod -a -G davfs2 linuxhowto

Once you have followed the above distro-specific instruction, add the following to /etc/fstab. The "user" option allows you to mount Box as an unprivileged non-root user. Replace "/tmp/box " with your own mount point.
https://dav.box.com/dav /tmp/box davfs rw,user,noauto 0 0
 
Now you can go ahead and mount your Box.com account by running mount command as a regular user. When asked for username and password, enter your Box.com account username/password.
$ mount /tmp/box
Please enter the username to authenticate with server
https://dav.box.com/dav or hit enter for none.
  Username: my_email@address.com
Please enter the password to authenticate user my_email@address.com with server
https://dav.box.com/dav or hit enter for none.
  Password:  
 
If you do not want to type in username/password every time you mount, put your Box.com login credential information in the following file.
$ chmod 600 ~/.davfs2/secrets
$ vi ~/.davfs2/secrets
https://dav.box.com/dav my_email@address.com my_box_com_password
 
To verify that mount was successful, run these:
$ mount
https://dav.box.com/dav on /tmp/box type davfs (rw,nosuid,noexec,nodev,_netdev)

# df -h
https://dav.box.com/dav
                      910T   12K  910T   1% /tmp/box

#ls -l /tmp/box
total 0
drwxr-xr-x.  2 root root 0 Apr  2 05:36 (Private) Pankaj Pal
To umount Box.com account:

#umount /tmp/box
/sbin/umount.davfs: waiting while mount.davfs (pid 27778) synchronizes the cache .. OK

2 comments:

  1. شركة المنارة تعد مكافحة حشراتنقوم بالقضاء علي جميع الحشرات الموجودة في المنازل
    شركة مكافحة النمل البيض بالرياض
    شركة مكافحة النمل البيض بالرياض
    شركة مكافحة النمل البيض بالرياض
    شركة مكافحة النمل البيض بالرياض
    اتصل الان علي شركة المنارة افضل شركة مكافحة حشرات بالمملكة العربية السعودية
    here
    المنارة تقدم لكم اليوم افضل شركة مكافحة حشرات بالرياضنقوم بمكافحة النمل الابيض و الصراصير و الفئران و الافاعي اي اننا نقوم بمكافحة جميع الحشرات الطائرة و الزاحفة نحن شركة المنارة افضل و امهر و احسن و اعظم شركة مكافحة النمل الابيض بالرياض لاننا نمتلك افضل طاقم من العمالة المدربة علي افضل اساس ممكن نحن لا نعمل من اجل الاموال نحن نعمل من اجل القمة نحن نريد ان نكون في القمة دائما و لاننا افضل شركة مكافحة الصراصير بالرياض نقوم بتقديم افضل الخصومات الرائعة و العروض ايضا نحن نمتلك افضل معدات مكافحة الحشرات و رش المبيدات اتصل الان علي شركة المنارة افضل شركة مكافحة حشرات بالرياض
    شركة مكافحة حشرات بالرياض
    here

    ReplyDelete