Skip to content

Instantly share code, notes, and snippets.

@jollychang
Created May 25, 2014 15:27
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 jollychang/fd59a521b77822a211f2 to your computer and use it in GitHub Desktop.
Save jollychang/fd59a521b77822a211f2 to your computer and use it in GitHub Desktop.
clean all external drive for osx-ntfs bug
list=`diskutil list | grep Windows | awk '{print $3}'`
for l in $list;
do sh ./clean_hd.sh $l;
done
#!/bin/sh
echo $1
name=$1
# Define your function here
clean_hd(){
sudo diskutil unmount "$name"
echo "after umountDisk"
diskutil list
sudo rm -rf "/Volumes/$name"*
echo "after remove link"
ls /Volumes/
sudo diskutil mountDisk "$name"
echo "after mount disk"
sudo ls "/Volumes/$name"*
}
clean_hd
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment