0

I have two drbd nodes, one master and one slave.

I want to use existing drbd disk after a fresh system install while the other node isn't present.

Is it possible to force drbd for this?

Consider the following scenario.

  • Has lost slave node (it's broken) and working with only master node for a while
  • Updated the master node's operating system (a fresh install)
  • Have placed the drbd configuration files for drbd
  • Want to keep old disk content

1 Answers1

1

As long as you're certain that the future peer's disk is going to be the same size, or bigger than, the Primary you're about to force promote, then you shouldn't run into any troubles:

# drbdadm primary <res> --force

If the future disk ends up being smaller, even by a single sector, you will not be able to connect the two devices. DRBD exchanges disk properties when the peers first connect.

Matt Kereczman
  • 1,899
  • 9
  • 12
  • Thanks for the answer. After a fresh install I do these steps: 1) create-md 2) up and 3) primary force. However, I couldn't mount drbd disk. Mount command gives wrong fstype, bad option ... error. If I format the the partititon, I can mount it but all of the content is gone. – Ricardo Cristian Ramirez Jan 03 '18 at 17:53
  • Ouch... To me, that sounds like you overwrote the end of the filesystem with DRBD's metadata creation. DRBD warns if it detects a filesystem where it's going to place the metadata. Did you see any message indicating this might be the case? – Matt Kereczman Jan 04 '18 at 18:31
  • 1
    I don't remember which messages that I got. Actually, I didn't so cautious since I've been just experimenting with drbd. However, I realized that, as you said, new md creation overwrites the old one. Dumping md and restroing it then making it primary solved my problem. Thank you again. – Ricardo Cristian Ramirez Jan 05 '18 at 14:17