#this script assums that you have the second host up and the two DRBDs were # synced prior to the start, and that this host was the last one primary. #also heartbeat is NOT running. METADATA_PARTITION=/dev/hda13 #make sure drbd is stopped. service drbd stop #Wipe the metadata out. echo "wiping out $METADATA_PARTITION." sleep 2; #twich time if something seems wrong. :) time dd if=/dev/zero of=$METADATA_PARTITION bs=4k #for 1GB the above takes ~30sec sync #start drbd backup. service drbd start while grep SyncTarget /proc/drbd >>/dev/null; do date; cat /proc/drbd; sleep 10; done #become primary, THIS IS IMPORTANT TO CAUSE THE LOCK. drbdadm primary test0 sleep 1; cat /proc/drbd; sleep 1; echo "begining mke2fs." time mke2fs -j /dev/drbd0; uname -a echo "still alive. And DONE!"