Skip to content

dobber/md-split

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 

Repository files navigation

md-split

A simple script that check if mdraid has a split-brain situation. Best to add it to your /etc/profile and show you information on login.

Why

In extremely rare situations you can have a split-brain with your raid devices. You can reproduce it by issuing the following situation.

mdadm --create /dev/md0 --level=1 --raid-devices=2 /dev/sdc1 /dev/sdd1
mkfs.xfs /dev/md0
mount /dev/md0 /mnt/
cp -a /usr/local/* /mnt/
umount /mnt/
mdadm --stop /dev/md0
mdadm --assemble /dev/md0 /dev/sdc1
mdadm --run /dev/md0
mdadm --assemble /dev/md1 /dev/sdd1
mount /dev/md0 /mnt/
rm -r /mnt/*

Now you have a split-brain situation because /dev/md0 and /dev/md1 have the same UUID, but different data on it.

blkid /dev/md0
blkid /dev/md1
mdadm --detail /dev/md0
mdadm --detail /dev/md1

It is possible that the next time you reboot your server, an automated "mdadm --assemble --scan" and /etc/fstab that uses UUIDs to mount the wrong drive in your directory.

Example

Split brain reportin on login

Install

Copy the script in your /usr/local/bin/ directory Add it to /etc/profile

git clone https://github.com/dobber/md-split.git
cd md-split
cp -a md-split.sh /usr/local/bin/
echo "/usr/local/bin/md-split.sh" >> /etc/profile

Nagios check

comming soon

About

A simple script that check if mdraid has a split-brain situation. Best to add it to your /etc/profile and show you information on login.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages