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 and cliend_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_DiVIDED_BY_UnderScores
    
  • This name can be figured out by visiting the Team on Sharepoint and looking for the Copy Link button (possibly you need to enter a subdirectory before you can access the button).
  • Follow the instructions in the interactive menu.
  • The configuration settings expire after a year and you will need to redo these steps.

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

See also this webpage.

  • 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.
  • #+ATTR_HTML: :target _blank Your configuration file contains information for logging in to your cloud services. This means that you should keep your rclone.conf file in a secure location. Better still, encrypt the configuration file as described here

    https://rclone.org/docs/#configuration-encryption

Modified: 2024-02-18 15:55:42 CET

Emacs 29.2 (Org mode 9.6.15)