How to recover from dead DRBD partition/hard drive in two simple commands

This assumes that you've at least created the correct partition for your DRBD already.
Notice that I am "diskless", that's because either your DRBD partition doesn't exist/has been renamed (eg. sdb becomes sda when sdb dies and you reboot) or because that drive is really actually dead/gone.

*If you need to permanently change the partition/device for your resource be sure to edit /etc/drbd.conf on both hosts and reload the config.

(replace r0 with the name of the resource you're recovering from):
drbdadm create-md r0

DRBD module version: 8.3.4
   userland version: 8.3.8
preferably kernel and userland versions should match.
Writing meta data...
initializing activity log
NOT initialized bitmap
New drbd meta data block successfully created.

drbdadm attach r0


That's all there is to it, you're recovered and just need to wait for the sync to complete.


Check /proc/drbd and you'll see it is rsyncing to your newly added disk.

cat /proc/drbd
version: 8.3.4 (api:88/proto:86-91)
GIT-hash: 70a645ae080411c87b4482a135847d69dc90a6a2 build by xemul@ovzcore.sw.ru, 2009-10-12 19:29:01
 0: cs:SyncTarget ro:Secondary/Primary ds:Inconsistent/UpToDate A r----
    ns:0 nr:378692 dw:378340 dr:0 al:0 bm:22 lo:13 pe:1478 ua:11 ap:0 ep:1 wo:b oos:487894364
    [>....................] sync'ed:  0.1% (476456/476828)M
    finish: 2:08:56 speed: 63,056 (63,056) K/sec
 

Latest Articles

  • Xen how to mount disk images off-line and access data
  • Xen non-HVM container won't work/boot anymore
  • how to exit xen console session from xm
  • Skype Linux/Ubuntu Sound Echo/Distortion Poor Quality Problem Fix Solution
  • Ubuntu 10.04 Flash Videos have tearing/lines Solution
  • File /etc/vz/conf/ve-vps.basic.conf-sample not found: No such file or directory - Openvz Error solution
  • Ubuntu 10 Nvidia Drivers Not Updated After Kernel Update Solution/How-To Manually Rebuild nvidia kernel modules for Ubuntu
  • What's Needed To Fix Linux
  • mdadm/Debian problem
  • iptables block torrents/torrenting
  • vmware Failed to initialize monitor device 95% power on
  • OpenVPN don't use bridgestart.sh or bridge at all use iptables
  • postfix lopback error solution
  • Drupal/MySQL database error: PDOException: SQLSTATE[42000] [1044] Access denied for user 'db_user'@'localhost' to database 'dbname' in lock_may_be_available() (line 167 of /home/user/public_html/includes/lock.inc).
  • How To Burn ISO Image using cdrtools/dvdrtools for Linux/Unix Ubuntu/Debian/RHEL/Centos etc..
  • Ubuntu Suspend Solution Fix blank screen laptop/computer won't come back
  • iPhone Restore/Backup Location of Notes and Contact/Address Book
  • Install Android SDK and start testing on Debian/Ubuntu: How To Guide/Tutorial
  • gocr - free Linux OCR (Optical Character Recognition) conversion tool
  • Linux Kernel Panic Messages - Symptoms of bad RAM module/stick