Morphex's blogologue (Life, technology, music, politics, business, mental health and more)

This is the blog of Morten W. Petersen, aka. morphex in various places. I blog about my life, and what I find interesting and/or important. This is a personal blog without any editor or a lot of oversight so treat it as such. :)

My email is morphex@gmail.com.

An OGG/Vorbis player, implemented in Javascript.

My Kiva bragging page
My shared (open source) code on GitHub

Morphex's Blogodex

News
Slashdot

Zope hosting by Nidelven IT

Morten Petersen on Linkedin

Morten Petersen on Facebook

Morten Petersen on SoundCloud

Morten Petersen on MixCloud

Blogologue on Twitter



Older entries



Atom - Subscribe - Categories

Facebook icon Share on Facebook Google+ icon Share on Google+ Twitter icon Share on Twitter LinkedIn icon Share on LinkedIn

Google Drive on Linux (ocamlfuse) and cp cannot create hardlink, function not implemented

So, I was copying a bunch of stuff from an old Windows partition, in case there was something there I needed, making a backup to my Google Drive.

Copying it all using Firefox or Chrome didn't work, the process just died away at some point. So I thought why not go for the command line, which could be setup to retry etc. whenever something fails.

I found google-drive-ocamlfuse, and installation and setup was straightforward. The installation command was

sudo add-apt-repository ppa:alessandro-strada/ppa && sudo apt-get update && sudo apt-get install google-drive-ocamlfuse

(all on one line).

After that, I created a directory google-drive in my home folder, with the command

mkdir google-drive

and setup that folder as a mount point to my google drive, using

google-drive-ocamlfuse google-drive/

It is worth mentioning that you have to close down the browser after authorizing gdfuse to access your google drive, otherwise you can sit and wait on the command line for a long time.

Voila, the google drive was mounted at /home/morphex/google-drive

Now, to mount my Windows partition and make it accessible for my regular user, I had to run

sudo mount -u uid=1000,gid=1000 /dev/sda3 /mnt

To mount the drive accessible to my regular user, so the copy command could read all files.

To copy all the files from the Windows partition, I had to use

cp -Ruvv --copy-contents /mnt /home/morphex/google-drive/ssd

It is worth mentioning that I figured out I had to use the --copy-contents argument, after cp said it couldn't create hardlink, function not implemented.

As an example, that was presumably that a file A existed, and file B was a pointer to the same file, with no contents of its own, and the ability to copy just the pointer was not implemented, so now file A and B exists in the google drive folder, each with their own set of data, taking up double the space.

It was a bit surprising that it took a bit of googling and thinking to figure out I could use the --copy-contents flag.


[Permalink] [By morphex] [Linux (Atom feed)] [05 Sep 15:59 Europe/Oslo]