Skip to content

Instantly share code, notes, and snippets.

@ttamg
Last active March 25, 2022 15:02
Show Gist options
  • Save ttamg/c094e86bed3e508077f947197f210c98 to your computer and use it in GitHub Desktop.
Save ttamg/c094e86bed3e508077f947197f210c98 to your computer and use it in GitHub Desktop.
Script to mount GPU server drive on Mac OS - requires SSHFS and MacFUSE
#!/bin/bash
remotedir="bob@192.168.1.199:/gpu" # TODO Add directory on the remote machine
mountdir="/Users/bob/gpu" # TODO Add local directory
echo "Mounting (${mountdir})..."
#Unmount if it's already mounted
if mount | grep "on $mountdir" > /dev/null; then
umount ${mountdir}
fi
#Now mount the remote file system
# (The -o workaround=rename -o noexec are used so kwrite can save files.)
sshfs -o ssh_command='ssh -AKXY' -o workaround=rename -o noexec -o idmap=user -o uid=$(id -u) -o gid=$(id -g) ${remotedir} ${mountdir}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment