Skip to content

Instantly share code, notes, and snippets.

@hector6872
Created October 31, 2017 19:02
Show Gist options
  • Save hector6872/a59a900ae64c4cb3fcb5f0f3b797eb4b to your computer and use it in GitHub Desktop.
Save hector6872/a59a900ae64c4cb3fcb5f0f3b797eb4b to your computer and use it in GitHub Desktop.
copyToUSB.sh
#!/bin/bash
SOURCE=$1
if [[ -z $SOURCE ]]; then
echo "Usage: $0 [source]" >&2
exit
fi
sudo mkdir -p /mnt/sd1
sudo umount /dev/sdb1
sudo mount -o rw,users,umask=000 /dev/sdb1 /mnt/sd1
rsync --info=progress2 "$SOURCE" /mnt/sd1
sudo umount /mnt/sd1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment