Mount your box.net (box.com) account in linux

Discussion in 'General Linux' started by Rob, Jan 12, 2012.

  1. Rob

    Rob Administrator Staff Member

    Messages:
    575
    Likes Received:
    225
    Trophy Points:
    43
    Did your box.net mount start failing recently? They've changed a couple things.. use this guide to set it up again..

    First, install davfs
    Red Hat based:
    # yum install davfs2

    Debian based:
    # apt-get install davfs2


    Now, add the mount point:
    # mkdir /box

    Add this line to your /etc/fstab:
    Code:
    https://www.box.com/dav /box davfs rw,user,noauto 0 0
    
    Add this line to the bottom of the /etc/davfs2/secrets file (replace with your email address and password)
    Code:
    https://www.box.com/dav user@email.com password
    
    Edit the /etc/davfs2/davfs2.conf
    Change:
    # use_locks 1
    to
    use_locks 0

    Now mount it!
    # mount /box

    Show that it's there with 'mount' or with 'df'

    Now.. rsync something to it. Here, i'm rsyncing a 1gb tgz file:
    Code:
    [root@station-222 home]# rsync -avz --progress rob-test.tgz /box/
    sending incremental file list
    rob-test.tgz
      1154875454 100%   61.06MB/s    0:00:18 (xfer#1, to-check=0/1)
    sent 1155263231 bytes  received 31 bytes  59244269.85 bytes/sec
    total size is 1154875454  speedup is 1.00
    [root@station-222 home]#
    
    It took hardly any time at all over a fios connection - 18 seconds @ 61mb/sec
    box_01.png
    DaReaper and scotty like this.
  2. gabsoftware

    gabsoftware New Member

    Messages:
    2
    Likes Received:
    0
    Trophy Points:
    0
    Very useful, awesome! However, it is mounted like read-only for my normal user. I did a chown and chgrp for my username on the /box directory but it is still impossible to modify the existing files because only root can mount it, and so the files in the folder are owned by root. The "mount -a" command doesn't work with my user. Do you have a fix?

    Thanks again for your awesome article!
  3. Rob

    Rob Administrator Staff Member

    Messages:
    575
    Likes Received:
    225
    Trophy Points:
    43
  4. scotty

    scotty New Member

    Messages:
    84
    Likes Received:
    3
    Trophy Points:
    0
    This is so useful! I use Box on my Playbook, so I'm gonna try this...fingers crossed!
  5. gabsoftware

    gabsoftware New Member

    Messages:
    2
    Likes Received:
    0
    Trophy Points:
    0
    Thanks! Now read & write working :)
  6. DaReaper

    DaReaper New Member

    Messages:
    184
    Likes Received:
    3
    Trophy Points:
    0
    Wow i thought using wput and wget was fun, i really use Box on my Windows and mobile phone to sync and backup few of my important documents and files.

    I hope this will be equally helpful for syncing my server files into box. Thanks a lot! :D
  7. Akendo

    Akendo New Member

    Messages:
    136
    Likes Received:
    7
    Trophy Points:
    0
    Don't use wedav. It's a just ugly.
    Use sshfs or CIFS. Webdav is in my opion as valadation of the HTTP Protocol, also it's create much to much overhaed.

    Why not using a protocol that has be design from the first moment for this?

    so far
    Akendo
  8. Rob

    Rob Administrator Staff Member

    Messages:
    575
    Likes Received:
    225
    Trophy Points:
    43
    OK :)

    I love sshfs btw..

    How would you do it using sshfs and/or CIFS?

  9. Akendo

    Akendo New Member

    Messages:
    136
    Likes Received:
    7
    Trophy Points:
    0
    sshfs depends on a simply ssh server. You have install the fuse framework on your locale system. But after this you just trade it like a mount point.
    The advantaces are:
    1. Encrypted
    2. No extra Deamon required
    3. Caching directory content(important!)


    The command is:
    Code:
    sshfs hostname: mountpoint
    
    CIFS is need when you have need for acl. To explains this it would take to long.

    so far
    akendo
  10. Darwin

    Darwin New Member

    Messages:
    115
    Likes Received:
    3
    Trophy Points:
    0
    Looks clever... but you could elaborate a little for us :p
  11. KenJackson

    KenJackson Active Member

    Messages:
    129
    Likes Received:
    28
    Trophy Points:
    28
    Excellent! I just installed sshfs from the Fedora repository and used it to mounted one PC's drive on another over my house network. This seems like a very useful tool. I've heard of it before, but never got around to trying it.

    But my PC is an SSH server. In order to mount a box.com directory using sshfs, box.com must also be an SSH server.

    Is it?

    I looked around their web site and it's typically frustrating--they talk a lot and say a little. I searched the knowledge base for ssh and protocol and got no hits. When I searched for dav, which Rob is using from a Linux platform, I found it says, "Box currently supports connection to WebDAV exclusively on Apple iOS. ... WebDAV is currently not supported for other platforms or for desktop integration."

    How very unappealing. But oh how amusing that Rob got it work with Linux davfs2 anyway.

    /\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/

    If I ever do manage to find a drive in the clouds that I can mount on my Linux PC, I'll mount the drive a second time with encfs to encrypt it. That is, I not only want the data encrypted as it's transferred, but I want it encrypted so the provider can't snoop. (You KNOW that Google will snoop through everythig you store unencrypted on Google Drive.)

Share This Page