[Pkg-iscsi-maintainers] Bug#775838: open-iscsi: umountiscsi.sh doesn't always unmount all LVM volumes on iSCSI

Christian Seiler christian at iwakd.de
Tue Jan 20 16:02:59 UTC 2015


Package: open-iscsi
Version: 2.0.873+git0.3b4b4500-4
Severity: normal

Dear Maintainer,

(as per discussion on bug #775778 I'm filing a separate bug report for
this issue)

If you have the following configuration:

  - iSCSI disk
  - LVM on top, vg configured in /etc/default/open-iscsi
  - logical volume contains file system
  - at least one mounted file system NOT in /etc/fstab

then it can be the case that umountiscsi.sh does not properly unmount
the volume on shutdown.

Steps to reproduce:

  1. make sure you have an iSCSI disk with LVM on top
  2. boot the system, make sure the LV is not automatically mounted
  3. mount the LV somewhere with a direct mount command:
        mount /dev/iscsivgname/lvname /mnt
  4. /etc/init.d/umountiscsi.sh stop
     (use sysvinit as init or apply patch for #775778 if using systemd)
  5. mount

You will see that /mnt is still mounted (and umountiscsi.sh complained
that it couldn't deactivate the VG because it's busy).

Rationale: If you look at umountiscsi.sh, there are 3 steps that are
done:

  1. umount -a -O _netdev
  2. disable configured LVM
  3. traverse sysfs to find filesystems that are on iSCSI block devices
     and umount those

Naively, one would expect that step 3 should take care of unmounting
the LVs. This is not the case, however, because LVM provides three (!)
additional layers of indirection, and the current code doesn't detect
that the LV is part of a VG that has a PV on the iSCSI device.

If you add the devices to /etc/fstab (with a proper _netdev) or call
the mount command initially with -o _netdev, umountiscsi.sh will indeed
umount them properly (because mount records the _netdev option), so in
most cases where stuff is correctly configured in /etc/fstab, this will
work. It will not work for manually mounted things where the
administrator didn't explicitly add -o _netdev to the mount command.

I don't have an easy fix for this, because looking for logical volumes
that depend on specific block devices is non-trivial. Probably doable,
but not something one writes in just a couple of minutes.

Also, I don't think this is a critical issue, since for static
configurations with no manual mounts this will still do the right
thing. Nevertheless, this should be fixed in a future version.

Regards,
Christian

-- System Information:
Debian Release: 8.0
   APT prefers testing
   APT policy: (500, 'testing')
Architecture: amd64 (x86_64)

Kernel: Linux 3.16.0-4-amd64 (SMP w/1 CPU core)
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/bash
Init: systemd (via /run/systemd/system)

Versions of packages open-iscsi depends on:
ii  libc6                2.19-13
ii  udev                 215-8

open-iscsi recommends no packages.

open-iscsi suggests no packages.

-- Configuration Files:
/etc/default/open-iscsi changed [not included]
/etc/iscsi/initiatorname.iscsi changed [not included]

-- no debconf information



More information about the Pkg-iscsi-maintainers mailing list