Removing DRBD Devices and Volumes from Highly Available NFS
In working through attempting to add a new volume without causing an outage with a highly available NFS setup I had to come up with a methodology to remove the DRBD device to effectively rinse and repeat until we came up with the right steps. Below outlines the steps to remove a DRBD block device/volume.
Remove Block Device on Secondary Node
Note: It is necessary to remove the block device on the Secondary Node first so you must use “drbdadm status” to find that node.
drbdsetup detach /dev/drbd1
drbdsetup del-minor /dev/drbd1
Remove Volume/Device entry from /etc/drbd.d/nfs.res
volume 1 {
device /dev/drbd1;
disk /dev/sdc1;
meta-disk internal;
}
Move Primary DRBD/NFS functions to Secondary Node
pcs resource move --master ms_drbd_nfs nfs2.hdp.senia.org
Remove Volume Device from node that was Primary Node that is now Secondary Node
drbdsetup detach /dev/drbd1
drbdsetup del-minor /dev/drbd1
Remove Volume/Device entry from /etc/drbd.d/nfs.res
Move Primary Node back to original server
volume 1 {
device /dev/drbd1;
disk /dev/sdc1;
meta-disk internal;
}
pcs resource move --master ms_drbd_nfs nfs1.hdp.senia.org