User Tools

Site Tools


linux:onedrive:linux

Using One Drive on Linux

Setup One Drive

  • 1. Start configuring OneDrive in RClone by running the config command.
# rclone config
  • 2. You will be prompted with configuration options. Choose n to create a new remote.
No remotes found - make a new one
n) New remote
s) Set configuration password
q) Quit config
n/s/q>  n
  • 3. Enter for instance “UL-OneDrive” as the name for the remote.
name> UL-OneDrive 
  • 4. For storage type enter “onedrive”.
Type of storage to configure.
Enter a string value. Press Enter for the default ("").
Choose a number from below, or type in your own value
...
21 / Mega
   \ "mega"
22 / Microsoft Azure Blob Storage
   \ "azureblob"
23 / Microsoft OneDrive
   \ "onedrive"
24 / OpenDrive
   \ "opendrive"
25 / Openstack Swift (Rackspace Cloud Files, Memset Memstore, OVH)
   \ "swift"
...
Storage> onedrive
** See help for onedrive backend at: https://rclone.org/onedrive/ **
  • 5. Leave client_id and client_secret empty. Press enter to leave the fields blank.
Microsoft App Client Id 
Leave blank normally.
Enter a string value. Press Enter for the default ("").
client_id> 
Microsoft App Client Secret
Leave blank normally.
Enter a string value. Press Enter for the default ("").
client_secret> 
  • 6. Do not go for advanced config, type n
Edit advanced config? (y/n)
y) Yes
n) No (default)
y/n> n
  • 7. Press y to use auto configuration.
Remote config
Use auto config?
 * Say Y if not sure
 * Say N if you are working on a remote or headless machine
y) Yes (default)
n) No
y/n> y
  • 8. A browser window will open to a Microsoft login screen. Login using your ULCN account information.
  • 9. When prompted for config_type choose “onedrive”, type 1.
Choose a number from below, or type in an existing value
 1 / OneDrive Personal or Business
   \ "onedrive"
 2 / Root Sharepoint site
   \ "sharepoint"
 3 / Type in driveID
   \ "driveid"
 4 / Type in SiteID
   \ "siteid"
 5 / Search a Sharepoint site
   \ "search"
Your choice> 1
  • 10. You’ll be prompted to connect to the root of your OneDrive. Press y to continue.
Found 1 drives, please select the one you want to use:
0: OneDrive (business) id=b!9lLca7qW5Uqos5tnc3zl3xVQs7GKhd1Pi_6ugA5eVjVYitM-xxxxxxxxxxxxxx
Chose drive to use:> 0
Found drive 'root' of type 'business', URL: https://leidenuniv1-my.sharepoint.com/personal./deuler_vuw_leidenuniv_nl/Documents
Is that okay?
y) Yes (default)
n) No
y/n> y
  • 11. Press y to confirm that the remote is ok.
--------------------
[UL-OneDrive]
type = onedrive
token = {"access_token":"xxx...xxx"}
drive_id = b!9lLca7qW5Uqos5tnc3zl3xVQs7GKhd1Pi_6ugA5eVjVYitM-xxxxxxxxxxxxx
drive_type = business
--------------------
y) Yes this is OK (default)
e) Edit this remote
d) Delete this remote
y/e/d> y
  • 12. Press q to close the remote configuration procedure.
Current remotes:

Name                 Type
====                 ====
UL-OneDrive          onedrive  

e) Edit existing remote
n) New remote
d) Delete remote
r) Rename remote
c) Copy remote
s) Set configuration password
q) Quit config
e/n/d/r/c/s/q> q
  • 13. Create a “OneDrive” directory in your home folder to mount the remote that you just created.
mkdir ~/OneDrive

Mount One Drive

Mount the remote onedrive by using the command:

rclone --vfs-cache-mode writes mount UL-OneDrive: ~/OneDrive &

And now the drive is mounted:

# df ~/OneDrive  
Filesystem      1K-blocks  Used  Available Use% Mounted on
UL-OneDrive:   1073741824  2952 1073738868   1% /home/deul/OneDrive

Unmount One Drive

To unmount the onedrive mount point we must use the fusermount command:

fusermount -u /home/deul/OneDrive

Now check if the mount point is still used or cascades down to the home drive:

df ~/OneDrive
Filesystem               1K-blocks       Used  Available Use% Mounted on
homeserver:/export/home 6390518784 4040379904 2028000256  67% /home

Indeed onedrive is not mounted on this mountpoint any more

linux/onedrive/linux.txt · Last modified: 2024/01/16 19:42 by deul