removable attribute for disks

Peter F. Patel-Schneider pfps at research.bell-labs.com
Wed May 13 06:10:43 PDT 2009


Hi:

I have a few questions about devkit-disks and the removabe
attribute.  I hope that this is an appropriate place to ask these
questions of.

I have noticed that some "disks" are tagged as "removable" and some are
not.  I have two USB-connected "disks", one a USB flash drive and the
other a real disk inside a USB to SATA enclosure.  The first is marked
as removable but the second is not.  What then is the "removable"
attribute supposed to mean?  A pointer to documentation of all the
attributes would be ideal.

It appears that the removable mark comes from sysfs.  Is this the case?
Does it come directly from sysfs?  Is there an opportunity to insert a
(udev or hal) rule that can adjust the determination of this attribute
in a way that affects other desktop software (notably Nautilus, under
Fedora 11)?

Peter F. Patel-Schneider


Attachments:

1/ Two extracts from a devkit-disks --dump, first for the USB stick, then
for the hard drive.

Showing information for /org/freedesktop/DeviceKit/Disks/devices/sdc
  native-path:             /sys/devices/pci0000:00/0000:00:0f.3/usb1/1-3/1-3:1.0/host9/target9:0:0/9:0:0:0/block/sdc
  device:                  8:32
  device-file:             /dev/sdc
    by-id:                 /dev/disk/by-id/usb-Corsair_Flash_Voyager_A100000000025722-0:0
    by-id:                 /dev/disk/by-uuid/271B-AC6F
    by-path:               /dev/disk/by-path/pci-0000:00:0f.3-usb-0:3:1.0-scsi-0:0:0:0
  detected at:             Wed 13 May 2009 08:44:21 AM EDT
  system internal:         0
  removable:               1
  has media:               1 (detected at Wed 13 May 2009 08:44:21 AM EDT)
    detects change:        1
    detection by polling:  1
    detection inhibitable: 1
    detection inhibited:   0
  is read only:            0
  is mounted:              0
  ...

Showing information for /org/freedesktop/DeviceKit/Disks/devices/sdb
  native-path:             /sys/devices/pci0000:00/0000:00:0f.3/usb1/1-1/1-1:1.0/host8/target8:0:0/8:0:0:0/block/sdb
  device:                  8:16
  device-file:             /dev/sdb
    by-id:                 /dev/disk/by-id/usb-HTS72101_0G9SA00_HTS721010G_MPCZN7Y0HJU4NL-0:0
    by-path:               /dev/disk/by-path/pci-0000:00:0f.3-usb-0:1:1.0-scsi-0:0:0:0
  detected at:             Wed 13 May 2009 08:00:54 AM EDT
  system internal:         0
  removable:               0
  has media:               1 (detected at Wed 13 May 2009 08:00:54 AM EDT)
    detects change:        0
    detection by polling:  0
    detection inhibitable: 0
    detection inhibited:   0
  is read only:            0
  is mounted:              0
  ...

2/ Sysfs files

48> cat /sys/devices/pci0000:00/0000:00:0f.3/usb1/1-3/1-3:1.0/host9/target9:0:0/9:0:0:0/block/sdc/removable 
1
49> cat /sys/devices/pci0000:00/0000:00:0f.3/usb1/1-1/1-1:1.0/host8/target8:0:0/8:0:0:0/block/sdb/removable 
0


More information about the hal mailing list