drbd devices not automatically mounted via /etc/fstab even witn _netdev

Bug #443321 reported by Ari Mujunen
12
This bug affects 2 people
Affects Status Importance Assigned to Milestone
drbd8 (Ubuntu)
Triaged
Wishlist
Unassigned

Bug Description

Both in jaunty-desktop(i386/amd64) and jaunty-server the drbd subsystem is started by '/etc/rc2.d/S70drbd' script which does not interact well with the network-device-based filesystems being mounted by '/etc/network/if-up.d/mountnfs' after network devices have all come up (a typical system will reach '/etc/rc2.d/S70drbd start' much before than network will be up).

I'm not sure if this is really a "solid" solution but since calling '/etc/init.d/drbd start' again after it has already been called seems quite benign, I have just added the script '/etc/network/if-up.d/drbd-start' (note the naming alphabetically _before_ 'mountnfs' in that directory) with the contents:
-----
#! /bin/sh
/etc/init.d/drbd start
-----
and I have labeled my drbd mounts in /etc/fstab with the '_netdev' option:
-----
/dev/drbd1 /home ext3 _netdev,relatime 0 2
/dev/drbd2 /local ext3 _netdev,relatime 0 3
-----
This causes the "if-up" system (regardless whether it is NetworkManager-originated or due to interfaces listed in /etc/network/interfaces) to first bring up drbd devices and then mount the network-dependent drbd devices. Works beautifully for me, in the simple situation where I don't want to use an HA manager to shift the primary/secondary roles around, I just want my "main" computer to be primary and mount the devices by default and the "secondary" to skip all mounting.

ProblemType: Bug
Architecture: amd64
DistroRelease: Ubuntu 9.04
Package: drbd8-utils 2:8.3.0-1ubuntu1
ProcEnviron:
 LANG=en_US.UTF-8
 SHELL=/bin/bash
SourcePackage: drbd8
Uname: Linux 2.6.28-15-generic x86_64

Tags: apport-bug
Revision history for this message
Ari Mujunen (ari-mujunen) wrote :
Revision history for this message
Ari Mujunen (ari-mujunen) wrote : apport-collect data

Architecture: amd64
DistroRelease: Ubuntu 9.04
Package: drbd8
ProcEnviron:
 SHELL=/bin/bash
 LANG=en_US.UTF-8
Uname: Linux 2.6.28-15-generic x86_64
UserGroups: adm admin cdrom dialout lpadmin plugdev sambashare vboxusers

Revision history for this message
Chuck Short (zulcss) wrote :

Ari,

Thanks for the bug report, Ante what do you think?

Regards
chuck

Changed in drbd8 (Ubuntu):
status: New → Triaged
Revision history for this message
Ante Karamatić (ivoks) wrote :

The process of mounting DRBD devices is a bit complex. Something like this should be achieved:

network started -> drbd service started -> drbd devices synced -> server becomes (drbd) primary -> mount drbd device

I understand Ari's idea and have to think about it for a bit. Ari's suggestion doesn't guarante that DRBD will be mountable; it's missing a step - DRBD becoming primary. I understand that this works for him, but we have to consider implications on secondary node, which won't be primary and will also try mouting device (if we ship something like this by default). Will mountnfs then fail and give up mounting all other network filesystems? And, if mountnfs is started before drbd devices are synced, mounting drbd devices wil fail.

I don't think we can cover all use cases of drbd. Drbd with some kind of cluster manager is probably most common use case.

Revision history for this message
Ari Mujunen (ari-mujunen) wrote :

I mentioned that this affects jaunty-server, too, but I forgot to describe how. By default the server edition doesn't rely on "if-up.d" mechanism but relies on /etc/rcS.d/S40networking to bring up what is defined in /etc/network/interfaces and then gives /etc/rcS.d/S45mountnfs.sh a chance to do NFS mounts and mounts labeled with '_netdev' mount option. The default startup of drbd in /etc/rc2.d/S70drbd comes again much later in the sequence.

I originally planned to enter this as a "Wishlist" item and not a bug (but ubuntu-bug didn't let me do that) since I fully understand the complications in setups where drbd device sync / pri/sec / mounts must be handled by a HA system like heartbeat. I was kind of wondering if there were a safe way to enable the simple functionality for the cases where /etc/fstab mounts with '_netdev' (only on one machine, the "primary one") could work "out of the box"? I would expect HA cases not to rely on /etc/fstab in any case, though there might be other '_netdev' mounts. Checking for 'drbd.*_netdev' mount lines in /etc/fstab, maybe?

In any case, I'm really happy with drbd functionality and robustness in my current setup where I run a three-disk raid0 in my desktop as '/home' and have drbd mirroring that onto a single 2TB disk in a small server. It has survived r8169 driver timeouts, r8168 driver giving bad data (md5 checksums enabled!), any network problem or up/down sequence I've thrown at it and I have _never_ had to reboot either machine because of drbd, it has always "obeyed" the 'drbdadm' and not "locked up". And the performance is great! :-)
I hope you can make the transition to DKMS for the kernel module (not being included in the mainline Ubuntu kernel anymore) a smooth experience!

Chuck Short (zulcss)
Changed in drbd8 (Ubuntu):
importance: Undecided → Wishlist
Revision history for this message
Numérigraphe (numerigraphe) wrote :

What you lack is the DRBD feature to "auto-promote" one node at startup : http://www.drbd.org/users-guide-9.0/s-recent-changes-auto-promote.html
This is a new feature in the current beta DRBD.
Ubuntu shouldn't bother at least until DRBD 9.0 hits the mainline kernel.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.