Mounting OneDrive on Linux Using rclone

Body

These instructions are from linuxuprising.com. They are replicated here in case that page ever goes away.

This assumes you are using your Purdue OneDrive, but the steps are still valid for other OneDrive accounts.

rclone should already be installed on all Purdue IT-supported Linux hosts. If it is not, submit a support request.

  1. Run rclone config and select n (new remote)
  2. You will be prompted for the name of the new remote. onedrive will work.
  3. Look through the list for the number next to "Microsoft OneDrive." Enter that number and press enter.
  4. You can continue without entering any information for the next two options. There is no need to enter the Microsoft App Client ID or Secret.
  5. Say n (no) to edit advanced config
  6. For auto config, select y (yes). This should open a tab in your default browser asking you to give rclone access to your OneDrive account. Allow it and close the tab.
  7. Enter the account type, 1 (one, OneDrive Personal or Business)
  8. You will then see accounts listed. The first choice, 0 (zero, typically), is what you want to enter​​​​​​​
  9. You should see something like below. Enter y (yes):
    Found drive 'root' of type 'personal', URL: https://onedrive.live.com/?cid=0f119f51f000000
    Is that okay?
    y) Yes
    n) No
    y/n> y
  10. Then something like below is shown (tokens and other info for your OneDrive configuration). Enter y (yes):
    [onedrive]
    type = onedrive
    token = {"access_token":"GoKSt5YMioiuCWX1KOuo8QT0Fwy+Y6ZeX7M","token_type":"bearer","refresh_token":"7OMvoEAO3l*8BbhS2AMxpTbJW0Y6np9cdql!bwEdYAhJ6XBG0tnR0UK","expiry":"2018-07-26T15:15:13.696368366+03:00"}
    drive_id = f119f51f0a00000
    drive_type = personal
    --------------------
    y) Yes this is OK
    e) Edit this remote
    d) Delete this remote
    y/e/d> y
  11. Enter q (quit) to exit rclone
  12. Create a folder named OneDrive. This folder needs to be on a file system that is "local" to the host you are on.
  13. Mount OneDrive:
    rclone --vfs-cache-mode writes mount onedrive: ./OneDrive
    If you get an error about write access or problems with permissions, then submit a support request.

Now the folder you created will allow you to view and modify your OneDrive files. When you are done, you can Ctrl-C in the terminal/window where you ran the rclone command to unmount OneDrive.

Details

Details

Article ID: 2302
Created
Wed 6/24/26 2:34 PM
Modified
Wed 6/24/26 3:02 PM