Bug 591849

Summary: usb device couldn't be detached via udisks --detach
Product: Red Hat Enterprise Linux 6 Reporter: Lubos Kocman <lkocman>
Component: udisksAssignee: David Zeuthen <davidz>
Status: CLOSED WORKSFORME QA Contact: desktop-bugs <desktop-bugs>
Severity: medium Docs Contact:
Priority: low    
Version: 6.0CC: mclasen, notting
Target Milestone: rc   
Target Release: ---   
Hardware: All   
OS: Linux   
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2010-05-13 17:22:02 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Description Lubos Kocman 2010-05-13 11:03:07 UTC
Description of problem:

usb device couldn't be detached via udisks --detach

lkocman@ThinkPad X60$ sudo fdisk /dev/sdb

WARNING: DOS-compatible mode is deprecated. It's strongly recommended to
         switch off the mode (command 'c') and change display units to
         sectors (command 'u').

Command (m for help): p

Disk /dev/sdb: 16.2 GB, 16173236224 bytes
64 heads, 32 sectors/track, 15424 cylinders
Units = cylinders of 2048 * 512 = 1048576 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x000176db

   Device Boot      Start         End      Blocks   Id  System
/dev/sdb1               1       15424    15794160   83  Linux

Command (m for help): q

lkocman@ThinkPad X60$ df -h | grep sdb
/dev/sdb1              15G  166M   14G   2% /media/ADATA

lkocman@ThinkPad X60$ sudo udisks --detach /dev/sdb1
Detach failed: Device is not a drive

lkocman@ThinkPad X60$ sudo udisks --unmount /dev/sdb1

lkocman@ThinkPad X60$ sudo udisks --detach /dev/sdb1
Detach failed: Device is not a drive

Version-Release number of selected component (if applicable):
RHEL 6.0 snapshot 2
kernel: 2.6.32-25.el6.i686

How reproducible:

Steps to Reproduce:

   1. Obtain an USB mass storage device.
   2. Plugin in USB device.
   3. Let OS mount USB device (lets say that USB mass storage corresponds with /dev/sdb1).

   1. Open terminal
   2. Runas root

      udisks --detach /dev/sdb1

Actual results:

Detach failed: Device is not a drive

Expected results:

The USB device should be unmounted and powered down.

Additional info:

Comment 2 RHEL Product and Program Management 2010-05-13 12:48:22 UTC
This request was evaluated by Red Hat Product Management for inclusion in a Red
Hat Enterprise Linux major release.  Product Management has requested further
review of this request by Red Hat Engineering, for potential inclusion in a Red
Hat Enterprise Linux Major release.  This request is not yet committed for

Comment 3 Bill Nottingham 2010-05-13 14:44:12 UTC
What happens if you do udisks --detach /dev/sdb (specifying no partition?)

Comment 4 David Zeuthen 2010-05-13 17:22:02 UTC
As Bill says you are using the command incorrectly. If you use /dev/sdb it should work. Btw, you also need to ensure that all partitions etc. are not in use (e.g. not mounted, not claimed by LVM, MD etc.) otherwise the command will fail.