Mount UvA OneDrive and SharePoint libraries on Linux with rclone
Introduction
This manual will show how you can mount your personal OneDrive folder or shared teams libraries on a local linux file system using the utility rclone.
Download / installation
rclone
is a utility that is available for all major platforms,
including all major linux distributions. It is likely the software
is already packaged for your distribution, otherwise follow these
download instructions. This manual assumes at least version 1.54.0
of rclone.
Configuration
On the CLI execute
rclone config
and go through the interactive setup following the instructions at this webpage.
- Choose "Microsoft OneDrive ('onedrive')" at 'Type of storage'
- You can leave
client_id
andcliend_secret
empty - Choose "Microsoft Cloud Global" at "Choose national cloud region for OneDrive."
- Choose default values
After the authorization code has been retrieved you are given a choice:
- To setup the config for your person OneDrive choose "OneDrive Personal or Business". Follow the instructions in the interactive menu.
To setup the config for a shared library (typically the files that are part of a Team) choose "Sharepoint site name or URL" and paste the url of UvA's sharepoint with the name of the library. Something like
https://amsuni.sharepoint.com/sites/SOME_NAME_IN_CAPITAL_LETTERS
Follow the instructions in the interactive menu.
Mounting
In order to mount a configured drive you can execute the following command on CLI
rclone mount --daemon --vfs-cache-mode full name_remote: some/local/path
- Note that you need the
vfs-cache-mode
option with value full to make the mount act like a regular filesystem.
Unmount
To unmount the remote drive use
fusermount -u path/to/local/mount
Final comments
After a graphical setup like this one, it can be used on a headless
machine by copying $HOME/.config/rclone
.