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]