I was going through the configuration of DRBD on two nodes. The DRBD has already configured, but I would like to enable the dual primary mode feature.

On drbd site I have seen that it requires the use of a shared cluster file system that utilizes a distributed lock manager like GFS and OCFS2.

is it possible with ext3 file system ?

Thanks in advance.

  • Can you clarify why you want to enable the dual primary mode? Just wanting to do it does not make much sense, there must be something that is making you want to enable it. – chutz Dec 28 '12 at 12:42

No, it's not possible. A non-cluster file system can only be used by one machine at a time and if you use it in dual-primary mode on more than one machine, filesystem corruption is guaranteed!

The reason is that the two machines using this filesystem will not know which modification the other makes and there will be conflicts pretty soon.

  • @Sathish: I've no idea what additional details you require. It's not possible with ext3 and there is no way around it. – Sven Nov 28 '12 at 17:50
  • It is possible, just a very bad idea. That is the reason cluster filesystems provide a way for the nodes to communicate about updates, locks, etc. – Rik Schneider Nov 30 '12 at 0:51

Short answer: It is possible but ill advised.

Longer answer: ext2, ext3, and ext4 filesystems do not provide the locking or coordination needed to handle cases where the file system is being written to by more than one host. These file systems were designed to be written to by only one host. If multiple hosts attempt to write to the same file system, none will have an accurate map of the filesystem and will end up overwriting data from the other host.

It is possible to mount the volume read-only on additional hosts but remember there is no way for host1 to tell host2 that the data has been changed.

The reason for distributed lock managers and other communication channels used by cluster file systems is to allow the hosts to inform each other of writes in progress and prevent the behavior mentioned above.

Good Luck, Rik


Running DRBD in dual primary mode is pretty much the same thing as accessing SAN storage from two server nodes. All precautions that are valid for SAN are valid for dual primary DRBD. The short answer is yes you can do it, but you should also heed SwenW's warning - never mount the filesystem from two nodes at the same time.

At my company we are actually using dual primary for lots of our clusters (with ext4 or ext3 file system), but it comes with a price.

To give you some real-life background, we used to have SAN based clusters and in that case you of course always see the block device from both sides (similar to how DRBD in dual-primary node works). We also used HP Serviceguard to manage the clusters. Serviceguard uses LVM tags (vgchange --addtag and vgchange --deltag) for disk locking, and it also does very extensive tests to protect you from a split-brain situation. In short, if you let Serviceguard manage those disks, it will never make the mistake so you can use whatever filesystem you want (in our case, ext3, lately even ext4). It also requires that the disks are visible from both nodes (it is part of the cluster validation - it makes sure the devices are available on all nodes).

After we retired that expensive hardware (the SAN) we kept the expensive software (Serviceguard) around and so we had to use DRBD in a similar setup with block devices visible from all nodes -- i.e. dual-primary.

Of course, nothing can stop you from mounting the wrong disk by mistake and then you are toast. But that is a warning that is valid when you access a SAN disk from multiple nodes anyway.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.