-
-
Save notmyname/a7e55a7e46eeb6b5332b1f1a800e7410 to your computer and use it in GitHub Desktop.
reset saio script
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 | |
# redirect stdout and stderr to /tmp/resetswift.log | |
exec 3>&1 4>&2 >/tmp/resetswift.log 2>&1 | |
# stop swift | |
swift-init all stop | |
# reset logs | |
sudo rm -rf /var/log/swift/ | |
sudo mkdir -p /var/log/swift | |
sudo chown -R syslog.adm /var/log/swift | |
sudo chmod -R g+w /var/log/swift | |
sudo service rsyslog restart | |
#reset memcached | |
sudo systemctl restart memcached.service | |
# reset drives | |
sudo umount -f /srv/1/node/d1 | |
sudo mkfs.xfs -f -L d1 /dev/sdb | |
sudo umount -f /srv/2/node/d2 | |
sudo mkfs.xfs -f -L d2 /dev/sdc | |
sudo umount -f /srv/3/node/d3 | |
sudo mkfs.xfs -f -L d3 /dev/sdd | |
sudo umount -f /srv/4/node/d4 | |
sudo mkfs.xfs -f -L d4 /dev/sde | |
sudo umount -f /srv/1/node/d5 | |
sudo mkfs.xfs -f -L d5 /dev/sdf | |
sudo umount -f /srv/2/node/d6 | |
sudo mkfs.xfs -f -L d6 /dev/sdg | |
sudo umount -f /srv/3/node/d7 | |
sudo mkfs.xfs -f -L d7 /dev/sdh | |
sudo umount -f /srv/4/node/d8 | |
sudo mkfs.xfs -f -L d8 /dev/sdi | |
sudo mount -a # all the references are in /etc/fstab | |
sudo chown -R swift:swift /srv/*/node/* | |
# restore stdout and stderr | |
exec 1>&3 2>&4 | |
echo "Swift reset finished" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment