Skip to content

Commit

Permalink
Adding the patch of Jeroen Hoeckx conc. the added support for DRBD de…
Browse files Browse the repository at this point in the history
…vices
  • Loading branch information
gdha committed Dec 16, 2010
1 parent a0ebe80 commit 5a3bfb3
Show file tree
Hide file tree
Showing 3 changed files with 42 additions and 0 deletions.
2 changes: 2 additions & 0 deletions usr/share/rear/CHANGES
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
Version 1.9.0 - not released
---------------------------
2010-12-15 GD * add DRBD support patch of Dag/Jeroen (sponsored by Belgian Federal Police #3124341)
* doc/configuration-examples.txt added for the beginners.
2010-12-14 GD * lib/network-functions.sh: added my_ipcalc replacement for ipcalc (only standard in RHEL/Fedora)
* minor fixes in skel/default/bin/dhclient-script
* skel/default/etc/scripts/system-setup.d/58-start-dhclient.sh loop over valid interfaces
Expand Down
9 changes: 9 additions & 0 deletions usr/share/rear/prep/GNU/Linux/29_include_drbd.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# Include DRBD tools if it's running on the system

if lsmod | grep -q drbd ; then
REQUIRED_PROGS=("${REQUIRED_PROGS[@]}" drbdadm drbdsetup drbdmeta)
COPY_AS_IS=( "${COPY_AS_IS[@]}" /etc/drbd.* )
Log "Including DRBD tools."

# note that filesystems on DRBD might have to be excluded from the backup
fi
31 changes: 31 additions & 0 deletions usr/share/rear/recreate/GNU/Linux/22_create_drbd_configuration.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# Recreate the DRBD configuration if needed
# This covers the case of LVM on DRBD, where the DRBD is on physical partitions
# or on software raid.

# NOTE: "drbdadm -s /bin/drdbsetup" might be needed for some versions of DRBD

if [ -e /etc/drbd.conf ] ; then
Log "Restoring DRBD configuration."

modprobe drbd
if [ $? -ne 0 ] ; then
LogPrint "Failed to load DRBD module, please configure DRBD manually."
fi

mkdir -p /var/lib/drbd

# LVM on DRBD
# Recreate devices
drbdadm create-md all

# Only attach, do not start synchronization
drbdadm attach all
drbdadm -- --overwrite-data-of-peer primary all
if [ $? -ne 0 ] ; then
LogPrint "Failed to restore DRBD configuration, please configure DRBD manually."
fi

## DRBD on LVM would look like:
# drbdadm create-md all
# drbdadm up all
fi

0 comments on commit 5a3bfb3

Please sign in to comment.