[Samsung Galaxy W I8150] sigprof:
I can confirm that there is a problem when using the “mount USB storage” feature from the CWM Recovery v6.0.4.4, but only when the computer is running Windows (tested on Windows 7 SP1 x64), and previously you connected the phone running a normal ROM (not in the recovery mode) to the same computer. When using Linux on the computer, there are no such problems.

When the “mount USB storage” command is selected in CWM Recovery v6.0.4.4, the phone presents the following USB device descriptors to the computer (as shown by lsusb -v under Linux, but the same decriptors will be presented to a Windows PC):

Bus 001 Device 006: ID 04e8:685e Samsung Electronics Co., Ltd GT-I9100 Phone [Galaxy S II] (USB Debugging mode)
Device Descriptor:
bLength 18
bDescriptorType 1
bcdUSB 2.00
bDeviceClass 0 (Defined at Interface level)
bDeviceSubClass 0
bDeviceProtocol 0
bMaxPacketSize0 64
idVendor 0x04e8 Samsung Electronics Co., Ltd
idProduct 0x685e GT-I9100 Phone [Galaxy S II] (USB Debugging mode)
bcdDevice 2.33
iManufacturer 2 Samsung
iProduct 3 GT-I8150
iSerial 4 0123456789ABCDEF
bNumConfigurations 1
Configuration Descriptor:
bLength 9
bDescriptorType 2
wTotalLength 55
bNumInterfaces 2
bConfigurationValue 1
iConfiguration 0
bmAttributes 0x80
(Bus Powered)
MaxPower 500mA
Interface Descriptor:
bLength 9
bDescriptorType 4
bInterfaceNumber 0
bAlternateSetting 0
bNumEndpoints 2
bInterfaceClass 255 Vendor Specific Class
bInterfaceSubClass 66
bInterfaceProtocol 1
iInterface 0
Endpoint Descriptor:
bLength 7
bDescriptorType 5
bEndpointAddress 0x81 EP 1 IN
bmAttributes 2
Transfer Type Bulk
Synch Type None
Usage Type Data
wMaxPacketSize 0x0200 1x 512 bytes
bInterval 0
Endpoint Descriptor:
bLength 7
bDescriptorType 5
bEndpointAddress 0x01 EP 1 OUT
bmAttributes 2
Transfer Type Bulk
Synch Type None
Usage Type Data
wMaxPacketSize 0x0200 1x 512 bytes
bInterval 0
Interface Descriptor:
bLength 9
bDescriptorType 4
bInterfaceNumber 1
bAlternateSetting 0
bNumEndpoints 2
bInterfaceClass 8 Mass Storage
bInterfaceSubClass 6 SCSI
bInterfaceProtocol 80 Bulk-Only
iInterface 1 Mass Storage
Endpoint Descriptor:
bLength 7
bDescriptorType 5
bEndpointAddress 0x82 EP 2 IN
bmAttributes 2
Transfer Type Bulk
Synch Type None
Usage Type Data
wMaxPacketSize 0x0200 1x 512 bytes
bInterval 0
Endpoint Descriptor:
bLength 7
bDescriptorType 5
bEndpointAddress 0x02 EP 2 OUT
bmAttributes 2
Transfer Type Bulk
Synch Type None
Usage Type Data
wMaxPacketSize 0x0200 1x 512 bytes
bInterval 1
Device Qualifier (for other device speed):
bLength 10
bDescriptorType 6
bcdUSB 2.00
bDeviceClass 0 (Defined at Interface level)
bDeviceSubClass 0
bDeviceProtocol 0
bMaxPacketSize0 64
bNumConfigurations 1
Device Status: 0x0000
(Bus Powered)

However, when running the CyanogenMod 10.1 ROM with ADB and USB storage enabled, the phone presents the same USB vendor and device ID, but with different USB descriptors:

Bus 001 Device 009: ID 04e8:685e Samsung Electronics Co., Ltd GT-I9100 Phone [Galaxy S II] (USB Debugging mode)
Device Descriptor:
bLength 18
bDescriptorType 1
bcdUSB 2.00
bDeviceClass 0 (Defined at Interface level)
bDeviceSubClass 0
bDeviceProtocol 0
bMaxPacketSize0 64
idVendor 0x04e8 Samsung Electronics Co., Ltd
idProduct 0x685e GT-I9100 Phone [Galaxy S II] (USB Debugging mode)
bcdDevice 2.33
iManufacturer 2 Samsung
iProduct 3 GT-I8150
iSerial 4 0123456789ABCDEF
bNumConfigurations 1
Configuration Descriptor:
bLength 9
bDescriptorType 2
wTotalLength 55
bNumInterfaces 2
bConfigurationValue 1
iConfiguration 0
bmAttributes 0x80
(Bus Powered)
MaxPower 500mA
Interface Descriptor:
bLength 9
bDescriptorType 4
bInterfaceNumber 0
bAlternateSetting 0
bNumEndpoints 2
bInterfaceClass 8 Mass Storage
bInterfaceSubClass 6 SCSI
bInterfaceProtocol 80 Bulk-Only
iInterface 1 Mass Storage
Endpoint Descriptor:
bLength 7
bDescriptorType 5
bEndpointAddress 0x81 EP 1 IN
bmAttributes 2
Transfer Type Bulk
Synch Type None
Usage Type Data
wMaxPacketSize 0x0200 1x 512 bytes
bInterval 0
Endpoint Descriptor:
bLength 7
bDescriptorType 5
bEndpointAddress 0x01 EP 1 OUT
bmAttributes 2
Transfer Type Bulk
Synch Type None
Usage Type Data
wMaxPacketSize 0x0200 1x 512 bytes
bInterval 1
Interface Descriptor:
bLength 9
bDescriptorType 4
bInterfaceNumber 1
bAlternateSetting 0
bNumEndpoints 2
bInterfaceClass 255 Vendor Specific Class
bInterfaceSubClass 66
bInterfaceProtocol 1
iInterface 0
Endpoint Descriptor:
bLength 7
bDescriptorType 5
bEndpointAddress 0x82 EP 2 IN
bmAttributes 2
Transfer Type Bulk
Synch Type None
Usage Type Data
wMaxPacketSize 0x0200 1x 512 bytes
bInterval 0
Endpoint Descriptor:
bLength 7
bDescriptorType 5
bEndpointAddress 0x02 EP 2 OUT
bmAttributes 2
Transfer Type Bulk
Synch Type None
Usage Type Data
wMaxPacketSize 0x0200 1x 512 bytes
bInterval 0
Device Qualifier (for other device speed):
bLength 10
bDescriptorType 6
bcdUSB 2.00
bDeviceClass 0 (Defined at Interface level)
bDeviceSubClass 0
bDeviceProtocol 0
bMaxPacketSize0 64
bNumConfigurations 1
Device Status: 0x0000
(Bus Powered)

The difference which is important here is that in the recovery the first interface (bInterfaceNumber == 0) is the ADB interface, and the second one (bInterfaceNumber == 1) is the mass storage interface; however, in the CM 10.1 ROM the first interface (bInterfaceNumber == 0) is the mass storage interface, and the second one (bInterfaceNumber == 1) is the ADB interface. However, the vendor and product IDs and serial numbers in both cases are exactly the same, therefore Windows considers the phone in the recovery mode and with the CM 10.1 ROM running to be the same device, and does not attempt to detect and reinstall drivers when the phone is connected in another mode. And apparently Windows binds USB drivers to interface numbers only when it sees the device for the first time, and assumes that interface numbers will always be assigned in the same way. Because of this, when Windows had set up its drivers for the phone running the proper ROM, and then the phone is connected in the recovery mode, Windows tries to attach the USB storage driver to the interface with bInterfaceNumber == 0 (which is actually the ADB interface now), and, if the ADB driver was installed, it will be attached to the interface with bInterfaceNumber == 1 (which is actually the USB storage interface).

I tried to use the “Remove” command in the Device Manager when the phone was in the recovery mode with USB storage enabled, and then disconnected and reconnected the USB cable; this forced Windows to reinstall drivers, and I could access the phone storage in the recovery mode (both the internal storage and the external microSD card). However, when I rebooted the phone, I could no longer access the phone storage when the CM 10.1 ROM was running, until I performed the same operation again (removed devices in the Device Manager, then reconnected the USB cable and waited while Windows reinstalls the drivers).

If the PC is running Linux, there are no such problems, because Linux does not use interface numbers for matching drivers to USB device interfaces, except in some special cases.

Currently the recovery uses the same 04e8:685e USB ID both in the initial state (when it presents only the ADB interface with bInterfaceNumber == 0) and in the USB storage state (where both ADB and mass storage interfaces are present). In order to be compatible with the Windows behavior of remembering the interface ordering, the following changes must be made:

Change the order of USB interfaces when the “mount USB storage” command is used, so that the USB mass storage interface will have bInterfaceNumber = 0, and the ADB interface will have bInterfaceNumber = 1.

Change the USB vendor/product ID pair used for the “ADB only” configuration (e.g., use a Google one — 18d1:d002, as in /init.usb.rc in the ROM, if Samsung does not have such configuration). Alternatively, use the “massstorage,adb” configuration all the time, and emulate the media insertion/removal when mounting/unmounting the USB storage from recovery, like the ROM itself does.