Most Linux users try to “sync” OneDrive.
That is the mistake.
Syncing cloud storage in development environments causes:
- corrupted node_modules
- broken Git repositories
- infinite file conflicts
- slow builds
- SSD space exhaustion
The correct approach is not synchronization — it is mounting.
We will mount OneDrive as a native filesystem using rclone, so Linux treats cloud storage like a network drive.
Result:
• No duplicated files
• No local storage consumption
• No repo corruption
• Works permanently after reboot
Step 1 — Install rclone
sudo apt update
sudo apt install rclone -y
Step 2 — Connect Microsoft Account
rclone config
Choose:
New remote → name: onedrive
Storage → onedrive
Region → default (global)
Auto config → yes
Type → OneDrive Personal
Select the drive called OneDrive
Confirm with y
Test connection:
rclone lsd onedrive:
If you see your folders → authentication is correct.
Step 3 — Create mount point
mkdir ~/OneDrive
Temporary mount test:
rclone mount onedrive: ~/OneDrive --vfs-cache-mode writes
Open file manager → cloud appears like a local disk.
Step 4 — Permanent mount (systemd user service)
Create service:
mkdir -p ~/.config/systemd/user
nano ~/.config/systemd/user/onedrive.service
Paste:
[Unit]
Description=Rclone OneDrive Mount
After=network-online.target
[Service]
Type=simple
ExecStart=/usr/bin/rclone mount onedrive: /home/$USER/OneDrive --vfs-cache-mode writes --buffer-size 64M --dir-cache-time 12h
ExecStop=/bin/fusermount -u /home/$USER/OneDrive
Restart=on-failure
[Install]
WantedBy=default.target
Enable:
systemctl --user daemon-reload
systemctl --user enable onedrive
systemctl --user start onedrive
Reboot.
Your cloud storage now behaves like a native Linux drive.
Important Best Practice
Never store Git repositories inside cloud drives.
Correct architecture:
Local:
~/projects
Cloud:
~/OneDrive/docs
~/OneDrive/assets
~/OneDrive/backups
Cloud stores knowledge.
Git stores systems.
This approach eliminates dependency on a single machine and makes development environments portable across devices.
Top comments (0)