public inbox for util-linux@vger.kernel.org
 help / color / mirror / Atom feed
* losetup -d does not move partition devices
@ 2013-09-24 16:22 butter
  2013-10-07 11:38 ` Karel Zak
  0 siblings, 1 reply; 6+ messages in thread
From: butter @ 2013-09-24 16:22 UTC (permalink / raw)
  To: util-linux

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.

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2013-10-09 10:23 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-09-24 16:22 losetup -d does not move partition devices butter
2013-10-07 11:38 ` 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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox