-
Notifications
You must be signed in to change notification settings - Fork 255
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adding the patch of Jeroen Hoeckx conc. the added support for DRBD de…
…vices
- Loading branch information
Showing
3 changed files
with
42 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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
31
usr/share/rear/recreate/GNU/Linux/22_create_drbd_configuration.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |