Mounting multipath devices by UUID in fstab

6,347

Solution 1

The problem seems to be as I expected, either multipath isn't up fully or open-iscsi hasn't yet logged into iscsi targets for all paths when the ocfs2 fstab entries are mounted. This is despite having _netdev as a mount option.

I tried messing around with init.d scripts for /etc/init.d/o2cb and /etc/init.d/ocfs2 by adding iscsi and multipath-tools to their Should-Start: and Should-Stop: lines. But couldn't seem to get this ocfs2 multipath mounting by UUID to work properly.

If I instead use the relevant multipath device (e.g. /dev/mapper/3603be8bfce91e3e06e63e5ad426f4d98-part1) rather than the UUID things boot normally and the mount via fstab works correctly using multipath.

The reason I didn't try this initially was that I wanted something to work across multiple hosts which may or may not have multipath. So in the end I have different devices depending on whether I'm on a host with or without multipath. This isn't ideal, but seems to be working.

fstab on Host with Multipath

/dev/mapper/3603be8bfce91e3e06e63e5ad426f4d98-part1 /mnt/lun-1 ocfs2 _netdev 0 0

fstab on Host without Multipath

/dev/disk/by-id/scsi-3603be8bfce91e3e06e63e5ad426f4d98-part1 /mnt/lun-1 ocfs2 _netdev 0 0

Solution 2

I had a very similar problem recently and found this bug:

https://bugs.launchpad.net/ubuntu/+source/multipath-tools/+bug/1547206

So far the work-around of installing the older version and holding it at that version seems to be working. It seems to have resolved all the boot hanging and ordering issues I was having with the current version of the package.

apt-get install multipath-tools=0.4.9-3ubuntu7

apt-mark hold multipath-tools

aptitude hold multipath-tools

Share:
6,347

Related videos on Youtube

Nathan S. Watson-Haigh
Author by

Nathan S. Watson-Haigh

I'm a Research Fellow in Bioinformatics at the Australian Centre for Plant Functional Genomics (ACPFG).

Updated on September 18, 2022

Comments

  • Nathan S. Watson-Haigh
    Nathan S. Watson-Haigh almost 2 years

    I have several multipath iSCSI LUN's formatted as ocfs2 filesystems. They are part of an Ubuntu 14.04 cluster using local heartbeat. This all appears to be working fine if I mount them manually after rebooting.

    If I try to automatically mount them by UUID via fstab (even with _netdev option) I run into issues.

    If I have fstab entries (such as the following) commented out during a boot

    UUID=094c02f6-bfbb-4fe5-8a90-3b6992c81a60     /mnt/lun-1   ocfs2   _netdev        0       0
    

    and then uncomment them once logged in and run mount -a everything seems fine. i.e. multipath -ll shows multiple paths to each iSCSI device. e.g.:

    3603be8bfce91e3e06e63e5ad426f4d98 dm-5 EQLOGIC ,100E-00
    size=15T features='1 queue_if_no_path' hwhandler='0' wp=rw
    `-+- policy='round-robin 0' prio=1 status=active
      |- 19:0:0:0 sdr 65:16 active ready  running
      `- 20:0:0:0 sdf 8:80  active ready  running
    

    and mount shows that /dev/mapper/* devices for my iSCSI LUN's:

    /dev/mapper/3603be8bfce91e3e06e63e5ad426f4d98-part1 on /mnt/lun-1 type ocfs2 (rw,_netdev,heartbeat=local)
    

    However, if I then reboot with the same fstab entry uncommented, I don't get the same multipath -ll output. Namely, only a single multipath device is present, not one for each iSCSI LUN.

    mount shows the device not as /dev/mapper/* but to just a single non-multipath'd device like /dev/sdc1.:

    /dev/sdk1 on /mnt/lun-1 type ocfs2 (rw,_netdev,heartbeat=local)
    

    Am I doing something wrong, or is this caused by multipath not being fully up-and-running before my ocfs2 multipath devices are mounted?