Bug 306288

Summary: device mapper grabs my USB disk and prevents mounting it
Product: [openSUSE] openSUSE 10.3 Reporter: Forgotten User ZhJd0F0L3x <forgotten_ZhJd0F0L3x>
Component: BasesystemAssignee: Hannes Reinecke <hare>
Status: RESOLVED DUPLICATE QA Contact: E-mail List <qa-bugs>
Severity: Critical    
Priority: P5 - None CC: dmueller
Version: Beta 2   
Target Milestone: ---   
Hardware: Other   
OS: Other   
Whiteboard:
Found By: Component Test Services Priority:
Business Priority: Blocker: ---
Marketing QA Status: --- IT Deployment: ---

Description Forgotten User ZhJd0F0L3x 2007-08-30 11:03:38 UTC
In my past-Beta2 system, after plugging in my USB drive, it cannot be mounted by the KDE mediamanager and by halmount ("device is busy").

During investigation of this issue i found out, that devicemapper grabs the device and subsequently it can no longer be used.

root@strolchi:~# l /dev/mapper/*
lrwxrwxrwx 1 root root     16 30. Aug 10:22 /dev/mapper/control -> ../device-mapper
brw------- 1 root root 253, 0 30. Aug 10:22 /dev/mapper/cryptotab_loop0
brw------- 1 root root 253, 1 30. Aug 12:57 /dev/mapper/linear-usb-ST980829_A_??????????-0:0
brw------- 1 root root 253, 2 30. Aug 12:57 /dev/mapper/linear-usb-ST980829_A_??????????-0:0_part1
brw------- 1 root root 253, 3 30. Aug 12:57 /dev/mapper/linear-usb-ST980829_A_??????????-0:0_part2

seife@strolchi:~> halmount
/dev/sdc2 -> external type ext3
/dev/sdc1 -> vfat_ext type vfat
/dev/sda7 on /local type ext3
/dev/sda5 on / type ext3
/dev/sda2 on /boot type ext2
/dev/sda1 -> ? type ntfs
seife@strolchi:~> halmount /dev/sdc2
/dev/sdc2: org.freedesktop.Hal.Device.Volume.UnknownFailure: mount: /dev/sdc2 already mounted or /media/external busy

root@strolchi:~# dmsetup remove /dev/mapper/linear-usb-ST980829_A_\?\?\?\?\?\?\?\?\?\?-0\:0_part1
root@strolchi:~# dmsetup remove /dev/mapper/linear-usb-ST980829_A_\?\?\?\?\?\?\?\?\?\?-0\:0_part2
root@strolchi:~# dmsetup remove /dev/mapper/linear-usb-ST980829_A_\?\?\?\?\?\?\?\?\?\?-0\:0
root@strolchi:~# l /dev/mapper/
total 0
drwxr-xr-x  2 root root     80 30. Aug 13:02 ./
drwxr-xr-x 11 root root   7720 30. Aug 13:02 ../
lrwxrwxrwx  1 root root     16 30. Aug 10:22 control -> ../device-mapper
brw-------  1 root root 253, 0 30. Aug 10:22 cryptotab_loop0
root@strolchi:~#

seife@strolchi:~> halmount /dev/sdc2
/dev/sdc2 mounted on /media/external
Comment 1 Dirk Mueller 2007-08-30 11:31:52 UTC
*** Bug 303999 has been marked as a duplicate of this bug. ***
Comment 2 Dirk Mueller 2007-08-30 11:33:37 UTC
isn't that what the glorious ConsoleKit should prevent? could the error be there? how to debug that?
Comment 3 Forgotten User ZhJd0F0L3x 2007-08-30 11:54:28 UTC
I have no idea. Fact is, that device-mapper seems to grab the device, and i don't see a reason why it should do that.
Comment 4 Dirk Mueller 2007-08-30 11:55:52 UTC
it seems device-mapper is even installed nowadays by default (tested latest KDE Build). raising severity. it has a tendency to be a blocker imho. 
Comment 5 Forgotten User ZhJd0F0L3x 2007-08-30 12:03:28 UTC
http://lists.opensuse.org/opensuse-kernel/2007-08/msg00099.html
Comment 6 Thomas Fehr 2007-08-30 12:09:34 UTC
To my knowledge device-mapper is installed by default since it is part of our
distribution. Besides, I do not see what I can do here.

Device mapper is a tool to be called.
If someone call "dmsetup create ..." how should device-mapper know that he
should refuse this request. This is like blaming maintainer of coreutils
because /bin/rm removed certain files.

I have no idea who creates these dm maps.
From the names they look as if they were created by a call to kpartx.

Why kpartx is called for your USB device I do not know, I would suspect
this is done by either hal or udev.

Reassigning to Hannes, maybe he knows why apparently kpartx is called when a 
USB stick is inserted.
Comment 7 Thomas Fehr 2007-08-30 12:11:23 UTC
Forgot to reassign.
Comment 8 Hannes Reinecke 2007-08-31 05:55:08 UTC
And already fixed.

*** This bug has been marked as a duplicate of bug 302422 ***
Comment 9 Dirk Mueller 2007-09-03 09:58:48 UTC
*** Bug 297569 has been marked as a duplicate of this bug. ***