Monday, October 17, 2011

boxfs: 50G from the cli has 50G's worth of free space!

Here's how you can get the most of it from via FUSE. Totally awesome!

This was all executed on DISTRIB_DESCRIPTION="Ubuntu 11.04"

First fetch the code:
jcuff@shuttle:~/box$ svn checkout boxfs-read-only
A    boxfs-read-only/boxopts.c
A    boxfs-read-only/boxfs.c
A    boxfs-read-only/
A    boxfs-read-only/boxapi.c
A    boxfs-read-only/boxopts.h
A    boxfs-read-only/boxpath.c
A    boxfs-read-only/COPYING
A    boxfs-read-only/boxapi.h
A    boxfs-read-only/boxhttp.c
A    boxfs-read-only/boxpath.h
A    boxfs-read-only/README
A    boxfs-read-only/Makefile
A    boxfs-read-only/boxhttp.h
U   boxfs-read-only
Checked out revision 84.

First off some simple prereqs:
jcuff@shuttle:~/$ sudo apt-get install libxml2-dev libfuse-dev libcurl4-gnutls-dev libzip-dev

and libapp:

jcuff@shuttle:~/$ git clone
jcuff@shuttle:~/$ sudo make install

Then simply add this to your Makefile:

Remember to run ldconfig or you will get:
jcuff@shuttle:~/$ boxfs --help
boxfs: error while loading shared libraries: cannot open shared object file: No such file or directory

Then make a config file:
jcuff@shuttle:~/$ cat config
username =
mountpoint = /home/jcuff/boxed
verbose = yes
secure = yes
password = secritpasscodez
largefiles = yes

Then you are pretty much all set to fire it up:
jcuff@shuttle:~/$ boxfs -f ./config

jcuff@shuttle:~/$ ls -ltra ~/boxed
total 4
drwxr-xr-x  3 root  root  21390149 1969-12-31 19:00 .
-r--r--r--  1 root  root  19023676 2011-10-17 12:41 Box App Overview.mp4
-r--r--r--  1 root  root    439630 2011-10-17 12:41 Box Overview.pdf
-r--r--r--  1 root  root   1563857 2011-10-17 12:41 Box for iPhone.pdf
drwxr-xr-x  2 root  root    362986 2011-10-17 12:46 Private

jcuff@shuttle:~/$ df -H ~/boxed
Filesystem             Size   Used  Avail Use% Mounted on
boxfs                  2.2G    22M   2.2G   1% /home/jcuff/boxed

The system uses delayed writes, but works nicely!
jcuff@shuttle:~/$ time dd if=/dev/zero of=~/boxed/test.dat bs=1024k count=10
10+0 records in
10+0 records out
10485760 bytes (10 MB) copied, 0.178957 s, 58.6 MB/s

jcuff@shuttle:~/$ ls -ltra ~/boxed/test.dat 
-r--r--r-- 1 root root 10485760 2011-10-17 13:12 /home/jcuff/boxed/test.dat

And as they say "wooph, there it is!"

update! remember is a webdav provider!

jcuff@shuttle:~$ sudo apt-get install davfs2

jcuff@shuttle:~$ sudo mount -t davfs ./tt
Please enter the username to authenticate with server or hit enter for none.
Please enter the password to authenticate user with server or hit enter for none.

jcuff@shuttle:~$ df -H /home/jcuff/tt
Filesystem             Size   Used  Avail Use% Mounted on
                        28G    14G    14G  50% /home/jcuff/tt

It is even easier on OSX, or windows!

Top menu - > "Go" -> "Connect to Server":

(c) 2018 James Cuff