If you want to clean the system having pureScale or want to drop pureScale instancefor installing a fresh instance of pureScale, follow on:

Obviously, you want to follow the steps given in DB2 Knowledge Center first.

If you have a working pureScale install where you can see the output from db2instance -list, use the following commands to drop the instance.
# db2idrop -g <instancename>
# db2_deinstall -a

But GPFS is still there and not removed. Please follow this link to remove GPFS gracefully – https://ibm.biz/Bd4y9K

For any reason, if you get error in either db2idrop or db2cluster commands to remove, you can follow this destructive method to remove things by twisting arms of OS. Know what you are doing as this is a destructive method like playing with double-edged sword. The order of commands are important. Say, for example, why do I need to run recfgct if I am going to uninstall anyway. On AIX, it will help uninstall, otherwise you are stuck in uninstall as it complains that the system is still in use.

  • Find out the names of the mount point, device names for GPFS file system from /etc/filesystems (AIX) or /etc/fstab (Linux) file and take a note of all device names such as /dev/db2fs1 etc.
  • Find out the names of the disks from lspv command (AIX) or lsscsi (Linux), which are the shared disks. You will need names of the shared disk to wipe them out using dd command.
  • Run the following command to destroy RSCT configuration.
    # rm -fr /var/ct
    # rm -fr /var/ha
    # /usr/sbin/rsct/install/bin/recfgct
  • Run the following command to destroy the GPFS configuration. After you are done using this command, you can’t recover GPFS.
    # rm -fr /var/mmfs
  • Remove device names from /dev directory as per the list of GPFS devices from /etc/filesystem or /etc/fstab
    # rm -f /dev/db2fs1 and other GPFS devices.
  • Remove entries from /etc/filesystem (AIX) or /etc/fstab (Linux) for GPFS mount points.
  • Run the following command to destroy DB2 configuration.
    # rm -fr /var/db2
  • Remove db2 software and TSA. Find out the location of the db2 software by running db2ls command
    # rm -fr /opt/ibm/db2
    # rm -fr /opt/IBM
  • Uninstall RSCT, GPFS and TSA by using installp -u (AIX) or by using the following commands in Linux
    ############# Remove RSCT RPMS ###########
    for x in `rpm -qa | grep -i rsct`; do echo $x; rpm -e --nodeps --allmatches --noscripts $x; done
    ############# Remove GPFS RPMS ###########
    for x in `rpm -qa | grep -i gpfs`; do echo $x; rpm -e --nodeps --allmatches --noscripts $x; done
    ############# Remove sam ###################
    for x in `rpm -qa | grep -e ^sam[\.-]`; do echo $x; rpm -e --nodeps --allmatches --noscripts $x; doneRemove all db2 entries from /etc/services file
  • Remove sqllib from the instance user home directory
    $ rm -fr ~/sqllib
  • Reinstall rsct core again (AIX only and not Linux) and apply any Service Packs or eFixes. Do not install GPFS or TSA and let DB2 install handle it appropriately.
  • Reboot the machine or LPAR.

If you want to remove GPFS from the shared disks, run dd command against the disk to wipe out the content. This is a destructive command and you should know what you are doing. The syntax is not given here.