3

I'd want Box Cloud storage as automatically mounted in Ubuntu or sync this with a folder in my Home.

For the first one, I followed this tutorial but when I restarted I tried to mount but it says:

/sbin/mount.davfs: Mounting failed.
302 Found

For the second one I created a folder in my Home, then File->Link to server... I filled all data but the same it says: Error HTTP Foundenter image description here

Where is the problem? I checked everywhere the address but it should be ok! Any suggestions?

What method is the better, the first one or the second one? Where is the difference?

3 Answers 3

4

I solved typing dav/ as folder address and not only /

1
  • If this solved your question, please be sure to mark it as the accepted answer.
    – lazyPower
    Jan 20, 2014 at 19:30
1

See https://support.box.com/hc/en-us/articles/200519748-Does-Box-support-WebDAV-

You need to use "dav.box.com/dav" instead of "www.box.com/dav". Note that this needs to be prefixed by https://

3
  • So, I modified address in the 2 files suggest by tutorial, with the new one, fstab and secret but it says error 404 not found. Where is the problem?
    – SPS
    Jan 13, 2014 at 5:59
  • Not else to help me?
    – SPS
    Jan 19, 2014 at 17:46
  • Also if I go on this website and type my ID and password it seems there is an error!
    – SPS
    Jan 20, 2014 at 6:48
1

I realise this is an old thread but I have just managed to get this working after none of the other tutorials seemed to work so thought I would share it - this works in Ubuntu 19.04 (just released last month) and can even mount Box if you have Two Factor Authentication turned on (which is advisable):

If davfs2 is not installed then install it (if already installed then this command will do nothing):

sudo apt-get install davfs2

The next command is optional but stops connections to Box freezing whilst davfs2 attempts to place locks on files being opened:

sudo nano /etc/davfs2/davfs2.conf

Find Use_locks and set it to 0

Next to enable non-root users to connect to the Box share run sudo dpkg-reconfigure davfs2 and select Yes when prompted to enable this.

Now make a folder where your Box files will appear:

sudo mkdir /box

Next add an entry into fstab to tell the system how to mount the Box network drive (e.g. as read/write):

sudo nano /etc/fstab

Add this to the bottom:

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

Now you can mount it using mount /box

You will be prompted for your username and password after which cd /box should display the contents of your Box account. If you set up 2 factor authentication then the login will fail but you will receive a text with a 16 character password to enter so run mount /box again and this time enter the 16 character password ignoring any spaces.

Lastly if you want the drive to auto-map when you reboot you need to store the long password in the secrets file.

First make the folder in case it doesn't exist and then go to the folder and create/edit a secrets file:

sudo mkdir ~/.davfs2/
cd ~/.davfs2/
sudo nano secrets 

The contents of this file should be (replacing the email and password with your email and password, (or the 16 character password from the text if using two factor authentication):

https://dav.box.com/dav [email protected] PASSWORD

Now ensure the secrets file remains secure so others cannot open it:

sudo chmod 600 secrets

Typing df should show all drives including the Box account.

You can now use your Box storage like any other folder. It may be a lot cheaper (or free) compared with purchasing block storage from a cloud provider and can be an excellent way to store server backup files remotely.

If you only want to mount the drive as a one-off you can skip everything from the fstab part (but after creating the /box folder) and instead just run mount.davfs https://dav.box.com/dav /box

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .