Difference between revisions of "Talk:How to hotswap Ultrabay devices"

From ThinkWiki
Jump to: navigation, search
Line 1: Line 1:
I created a new HAL script, but I would like some people to try it out as I have only tested it on a T41 and T60.
+
=HAL script=
Save it as {{path|/etc/hal/fdi/information/10-thinkpad-ultrabay.fdi}}
 
  
Especially anyone with a A-series or W-series as those have either multiple Ultrabays or HDDs which might require special rules to be defined, to locate the Ultrabay device(s).
+
If the script works, your lshal output should contain something similar to this. In this case the Ultrabay device was a second HDD (/dev/sdb).
If you have such a machine, please post a comment, and your lshal output.
 
 
 
To check the effect, look at your lshal output, the section for your optical disk (/dev/sr0 typically) or your 2nd hdd (/dev/sdb typically) should have storage.hotpluggable = true after restarting your hal deamon or rebooting.
 
 
 
Note that the script was tested on Fedora 11 with HAL 0.5.12, and might not work properly with older HAL versions. For instance it seems older HAL verions had storage.bus = scsi or info.parent was apparently at one point storage.physical_device.
 
If the storage.bus issue is real, I should be able to catch it in the hal script by using <match key="storage.bus" string_outof="pci;scsi">
 
 
 
Lastly, with Gnome 2.26 I did not notice any change in behaviour with this. But KDE might be different.
 
  
 +
Note that in the example, storage.hotpluggable = true while before it was false, so the script worked.
 
<pre>
 
<pre>
<?xml version="1.0" encoding="ISO-8859-1"?> <!-- -*- SGML -*- -->
+
udi = '/org/freedesktop/Hal/devices/storage_serial_SATA_HTS726060M9AT00_MRH453M4H11ARB'
 +
  block.device = '/dev/sdb'  (string)
 +
  block.is_volume = false  (bool)
 +
  block.major = 8  (0x8)  (int)
 +
  block.minor = 16  (0x10)  (int)
 +
  block.storage_device = '/org/freedesktop/Hal/devices/storage_serial_SATA_HTS726060M9AT00_MRH453M4H11ARB'  (string)
 +
  info.capabilities = {'storage', 'block'} (string list)
 +
  info.category = 'storage'  (string)
 +
  info.parent = '/org/freedesktop/Hal/devices/pci_8086_24ca_scsi_host_0_scsi_device_lun0'  (string)
 +
  info.product = 'HTS726060M9AT00'  (string)
 +
  info.udi = '/org/freedesktop/Hal/devices/storage_serial_SATA_HTS726060M9AT00_MRH453M4H11ARB'  (string)
 +
  info.vendor = 'ATA'  (string)
 +
  linux.hotplug_type = 3  (0x3)  (int)
 +
  linux.sysfs_path = '/sys/devices/pci0000:00/0000:00:1f.1/host1/target1:0:0/1:0:0:0/block/sdb'  (string)
 +
  storage.automount_enabled_hint = true  (bool)
 +
  storage.bus = 'pci'  (string)
 +
  storage.drive_type = 'disk'  (string)
 +
  storage.firmware_version = 'MH4O'  (string)
 +
  storage.hotpluggable = true  (bool)
 +
  storage.lun = 0 (0x0)  (int)
 +
  storage.media_check_enabled = false  (bool)
 +
  storage.model = 'HTS726060M9AT00'  (string)
 +
  storage.no_partitions_hint = false  (bool)
 +
  storage.originating_device = '/org/freedesktop/Hal/devices/computer'  (string)
 +
  storage.partitioning_scheme = 'mbr'  (string)
 +
  storage.removable = false  (bool)
 +
  storage.removable.media_available = true  (bool)
 +
  storage.removable.media_size = 60011642880  (0xdf8f90000)  (uint64)
 +
  storage.requires_eject = false  (bool)
 +
  storage.serial = 'SATA_HTS726060M9AT00_MRH453M4H11ARB'  (string)
 +
  storage.size = 60011642880  (0xdf8f90000)  (uint64)
 +
  storage.vendor = 'ATA'  (string)
 +
</pre>
  
<!--
+
{| border=1
HAL config file to set ThinkPad Ultrabay eject capability flag.
+
|+ Known South Bridge PCI IDs
Note that ThinkPad model matching is done on a partial match, so T40 will also match T40p, which is what we want.
+
! ID !! ThinkPad model !! South Bridge chip (for Ultrabay) !! parent device (host_0, lun0 = 2nd ATA controller, master device)
 
+
|-
If your ThinkPad model is not listed, please check with lspci what PCI ID your disk controller is
+
| 8086_7111 || T20, T21, T22, X20, X21 || Intel 82371AB/EB/MB PIIX4 IDE || /org/freedesktop/Hal/devices/pci_8086_7111_scsi_host_0_scsi_device_lun0
-->
+
|-
 
+
| 8086_248a || T23, T30, X22, X23, X24, X30|| Intel 82801CAM IDE U100 (rev 2) || /org/freedesktop/Hal/devices/pci_8086_248a_scsi_host_0_scsi_device_lun0
<deviceinfo version="0.2">
+
|-
  <device>
+
| 8086_24ca || R50, R51, T40, T40p, T41, T41p, T42, T42p, X31, X32, X40 || Intel 82801DBM (ICH4-M) || /org/freedesktop/Hal/devices/pci_8086_24ca_scsi_host_0_scsi_device_lun0
    <match key="/org/freedesktop/Hal/devices/computer:system.hardware.version" prefix="ThinkPad">
+
|-
      <match key="/org/freedesktop/Hal/devices/computer:system.hardware.vendor" string="IBM">
+
| 8086_2653 || R52, T43, T43p, X41, Z60m, Z60t  || Intel 82801FBM (ICH6-M) || /org/freedesktop/Hal/devices/pci_8086_2653_scsi_host_scsi_device_lun0
 
+
|-
        <!-- will match IBM ThinkPad T20, T21, T22, X20 and X21 -->
+
| 8086_27c4 || R60, X60 || Intel 82801GBM (ICH7 Family) || /org/freedesktop/Hal/devices/pci_8086_27c4_scsi_host_scsi_device_lun0
        <match key="/org/freedesktop/Hal/devices/computer:system.hardware.version" contains_outof="T20;T21;T22;X20;X21">
+
|-
          <match key="storage.bus" string="pci">
+
| 8086_27df || T60, T60p, Z61m, Z61t, Z61p || Intel 82801GBM/GHM (ICH7 Family) || /org/freedesktop/Hal/devices/pci_8086_27df_scsi_host_scsi_device_lun0
            <match key="info.parent" string="/org/freedesktop/Hal/devices/pci_8086_7111_scsi_host_0_scsi_device_lun0">
+
|-
              <merge key="storage.hotpluggable" type="bool">true</merge>
+
| 8086_2850 || R61, T61, T61p, X300 || Intel 82801H (ICH8 Family) || /org/freedesktop/Hal/devices/pci_8086_2850_scsi_host_scsi_device_lun0
            </match>
+
|-
          </match>
+
| 8086_2929 || R400, R500, T400, T500, W500, W700, X200, X301 || Intel 82801I ICH9 Family || /org/freedesktop/Hal/devices/pci_8086_2929_scsi_host_0_scsi_device_lun0
        </match>
+
|}
 
+
==lshal output==
        <!-- will match IBM ThinkPad T23, T30, X22, X23, X24 and X30 -->
+
Please place your lshal output here if you had problems, or if you have a A or W series ThinkPad
        <match key="/org/freedesktop/Hal/devices/computer:system.hardware.version" contains_outof="T23;T30;X22;X23;X24;X30">
 
          <match key="storage.bus" string="pci">
 
            <match key="info.parent" string="/org/freedesktop/Hal/devices/pci_8086_248a_scsi_host_0_scsi_device_lun0">
 
              <merge key="storage.hotpluggable" type="bool">true</merge>
 
            </match>
 
          </match>
 
        </match>
 
 
 
        <!-- will match IBM ThinkPad R50, R51, T40, T40p, T41, T41p, X31, X32 and X40 -->
 
        <match key="/org/freedesktop/Hal/devices/computer:system.hardware.version" contains_outof="R50;R51;T40;T41;T42;X31;X32;X40">
 
          <match key="storage.bus" string="pci">
 
            <match key="info.parent" string="/org/freedesktop/Hal/devices/pci_8086_24ca_scsi_host_0_scsi_device_lun0">
 
              <merge key="storage.hotpluggable" type="bool">true</merge>
 
            </match>
 
          </match>
 
        </match>
 
 
 
        <!-- will match IBM ThinkPad R52, T43, T43p, X41, Z60m and Z60p -->
 
        <match key="/org/freedesktop/Hal/devices/computer:system.hardware.version" contains_outof="R52;T43;X41;Z60">
 
          <match key="storage.bus" string="pci">
 
            <match key="info.parent" string="/org/freedesktop/Hal/devices/pci_8086_2653_scsi_host_scsi_device_lun0">
 
              <merge key="storage.hotpluggable" type="bool">true</merge>
 
            </match>
 
          </match>
 
        </match>
 
 
 
      </match>
 
      <match key="/org/freedesktop/Hal/devices/computer:system.hardware.vendor" string="LENOVO">
 
 
 
        <!-- will match Lenovo ThinkPad T60, T60p, Z61m, Z61t and Z61p -->
 
        <match key="/org/freedesktop/Hal/devices/computer:system.hardware.version" contains_outof="T60;Z61">
 
          <match key="storage.bus" string="pci">
 
            <match key="info.parent" string="/org/freedesktop/Hal/devices/pci_8086_27df_scsi_host_scsi_device_lun0">
 
              <merge key="storage.hotpluggable" type="bool">true</merge>
 
            </match>
 
          </match>
 
        </match>
 
 
 
        <!-- will match Lenovo ThinkPad R60 and X60 -->
 
        <match key="/org/freedesktop/Hal/devices/computer:system.hardware.version" contains_outof="R60;X60">
 
          <match key="storage.bus" string="pci">
 
            <match key="info.parent" string="/org/freedesktop/Hal/devices/pci_8086_27c4_scsi_host_scsi_device_lun0">
 
              <merge key="storage.hotpluggable" type="bool">true</merge>
 
            </match>
 
          </match>
 
        </match>
 
 
 
        <!-- will match Lenovo ThinkPad R61, T61, T61p and X300 -->
 
        <match key="/org/freedesktop/Hal/devices/computer:system.hardware.version" contains_outof="R61;T61;X300">
 
          <match key="storage.bus" string="pci">
 
            <match key="info.parent" string="/org/freedesktop/Hal/devices/pci_8086_2850_scsi_host_scsi_device_lun0">
 
              <merge key="storage.hotpluggable" type="bool">true</merge>
 
            </match>
 
          </match>
 
        </match>
 
 
 
        <!-- will match Lenovo ThinkPad R400, R500, T400, T500, W500, W700, X200 and X301 -->
 
        <match key="/org/freedesktop/Hal/devices/computer:system.hardware.version" contains_outof="R400;R500;T400;T500;W500;W700;X200;X301">
 
          <match key="storage.bus" string="pci">
 
            <match key="info.parent" string="/org/freedesktop/Hal/devices/pci_8086_2929_scsi_host_0_scsi_device_lun0">
 
              <merge key="storage.hotpluggable" type="bool">true</merge>
 
            </match>
 
          </match>
 
        </match>
 
 
 
      </match>
 
    </match>
 
  </device>
 
</deviceinfo>
 
</pre>
 

Revision as of 21:03, 6 June 2009

HAL script

If the script works, your lshal output should contain something similar to this. In this case the Ultrabay device was a second HDD (/dev/sdb).

Note that in the example, storage.hotpluggable = true while before it was false, so the script worked.

udi = '/org/freedesktop/Hal/devices/storage_serial_SATA_HTS726060M9AT00_MRH453M4H11ARB'
  block.device = '/dev/sdb'  (string)
  block.is_volume = false  (bool)
  block.major = 8  (0x8)  (int)
  block.minor = 16  (0x10)  (int)
  block.storage_device = '/org/freedesktop/Hal/devices/storage_serial_SATA_HTS726060M9AT00_MRH453M4H11ARB'  (string)
  info.capabilities = {'storage', 'block'} (string list)
  info.category = 'storage'  (string)
  info.parent = '/org/freedesktop/Hal/devices/pci_8086_24ca_scsi_host_0_scsi_device_lun0'  (string)
  info.product = 'HTS726060M9AT00'  (string)
  info.udi = '/org/freedesktop/Hal/devices/storage_serial_SATA_HTS726060M9AT00_MRH453M4H11ARB'  (string)
  info.vendor = 'ATA'  (string)
  linux.hotplug_type = 3  (0x3)  (int)
  linux.sysfs_path = '/sys/devices/pci0000:00/0000:00:1f.1/host1/target1:0:0/1:0:0:0/block/sdb'  (string)
  storage.automount_enabled_hint = true  (bool)
  storage.bus = 'pci'  (string)
  storage.drive_type = 'disk'  (string)
  storage.firmware_version = 'MH4O'  (string)
  storage.hotpluggable = true  (bool)
  storage.lun = 0  (0x0)  (int)
  storage.media_check_enabled = false  (bool)
  storage.model = 'HTS726060M9AT00'  (string)
  storage.no_partitions_hint = false  (bool)
  storage.originating_device = '/org/freedesktop/Hal/devices/computer'  (string)
  storage.partitioning_scheme = 'mbr'  (string)
  storage.removable = false  (bool)
  storage.removable.media_available = true  (bool)
  storage.removable.media_size = 60011642880  (0xdf8f90000)  (uint64)
  storage.requires_eject = false  (bool)
  storage.serial = 'SATA_HTS726060M9AT00_MRH453M4H11ARB'  (string)
  storage.size = 60011642880  (0xdf8f90000)  (uint64)
  storage.vendor = 'ATA'  (string)
Known South Bridge PCI IDs
ID ThinkPad model South Bridge chip (for Ultrabay) parent device (host_0, lun0 = 2nd ATA controller, master device)
8086_7111 T20, T21, T22, X20, X21 Intel 82371AB/EB/MB PIIX4 IDE /org/freedesktop/Hal/devices/pci_8086_7111_scsi_host_0_scsi_device_lun0
8086_248a T23, T30, X22, X23, X24, X30 Intel 82801CAM IDE U100 (rev 2) /org/freedesktop/Hal/devices/pci_8086_248a_scsi_host_0_scsi_device_lun0
8086_24ca R50, R51, T40, T40p, T41, T41p, T42, T42p, X31, X32, X40 Intel 82801DBM (ICH4-M) /org/freedesktop/Hal/devices/pci_8086_24ca_scsi_host_0_scsi_device_lun0
8086_2653 R52, T43, T43p, X41, Z60m, Z60t Intel 82801FBM (ICH6-M) /org/freedesktop/Hal/devices/pci_8086_2653_scsi_host_scsi_device_lun0
8086_27c4 R60, X60 Intel 82801GBM (ICH7 Family) /org/freedesktop/Hal/devices/pci_8086_27c4_scsi_host_scsi_device_lun0
8086_27df T60, T60p, Z61m, Z61t, Z61p Intel 82801GBM/GHM (ICH7 Family) /org/freedesktop/Hal/devices/pci_8086_27df_scsi_host_scsi_device_lun0
8086_2850 R61, T61, T61p, X300 Intel 82801H (ICH8 Family) /org/freedesktop/Hal/devices/pci_8086_2850_scsi_host_scsi_device_lun0
8086_2929 R400, R500, T400, T500, W500, W700, X200, X301 Intel 82801I ICH9 Family /org/freedesktop/Hal/devices/pci_8086_2929_scsi_host_0_scsi_device_lun0

lshal output

Please place your lshal output here if you had problems, or if you have a A or W series ThinkPad