github.com/swiftstack/ProxyFS@v0.0.0-20210203235616-4017c267d62f/sait/home/swift/bin/resetswift (about)

     1  #!/bin/bash
     2  
     3  # Copyright (c) 2015-2021, NVIDIA CORPORATION.
     4  # SPDX-License-Identifier: Apache-2.0
     5  
     6  if [ "$1" != "1" ] && [ "$1" != "2" ] && [ "$1" != "3" ]
     7  then
     8      echo Arg1 is unexpected: $1
     9      exit 1
    10  fi
    11  
    12  set -e
    13  
    14  SAIT_INSTANCE=$1
    15  
    16  sudo swift-init all kill
    17  
    18  if cut -d' ' -f2 /proc/mounts | grep -q /srv/$SAIT_INSTANCE/node/sdb$SAIT_INSTANCE
    19  then
    20      sudo umount /srv/$SAIT_INSTANCE/node/sdb$SAIT_INSTANCE
    21  fi
    22  sudo truncate -s 0 /srv/swift-disk
    23  sudo truncate -s 1GB /srv/swift-disk
    24  sudo mkfs.xfs -f /srv/swift-disk
    25  sudo mount /srv/$SAIT_INSTANCE/node/sdb$SAIT_INSTANCE
    26  sudo chown swift:swift /srv/$SAIT_INSTANCE/node/sdb$SAIT_INSTANCE
    27  
    28  sudo rm -f /var/log/debug /var/log/messages /var/log/rsyncd.log /var/log/syslog
    29  find /var/cache/swift* -type f -name *.recon -exec rm -f {} \;
    30  sudo systemctl restart memcached