public inbox for util-linux@vger.kernel.org
 help / color / mirror / Atom feed
From: butter@breezl.com
To: util-linux@vger.kernel.org
Subject: losetup -d does not move partition devices
Date: Tue, 24 Sep 2013 18:22:11 +0200	[thread overview]
Message-ID: <5241BC33.8050700@breezl.com> (raw)

Hi all

On Ubuntu Desktop 13.04 64bit the loop device partitions do not automatically
get deleted when you call "losetup -d DEVICE". This causes other programs
(like lvmdiskscan -l) to report Input/output errors.

Here is how to reproduce the problem:

	LOOPDEV=/dev/loop3
	IMAGEFILE=`pwd`/mydisk.img
	MOUNTPOINT=`pwd`/mnt

	# 1. Create and mount an ext4 partition from a file-based disk image
	dd if=/dev/zero of=$IMAGEFILE bs=1M count=80
	sudo losetup $LOOPDEV $IMAGEFILE
	sudo parted $LOOPDEV mklabel msdos
	sudo parted $LOOPDEV mkpart primary 2048s    43007s
	sudo mkfs -t ext4 ${LOOPDEV}p1
	mkdir $MOUNTPOINT
	sudo mount ${LOOPDEV}p1 $MOUNTPOINT

	# 2. Unmount again => ERROR: the partition device files are not deleted
	sudo umount $MOUNTPOINT
	sudo losetup -d $LOOPDEV
	rmdir $MOUNTPOINT
	rm $IMAGEFILE
	ls -l ${LOOPDEV}*

The last command shows:

	/tmp/test[10:18]% ls -l ${LOOPDEV}*
	brw-rw---- 1 root disk   7, 3 Sep 24 18:18 /dev/loop3
	brw-rw---- 1 root disk 259, 0 Sep 24 18:17 /dev/loop3p1

As no device is connected there is no partition 1! Isn't this a bug?

Regards
BB.

             reply	other threads:[~2013-09-24 16:44 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-09-24 16:22 butter [this message]
2013-10-07 11:38 ` losetup -d does not move partition devices Karel Zak
2013-10-07 14:24   ` Phillip Susi
2013-10-08 23:22   ` butter
2013-10-09  7:53     ` Karel Zak
2013-10-09 10:16       ` Matthias Schniedermeyer

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=5241BC33.8050700@breezl.com \
    --to=butter@breezl.com \
    --cc=util-linux@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox