Created
January 28, 2019 00:42
-
-
Save rezamt/e862efe8a3cac5478c7232e72588c9eb to your computer and use it in GitHub Desktop.
umount and clean file system
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/bash | |
cp /etc/fstab /etc/fstb.original | |
FDISKLIST=`fdisk -l|grep "Disk /dev/xvd"|awk '{print $2}'|awk -F: '{print $1}'|grep -v /dev/xvda` | |
for DISK in `echo $FDISKLIST` | |
do | |
DISKNAME=`echo $DISK|awk -F/ '{print $3}'` | |
umount -f $DISK1 || /bin/true | |
rm -rf /disk/$DISKNAME || /bin/true | |
wipefs -f -a $DISK || /bin/true | |
sed -i "/$DISKNAME/d" /etc/fstab | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment