Bug 57117 - Errors unconfiguring loopback devices in init.d/halt
Summary: Errors unconfiguring loopback devices in init.d/halt
Keywords:
Status: CLOSED RAWHIDE
Alias: None
Product: Red Hat Linux
Classification: Retired
Component: initscripts
Version: 7.2
Hardware: i386
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Bill Nottingham
QA Contact: Brock Organ
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2001-12-05 02:44 UTC by lars
Modified: 2014-03-17 02:24 UTC (History)
2 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2001-12-13 23:36:20 UTC
Embargoed:


Attachments (Terms of Use)

Description lars 2001-12-05 02:44:09 UTC
There is a syntax error in /etc/rc.d/init.d/halt that causes calls to
losetup to fail.  This occurs around line 141 in initscript-6.40:

  for dev in $remaining ; do
    losetup $dev > /dev/null 2>&1 && \
      runcmd $"Detaching loopback device $dev: " losetup -d $device
  done

The loop variable is 'dev', but the call to losetup uses '$device'.  This
results in a bad losetup command line, generating errors on the console and
failing to unconfigure the loopback device.

The solution:

Replace $device with $dev.

Comment 1 Joe Krahn 2001-12-13 23:36:16 UTC
An additional problem is that mounts using the loopback are
not unmounted prior to the losetup commands. It supposed to
happen on the line:
    runcmd $"Unmounting loopback filesystems: " umount $remaining

In my case, /proc/mounts has something like:

/dev/loop0  /mnt/disc1 iso9660 ...

The awk line finds it and prints "/dev/loop0" but it needs
to print the second column, "/mnt/disc1". Running the mount
command says:
  cdimage.iso on /mnt/disc1 type iso9660 ...

and umount wants one of those two, not /dev/loop0.
This occurs when mounting with the "loop" option.
Manually setting up a loop could be different. Maybe
it's best to try unmounting via both 1st and 2nd entry
in /proc/mounts.




Comment 2 Bill Nottingham 2002-01-25 06:29:31 UTC
The dev/devices confusion will be fixed in initscripts-6.51-1, thanks!


Note You need to log in before you can comment on or make changes to this bug.