Skip to content

Instantly share code, notes, and snippets.

@tigerhawkvok
Created August 5, 2021 18:34
Show Gist options
  • Save tigerhawkvok/82b63753037eb8be5e6ce04dd8b5ed41 to your computer and use it in GitHub Desktop.
Save tigerhawkvok/82b63753037eb8be5e6ce04dd8b5ed41 to your computer and use it in GitHub Desktop.
Mount a removable drive in WSL
# Works in .bashrc too
# Mount the D: drive
test -r /mnt/d || eval "$(sudo mkdir /mnt/d)"
test -r /mnt/d/'System Volume Information' || eval "$(sudo mount -t drvfs D: /mnt/d)"
test -r /mnt/d/'System Volume Information' && echo 'D: successfully mounted' || echo 'Failed to mount removable drive'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment