Onedrive Rclone
This guide walks you through setting up Microsoft OneDrive on Linux using rclone.
Prerequisites
- rclone installed on your Linux system
- A Microsoft OneDrive account
- A web browser for authentication
Installation
Configuration Steps
1. Start rclone Configuration
2. Create a New Remote
When prompted, select:
nfor New remote- Enter a name for your remote (e.g.,
OneDrive)
3. Select Storage Type
- Choose option
38for Microsoft OneDrive - Or type
onedrive
4. OAuth Configuration
Leave the following blank (press Enter):
client_idclient_secret
5. Choose Region
Select your region:
1for Microsoft Cloud Global (most common)2for US Government3for Germany4for China
6. Authentication
When asked “Use web browser to automatically authenticate?”:
- Select
y(Yes) - Your browser will open automatically
- If it doesn’t, copy and paste the provided URL
- Log in to your Microsoft account and authorize rclone
7. Select Drive Type
Choose your connection type:
1for OneDrive Personal or Business (most common)2for Root Sharepoint site- Other options for advanced configurations
8. Select Drive
If you have multiple drives, select the appropriate one (usually option 1 for your main OneDrive).
9. Confirm Configuration
- Review the configuration
- Select
yto keep the remote - Select
qto quit config
Mount Script
Create a script to easily mount your OneDrive:
Save this as onedrive.sh and make it executable:
Usage
Mount OneDrive
Run your script:
Or manually:
Notes
- The configuration file is stored at
~/.config/rclone/rclone.conf - Make sure the mount point directory (
~/OneDrive) exists before mounting - The
--vfs-cache-mode writesflag improves performance for write operations - Access tokens are automatically refreshed by rclone