[DRBD-user] fsck

Joachim Banzhaf (compuserve) joachimbanzhaf at compuserve.de
Tue Mar 7 12:40:08 CET 2006

Note: "permalinks" may not be as permanent as we would like,
direct links of old sources may well be a few messages off.

Am Dienstag, 7. März 2006 00:31 schrieb Nate Reed:
> Corey,
> Perhaps you can clear up my confusion about how DRBD (and Heartbeat) is
> supposed to work.  We're running Heartbeat and DRBD, and we were having a

I'll try.

> problem that we thought might be caused by a bad filesystem.  The
> Filesystem script would mysteriously error out on startup.  It wasn't clear

an errormessage from your logs would be helpful here...

> to me if there was a fsck ever performed by either Heartbeat's resource
> script or DRBD, or even when a filesystem actually gets created.  We have
> since re-installed, and everything seems to work OK.  It might have gotten
> out-of-sync when one of the nodes was reinstalled - not sure.
> As for the original question, we did find this on google:
> http://www.drbd.org/fileadmin/drbd/doc/0.5.8/drbd.conf.html (see
> "fsck-cmd"), but it appears to be out-of-date since DRBD complains about
> fsck-cmd in our config file.

You are right. This is outdated. Drbd stopped caring about filesystems long 

> After reviewing the Getting Started guide, I attempted
> "mount /dev/drbd0 /shared" and got "Operation not permitted."  So, I tried
> "mkreiserfs /dev/drbd0" and repeated the mount command, then it worked.
> Am I missing something?  The order of operations performed by Heartbeat
> needs to be something like this:
> 1. make the node primary
> 2. create a mount point /shared (done in /etc/fstab)
> 3. create a filesystem on /dev/drbd0 (if this is the first time)
> 4. mount /dev/drbd0 /shared

No. #2 and #3 are usually done during installation by you.
#2 is not done in /etc/fstab. For filesystems not managed by heartbeat, you 
define some standard mount options for your filesystems there but for 
heartbeat managed filesystems you do that with parameters to the Filesystem 
resource script. 

Heartbeat decides which resources should run on which node.
What these resources do is not known by heartbeat. So it does not care about 
creating filesystems on partitions or doing fsck on filesystems. It only 
cares about the resourcename and some operations on it (start, stop, 
monitor). Only the resource agents (drbddisk, Filesystem, ...) know about the 

DRBD knows only about partitions (or, more exactly, about block devices). 
Whether you use the blockdevice for raw database storage, a filesystem or 
something else is up to you.

Filesystems are stored on blockdevices. They need to be available already 
which means,
a) you created them before use (at install time). 
b) you provided the mountpoint where you want to access them (at install time)
c) you told heartbeat to activate the blockdevice (drbd) before use. (cib, or 
haresources for heartbeat V1.x)

Generally, the resource agent scripts expect an already configured 
environment. Drbddisk e.g. expects a configured, running drbd block device, 
Filesystem expects an existing mountpoint and a clean filesystem on the 

> During Heartbeat's startup #4 failed and for some reason it seems like #3
> was never done.

Now you know, this is expected if you didn't do #2 during reinstall.
#3 is not necessary, because drbd will sync the existing filesystem of the 
other node to the new node. It would have been necessary during the first 
time install on one of the nodes.


Joachim Banzhaf

More information about the drbd-user mailing list