Created
May 25, 2014 15:27
-
-
Save jollychang/fd59a521b77822a211f2 to your computer and use it in GitHub Desktop.
clean all external drive for osx-ntfs bug
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
list=`diskutil list | grep Windows | awk '{print $3}'` | |
for l in $list; | |
do sh ./clean_hd.sh $l; | |
done |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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