[Bug 1044808] Re: umountiscsi.sh can't parse /sys to find block device

Dave Gilbert ubuntu at treblig.org
Sat Sep 1 19:43:46 UTC 2012


-- 
You received this bug notification because you are a member of Ubuntu
Foundations Bugs, which is subscribed to open-iscsi in Ubuntu.
https://bugs.launchpad.net/bugs/1044808

Title:
  umountiscsi.sh can't parse /sys to find block device

Status in “open-iscsi” package in Ubuntu:
  Invalid

Bug description:
  open-iscsi can't shut down (and I think this machines the whole machine can't) because umountiscsi.sh doesn't
  like the current layout of /sys:

  # /etc/init.d/umountiscsi.sh 
   * Unmounting iscsi-backed filesystems
  umount: /: device is busy.
          (In some cases useful info about processes that use
           the device is found by lsof(8) or fuser(1))
   * Could not unmount /
  umount: /: device is busy.
          (In some cases useful info about processes that use
           the device is found by lsof(8) or fuser(1))
   * Could not unmount /

  At this point I have iscsi devices enabled/logged in - but not
  mounted, so it shouldn't be unmounting any.

  The problem seems to be the following code in umountiscsi.sh

      for HOST_DIR in /sys/devices/platform/host*; do
          if ! [ -d $HOST_DIR/iscsi_host* ]; then
              continue
          fi
          for SESSION_DIR in $HOST_DIR/session*; do
                  if ! [ -d $SESSION_DIR/target* ]; then
                          continue
                  fi
                  for BLOCK_FILE in $SESSION_DIR/target*/*\:*/block/*; do
                          BLOCK_DEV=`echo "$BLOCK_FILE" | sed 's/.*block\///'`
                          DOS_PARTITIONS="`awk "/^\/dev\/$BLOCK_DEV/ { print \\$2; }" < /proc/mounts`"
                          for DEVICE in $DOS_PARTITIONS; do

  So:
  # ls /sys/devices/platform/host*
  /sys/devices/platform/host2:
  iscsi_host  power  scsi_host  session1  subsystem  uevent

  /sys/devices/platform/host3:
  iscsi_host  power  scsi_host  session2  subsystem  uevent

  ok, so we have those, but if we have a look under the target directory
  that the for BLOCK_FILE is looking in  there is no block directory:

  # ls /sys/devices/platform/host2/session1/target2\:0\:0/*:*
  bsg     device_blocked    generic        iodone_cnt  iorequest_cnt  model  queue_depth           queue_type  rev          scsi_generic  state      timeout  uevent
  delete  evt_media_change  iocounterbits  ioerr_cnt   modalias       power  queue_ramp_up_period  rescan      scsi_device  scsi_level    subsystem  type     vendor

  so that isn't being glob'd and we end up with 
  BLOCK_FILE=/sys/devices/platform/host2/session1/target*/*:*/block/*

  and then it all goes horribly wrong and tries to umount /

  So I'm guessing that something changed in the kernel iscsi/scsi code
  that changed the layout of that.

  Dave

  ProblemType: Bug
  DistroRelease: Ubuntu 12.10
  Package: open-iscsi 2.0.873-3ubuntu1
  ProcVersionSignature: Ubuntu 3.5.0-13.14-generic 3.5.3
  Uname: Linux 3.5.0-13-generic x86_64
  ApportVersion: 2.5.1-0ubuntu4
  Architecture: amd64
  Date: Sat Sep  1 20:31:49 2012
  InstallationMedia: Ubuntu-Server 12.10 "Quantal Quetzal" - Alpha amd64 (20120901)
  ProcEnviron:
   LANGUAGE=en_GB:en
   TERM=xterm
   PATH=(custom, no user)
   LANG=en_GB.UTF-8
   SHELL=/bin/bash
  SourcePackage: open-iscsi
  UpgradeStatus: No upgrade log present (probably fresh install)
  mtime.conffile..etc.iscsi.initiatorname.iscsi: 2012-09-01T20:10:20.003608
  mtime.conffile..etc.iscsi.iscsid.conf: 2012-09-01T20:07:13.019609

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/open-iscsi/+bug/1044808/+subscriptions




More information about the foundations-bugs mailing list