Guide: Mounting Google Drive to WSL
This guide documents the steps taken to mount your Google Drive (ritooo@gmail.com) to your WSL environment.
Prerequisites
- rclone: A command-line program to manage files on cloud storage.
- FUSE: Filesystem in Userspace, required for mounting cloud drives.
Steps Taken
1. Verify rclone Installation
We checked if rclone was installed and configured.
rclone version
rclone config show
2. Verify Account Access
We checked the contents of the gdrive remote to ensure it was the correct account.
rclone lsd gdrive: --max-depth 1
3. Set Up Mount Point
Initially, /mnt/gdrive was attempted, but it was owned by root. To avoid permission issues and sudo password requirements, we created a mount point in your home directory:
mkdir -p ~/gdrive
4. Mount Google Drive
We used the following command to mount the drive in the background:
rclone mount gdrive: ~/gdrive --vfs-cache-mode full &
--vfs-cache-mode full is recommended for better compatibility with applications that expect a local filesystem.
5. Verify Mount Status
You can check if the drive is mounted using:
mount | grep gdrive
ls ~/gdrive
How to Mount Automatically on Startup
To ensure the drive mounts every time you start WSL, you can add the mount command to your ~/.bashrc or ~/.zshrc file:
# Add this to the end of your ~/.bashrc
if ! mount | grep -q "$HOME/gdrive"; then
rclone mount gdrive: ~/gdrive --vfs-cache-mode full --daemon
fi
Komentar