How to Remove DRBD Device|Volume

How to Remove DRBD Device|Volume

In a cluster some times it might required to decommission exiting cluster and create new cluster according to the new requirement. In this demonstration we will remove or destroy DRBD cluster resource and volumes.

Topic

  • How to remove or destroy DRBD disk or volume on Centos 7|RHEL 7?
  • How to remove or destroy DRBD cluster in Linux?
  • How to remove or destroy DRBD cluster in Centos|RHEL

Solution


In this demonstration we will remove or destroy DRBD cluster resource and volumes.

Remove Block Device on Secondary Node
  • It is necessary to remove a block device on the Secondary Node first.
  • Execute the following command on one of the cluster node to view DRBD status.
[root@node1 ~]# drbdadm status
postgres role:Primary
  disk:UpToDate
  node2.example.local role:Secondary
    peer-disk:UpToDate

  • We can see that DRBD state is primary on node1 and secondary on node2.

  • Execute the following command on secondary node to to detach DRBD volume.

[root@node2 ~]# drbdsetup detach /dev/drbd0

postgres role:Secondary
  disk:Diskless
  node1.example.local role:Secondary
    peer-disk:Diskless

  • Make node1 from primary to secondary and detach DRBD volume.
[root@node1 ~]# drbdadm secondary postgres

[root@node1 ~]# drbdsetup detach /dev/drbd0
[root@node1 ~]# drbdadm status
postgres role:Secondary
  disk:Diskless
  node2.example.local role:Secondary
    peer-disk:Diskless

  • Stop DRBD service on cluster nodes and remove resource configuration file.
[root@node1 ~]# systemctl stop drbd
[root@node2 ~]# systemctl stop drbd
[root@node1 ~]# rm -rf /etc/drbd.d/*.res
[root@node2 ~]# rm -rf /etc/drbd.d/*.res


You May Also Like

About the Author: Andrew Joseph

2 Comments

  1. you’re truly a good webmaster. The site loading speed is incredible. It seems that you are doing any unique trick. Furthermore, The contents are masterpiece. you’ve performed a great process in this subject!

  2. I blog quite often and I truly thank you for your content. Your article has truly peaked my interest. I’m going to book mark your blog and keep checking for new details about once per week. I opted in for your RSS feed as well.

Leave a Reply

Your email address will not be published. Required fields are marked *