Bekijk de volledige versie : [RESOLVED] Can't Mount Box.com using Entware davfs2 (Asus RT-N16)

24-06-2015, 04:27
I hope this is the correct place to post this. If this isn't, please let me know.

I am using dd-wrt mega on an ASUS RT-N16 and am attempting to mount my box.com account using davfs2 loaded from Entware.

I referenced the following sites to try to make this work:

OpenWRT Forum: Mounting Box.com, Google Drive and other WebDAV-accessed clouds (https://forum.openwrt.org/viewtopic.php?id=36994)
Box.com FAQ: Does Box support FTP or WebDAV? (https://support.box.com/hc/communities/public/questions/200261028-Does-Box-support-FTP-or-WebDAV-)
Cloud Storage On Your Raspberry Pi (http://www.sbprojects.com/projects/raspberrypi/webdav.php)
GitHub Entware Repo (https://github.com/Entware/entware)

I successfully installed Entware and the davfs2 package, mounted another partition to /mnt, then created a subdirectory "box", then attempted to mount using the following command:

$mount -t davfs https://www.box.com/dav /mnt/box
Didn't work. No messages at all. Realized the link may be old (after reading the Box FAQ link shown above) and tried:

$mount -t davfs https://dav.box.com/dav /mnt/box
Still didn't work. Checked my log file at /var/log/messages (I had already enabled logging when setting up the router), no messages.

I tried installing wdfs, just in case, but that didn't change anything. Same thing for installing busybox and mount-utils.

I could use some help, even if it's troubleshooting steps. Since I have no messages I don't know what next steps to take to resolve this.

Thank you!

24-06-2015, 08:02
IMHO, dd-wrt is most weird firmware I ever seen. Try:

insmod fuse
Before mounting WebDAV shares.

24-06-2015, 14:59
Thank you for the quick replay and help. I tried the steps you provided and still received no messages. I've posted the output from my SSH session below.

root@DD-WRT:~# unset LD_LIBRARY_PATH
root@DD-WRT:~# insmod fuse
root@DD-WRT:~# mount -t davfs https://dav.box.com/dav /mnt/box
root@DD-WRT:~# df
Filesystem 1K-blocks Used Available Use% Mounted on
/dev/root 5760 5760 0 100% /
1032088 14292 965368 1% /opt
13991856 34712 13246388 0% /mnt

Any other steps I can try or any other information I can get to help troubleshoot? Would you recommend I switch to a different firmware? Go back to AsusWRT? Tomato? If Tomato, do you have a build you would recommend? (Toastman? Shibby? Viktec?)

Thank you again for your help!

24-06-2015, 15:13
Please, try to call davfs2 binary directly:

mount.davfs https://dav.box.com/dav /mnt/box

24-06-2015, 17:22
Ok, that gave me an error message, which is a step forward!

root@DD-WRT:~# mount.davfs https://dav.box.com/dav /mnt/box
mount.davfs: can't resolve symbol 'canonicalize_file_name' in lib 'mount.davfs'.

I didn't get any error messages when I installed davfs2, so I'm assuming that went well. I hadn't installed anything other than what comes in the base Entware_install.sh script, so I hope there aren't any conflicts.

This is a fresh install, so if I need to start from scratch it won't cost me that much time investment.

24-06-2015, 18:42
Looks like LD_LIBRARY_PATH is still set. Please, provide here an output of following commands:

ldd /opt/sbin/mount.davfs

24-06-2015, 19:12
Oh! I'm sorry, I had to shutdown the router and go to work between the two sets of instructions you provided.

Here is the output you just requested:

root@DD-WRT:~# ldd /opt/sbin/mount.davfs
-sh: ldd: not found
root@DD-WRT:~# opkg install ldd
Installing ldd (0.9.32-1) to root...
Downloading http://entware.wl500g.info/binaries/mipselsf/ldd_0.9.32-1_mipselsf.ipk.
Configuring ldd.
root@DD-WRT:~# ldd /opt/sbin/mount.davfs
ldd: LD_LIBRARY_PATH not included in search path: it needs ld.so stand-alone execution enabled
libcrypto.so.1.0.0 => /opt/lib/libcrypto.so.1.0.0 (0x2aac0000)
libssl.so.1.0.0 => /opt/lib/libssl.so.1.0.0 (0x2ac3d000)
libneon.so.27 => /opt/lib/libneon.so.27 (0x2ac9f000)
libz.so.1 => /opt/lib/libz.so.1 (0x2acd4000)
libexpat.so.1 => /opt/lib/libexpat.so.1 (0x2acf8000)
libc.so.0 => /opt/lib/libc.so.0 (0x2ad32000)
libdl.so.0 => /opt/lib/libdl.so.0 (0x2ade4000)
ld-uClibc.so.0 => /opt/lib/ld-uClibc.so.0 (0x2aaa8000)
root@DD-WRT:~# echo $LD_LIBRARY_PATH

But, given I had rebooted to go to work, I tried the following:

root@DD-WRT:~# unset LD_LIBRARY_PATH
root@DD-WRT:~# insmod fuse
root@DD-WRT:~# mount.davfs https://dav.box.com/dav /mnt/box
mount.davfs: can't access file /etc/mtab: No such file or directory

Shouldn't that be looking for /etc/fstab?

25-06-2015, 06:33
Shouldn't that be looking for /etc/fstab?It requires /etc/mtab (https://en.wikipedia.org/wiki/Mtab). I'm surprised it's not present in DD-WRT, you can create it by:

ln -s /proc/mounts /etc/mtab

25-06-2015, 16:39
Gave that a try and it didn't work:

root@DD-WRT:~# cat /proc/mounts
rootfs / rootfs rw 0 0
/dev/root / squashfs ro 0 0
none /dev devfs rw 0 0
proc /proc proc rw 0 0
ramfs /tmp ramfs rw 0 0
sysfs /sys sysfs rw 0 0
devpts /dev/pts devpts rw 0 0
devpts /proc/bus/usb usbfs rw 0 0
/dev/discs/disc0/part2 /mnt ext2 rw 0 0
/dev/discs/disc0/part1 /opt ext2 rw 0 0
root@DD-WRT:~# ln -s /proc/mounts /etc/mtab
root@DD-WRT:~# unset LD_LIBRARY_PATH
root@DD-WRT:~# insmod fuse
root@DD-WRT:~# mount.davfs https://dav.box.com/dav /mnt/box
mount.davfs: can't access file /etc/mtab: No such file or directory
root@DD-WRT:~# cat /etc/mtab

But I did some searching and found there should have been a fix already in place: http://svn.dd-wrt.com/ticket/1388
So I checked what firmware I'm using: DD-WRT v24-sp2 (08/07/10) mega (SVN revision 14896)

So that's a Noob mistake. I'm going to take some time to upgrade to more current firmware and give this another try. I will let you know if I run into more issues and will post the resolution if it works.

25-06-2015, 18:57
No change on newer firmware. I'm now on DD-WRT v3.0-r27413 (06/22/15) mega and successfully installed Entware using the instructions on the GitHub site, successfully installed davfs2, but there is no link between /etc/mtab and /proc/mounts. I also still can not create one. Here is the full process in case I am missing something:

root@DD-WRT:~# wget -O - http://entware.wl500g.info/binaries/mipselsf/installer/entware_install.sh | sh
Connecting to entware.wl500g.info (
- 100% |************************************************* ************************************************** | 1143 0:00:00 ETA
Info: Checking for prerequisites and creating folders...
Info: Opkg package manager deployment...
Connecting to entware.wl500g.info (
opkg 100% |************************************************* ************************************************** | 476k 0:00:00 ETA
Connecting to entware.wl500g.info (
opkg.conf 100% |************************************************* ************************************************** | 106 0:00:00 ETA
Info: Basic packages installation...
Downloading http://entware.wl500g.info/binaries/mipselsf/Packages.gz.
Updated list of available packages in /opt/var/opkg-lists/openwrt.
Installing uclibc-opt (0.9.32-5) to root...
Downloading http://entware.wl500g.info/binaries/mipselsf/uclibc-opt_0.9.32-5_mipselsf.ipk.
Installing libc (0.9.32-1) to root...
Downloading http://entware.wl500g.info/binaries/mipselsf/libc_0.9.32-1_mipselsf.ipk.
Installing libgcc (4.6.4-1) to root...
Downloading http://entware.wl500g.info/binaries/mipselsf/libgcc_4.6.4-1_mipselsf.ipk.
Installing libstdcpp (4.6.4-1) to root...
Downloading http://entware.wl500g.info/binaries/mipselsf/libstdcpp_4.6.4-1_mipselsf.ipk.
Installing libpthread (0.9.32-1) to root...
Downloading http://entware.wl500g.info/binaries/mipselsf/libpthread_0.9.32-1_mipselsf.ipk.
Installing librt (0.9.32-1) to root...
Downloading http://entware.wl500g.info/binaries/mipselsf/librt_0.9.32-1_mipselsf.ipk.
Installing ldconfig (0.9.32-1) to root...
Downloading http://entware.wl500g.info/binaries/mipselsf/ldconfig_0.9.32-1_mipselsf.ipk.
Installing findutils (4.5.14-1) to root...
Downloading http://entware.wl500g.info/binaries/mipselsf/findutils_4.5.14-1_mipselsf.ipk.
Configuring ldconfig.
Configuring libgcc.
Configuring libc.
Configuring libpthread.
Configuring libstdcpp.
Configuring librt.
Configuring findutils.
Configuring uclibc-opt.
Updating /opt/etc/ld.so.cache... done.
Info: Cleanup...
Info: Congratulations!
Info: If there are no errors above then Entware successfully initialized.
Info: Found a Bug? Please report at https://github.com/Entware/entware/issues
root@DD-WRT:~# opkg install davfs2
Installing davfs2 (1.5.2-1) to root...
Downloading http://entware.wl500g.info/binaries/mipselsf/davfs2_1.5.2-1_mipselsf.ipk.
Installing libneon (0.30.0-1) to root...
Downloading http://entware.wl500g.info/binaries/mipselsf/libneon_0.30.0-1_mipselsf.ipk.
Installing libopenssl (1.0.2a-0) to root...
Downloading http://entware.wl500g.info/binaries/mipselsf/libopenssl_1.0.2a-0_mipselsf.ipk.
Installing zlib (1.2.8-1) to root...
Downloading http://entware.wl500g.info/binaries/mipselsf/zlib_1.2.8-1_mipselsf.ipk.
Installing libexpat (2.1.0-3) to root...
Downloading http://entware.wl500g.info/binaries/mipselsf/libexpat_2.1.0-3_mipselsf.ipk.
Configuring zlib.
Configuring libopenssl.
Configuring libexpat.
Configuring libneon.
Configuring davfs2.
root@DD-WRT:~# cd /mnt
root@DD-WRT:/tmp/mnt# mkdir box
root@DD-WRT:/tmp/mnt# chmod +rw ./box
root@DD-WRT:/tmp/mnt# ls -l
drwxr-xr-x 2 root root 4096 Jun 25 19:41 box
drwx------ 2 root root 16384 Jun 25 19:31 lost+found
root@DD-WRT:/tmp/mnt# chmod a+rw ./box
root@DD-WRT:/tmp/mnt# ls -l
drwxrwxrwx 2 root root 4096 Jun 25 19:41 box
drwx------ 2 root root 16384 Jun 25 19:31 lost+found
root@DD-WRT:/tmp/mnt# mount -t davfs https://dav.box.com/dav /mnt/box
root@DD-WRT:/tmp/mnt# cat /etc/mtab
root@DD-WRT:/tmp/mnt# ln -s /proc/mounts /etc/mtab
root@DD-WRT:/tmp/mnt# cat /etc/mtab

Thank you again for all of your help, it is very much appreciated!

26-06-2015, 06:26
Looks like nothing more I can do about that. DD-WRT has no /etc/mtab an ordinary system file, which present on all linux systems I ever seen. That's really strange.

01-07-2015, 01:56
Good news! I installed the Toastman mod of Tomato (Tomato Firmware v1.28.7507 MIPSR2Toastman-RT K26 USB VLAN-VPN-NOCAT to be specific) and everything worked great!

The only issue I'm working on now is auto-mounting on boot. I created my secrets file and created an init script to mount it, but it isn't working. I suspect it's because of the certificate issues I see when use the same command at the command line as shown below.

root@unknown:/tmp/home/root# mount -t davfs https://dav.box.com/dav /mnt/box
mount.davfs: the server certificate is not trusted
issuer: GeoTrust Inc., US
subject: Box, Inc., Los Altos, California, US
identity: *.box.com
fingerprint: c0:f7:f1:a6:34:42:d6:69:b1:90:41:a6:56:12:d6:a5:f9 :60:57:ba
You only should accept this certificate, if you can
verify the fingerprint! The server might be faked
or there might be a man-in-the-middle-attack.
Accept certificate for this session? [y,N]

I tried using the startup script shown below, which works on the command line to pass through that message, but doesn't work in script form.

mkdir /mnt/box
echo 'y' | mount -t davfs https://dav.box.com/dav /mnt/box

I saw a few forum discussions about adding the certificate in PEM format, but that seems really intense and I'm looking for something a little easier if possible. I'm assuming this is something I don't know enough about to know the easy way of doing it. Any suggestions?

01-07-2015, 02:26
Resolved! I changed the script over to the WAN up and all is working now. Thanks for all the help!