Skip to content

Instantly share code, notes, and snippets.

@assafmo
Created February 19, 2019 10:10
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save assafmo/4a876d74591abcca527572ee022a7241 to your computer and use it in GitHub Desktop.
Save assafmo/4a876d74591abcca527572ee022a7241 to your computer and use it in GitHub Desktop.
Safely unmount disk on ubuntu
#!/bin/bash
DEV=$(mount | grep /media/ | awk '{print $1}')
udisksctl unmount -b "$DEV"
udisksctl power-off -b "$DEV"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment