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
 


Tags:

drbd, partition, commandsthis, assumes, ve, quot, diskless, doesn, renamed, eg, sdb, sda, reboot, permanently, resource, edit, etc, conf, hosts, reload, config, recovering, drbdadm, md, module, userland, preferably, kernel, versions, meta, initializing, initialized, bitmap, successfully, attach, recovered, sync, proc, ll, rsyncing, newly, disk, api, proto, git, hash, ae, dc, xemul, ovzcore, sw, ru, cs, synctarget, ro, secondary, primary, ds, inconsistent, uptodate, ns, nr, dw, bm, pe, ua, ap, ep, wo, oos,

Latest Articles

  • Linux qemu-kvm How To Enable Soundcard in Guestl
  • QEMU-KVM Windows and Server Guest Installs Mouse Tracking Pointer Location Solution
  • SSH Keep Alive To stop Disconnections
  • Linux How To Disable SATA NCQ For Better Performance
  • the sign-in method you're trying to use isn't allowed. For more info, contact your network administrator - solution for active directory
  • gsmartcontrol for Windows to Check the SMART S.M.A.R.T status
  • WebRTC Vulnerability Shows Local IP Address Even When Using a Proxy or VPN Firefox Fix And Disable Solution
  • chroot in Linux Howto Simple and Easy Guide
  • qemu-kvm qemu-system Image format was not specified for '/mnt/space/cucm12.img' and probing guessed raw. Automatically detecting the format is dangerous for raw images, write operations on block 0 will be restricted. Specify the 'ra
  • Linux Over VNC VMWare How To Switch Virtual Terminals Console Without Using Ctrl+Alt+F1
  • Skype For Business 2015 and 2019 Guide, Reference, Howto and Troubleshooting Solutions
  • Centos 6 or 7 no DHCP IP during startup on first boot or reboot solution
  • Debian / Mint / Ubuntu net-tools packages provides netstat, ifconfig, route, arp and other classic network admin tools
  • Linux Mint XWindows Ubuntu MATE or Cinnamon How To Restart The GUI / Graphics / Session if it freezes without losing current windows or programs
  • Linux bash prompt why does it not show username@host and the current directory?
  • Microsoft SQL Server Check What Version is Running
  • How to install and setup LXC Containers (OpenVZ alternative) on Centos 6 / 7
  • Cisco CUCM Unified Communication Manager Howto Guide and Tutorials
  • SSH persistent and automatic login script for proxy
  • SSH proxy/command in the background or from cron script