Cari Blog Ini

Posting blogger lewat email

username.secretword@blogger.com

Sabtu, 21 Juni 2008

Tentang USB Drive

Troubleshooting for USB drives
This page is available in German language too
No Drive Letter in the Windows Explorer

Drive Letter hidden
Windows can be configured to hide drive letters in the Windows Explorer. The settings can be made with Microsoft TweakUI under My Computer -> Drives.

Drive Letter Conflict with Network or Subst Drives
Since XP Network and Subst drives are no more global, they exist in the context of the user who created them only. In the context 'System' where the Mount Manager assigns drive letters such drives are not visible offhand. Therefore they are not considered by XP. If there is a network drive on the first available local letter then XP assigns it again to a new external drive. The external drive is invisible and unaccessible then until its drive letter is changed in the Disk Management (right click My Computer -> Manage -> Disk management) or by my commandline tool ReMount. But for each new drive you have to change the drive letter again and it's no solution to assign a letter again to a different external drive because XP can save exactly one assignment per letter.
So change the network drive's letter to a higher one to get the lower ones available for external drives. Or let my USB drive letter manager change the letters of USB drives for you.
Microsoft is aware of this and calls it a problem. Meanwhile a hotfix is available (WindowsXP-KB297694-x86-ENU.exe) and the XP Service Pack 3 fixes the problem too.
But the problem persists when an external drive is attached before the user logs on. The mapping of the network drives fails when their drive letter is in use. USBDLM fixes this when configured appropriate.

New external drive not partitioned
New external drives are often unformatted and unpartitioned. Partitioning can be done in the Windows Disk Management (right click My Computer -> Manage -> Disk management) or see here.


Windows Server 2003
Windows Server 2003 Enterprise and DataCenter Edition do not assign drive letters to new fixed drives (USB and Firewire disks are usually 'fixed'). This is up to the administrator because otherwise SAN (Storage Area Network) drives might be mounted accidentally.
This feature is called AutoMount and can be enabled by means of the DiskPart tool: Open a commandprompt, enter diskpart, on the DiskPart prompt enter automount to see the current state or automount enable to enable it.
Or install my USB drive letter manager which can assign a drive letter for USB and firewire harddisks without affecting other types of storage devices.

Drive encrypted
Some flash drives and external harddrives come with an encryption software. Usually you have the option to split the drive into an unencrypted and an encrypted part. The unencrypted part appears on all computers but the encrypted part becomes visible and/or accessible after you entered a password when the encryption software asks for. But of course this happens only when this software is installed on the computer you attach the drive to.


Two identical drives
Two identical drives doesn't work if they have identical USB hardware serial numbers. This is a violation of the USB mass storage specs but such drives exist. As far as I've seen such drives can be used alone only.
Some say that the sentence 'If provided, the serial number must be unique to each USB Vendor ID and Product ID pair.' can be interpreted as allowing the same devices from the same manufacturer to have the same serial number, albeit unique to that product line from that manufacturer, but I think the term 'serial number' alone makes absolutely clear how to read that.
You get what you pay for. Giving each device a unique serial costs some cents, while omitting the serial make the users complain about the device being detected as new one when it's attached to a different USB port...
Update: I've tested two USB single slot card readers with identical USB serials: XP-SP2 fully patched and Vista where able to handle this at least on first view. They handle the second drive similar to drives without a serial. But I've also seen an XP which generates a blue screen when the second device is attached...
You can check the USB serial by means of my commandline tool ListUsbDrives.
Windows 2000 and higher can be forced to ignore all USB serials or the serial of devices specified by vendor and product ID:
Under
[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\UsbFlags]
there is the value GlobalDisableSerNumGen:
0 disable all USB serials
1 enables USB serials
I know that the name implies the opposite!
The better solution is an individual setting for the device in question.
Create an entry under the above key. The name starts with "IgnoreHWSerNum" followed by the vendor and product ID of the device. The value for ignoring the serial is 1 as the name implies.
Example for vendor=1111 and product=9999:
IgnoreHWSerNum11119999=1
The value should be a binary and have exactly 1 byte. You can get the IDs by means of my ListUsbDrives started with parameter -a (all drives and informations):
You find them in a line like this
Ctrl ID = USB\VID_1111&PID_9999\USB_serial_number
No restart required to take effect.
Ignoring the serial can be used to prevent the plug an play is triggert when an USB device is exchanged by another almost identical one. This is great for instance when an USB printer is defective and replaced. When the serial is ignored (or not present) the new printer just works as long as it's connected to the same USB port.


Daemon Tools V4
There are reports that a more or less failed installation of the Daemon-Tools V4 makes XP fail assigning drive letters to new drives.
It's suggested then to uninstall the tools and to delete some files in System32\Drivers: sptd.sys, secdrv.sys, sptd.sys, sptdNNNN.sys (NNNN = numbers). Here are some more information:
http://www.daemon-tools.cc/dtcc/archive/index.php/t-7868.html
For the deinstallation there is sptdinst_x86.exe.
Recently there are no more reports about this issue, the problem seems to be fixed.

Other 3rd party software
Anti virus, anti spyware, anti anything, personal firewalls, cd/dvd writing software, the Adobe download manager, Symantec NetBackup, usually installs a service and some drivers to get as much control as possible. Sometimes such services and drivers cause very strange effects.
In the U3 FAQ there are some hints for U3 sticks but some may be true for normal flash drives too.
To discover if a problem is caused by 3rd party software first start XP in Safe Mode. If the problem is gone then, boot again normal. Go to Start -> Run, msconfig, Tab 'Services', check 'Hide All Microsoft Services'. Disable them all, reboot and check if the problem is gone again. If yes, then enable them one by one (reboot each time) until the problem is back again. The you have the culprit...
If deactivating services doesn't help, try it with drivers. Start -> Run, devmgmt.msc. View -> Show hidden devices. Open in the device tree 'Non-Plug and Play Drivers'. Here you see lots of items, many from Microsoft and others. You can deactivate a driver by right clicking it an select 'Deactivate'.
If you are not sure about a driver, just enter its name at Google and you will see...
Create a restore point before!





Restricted users are not allowed to eject a media

Under XP restricted users are not allowed to eject a media from a drive (right click on the drive in the Windows Explorer -> Eject). 'Eject' is the right choice to prepare a card to be taken out of an internal card reader. 'Prepare for safe removal' removes the whole device...
Ejecting rights can be changed by a policy:
Control Panel
Administrative Tools
 Local Security Policy
  Local Policies
   Security Options
    Devices: Allowed to format and eject removable media
Select 'Administrators and Interactive Users' here. Or doubleclick this REG file: AllocateDASD2.reg.
After next logon restricted users can eject a media from a drive.
Earlier tests showed that this has no effect, later tests under XP-SP2 patch level april 2007 where successful.





Increasing Drive Letters

When USB drives gets new higher letters each time they are attached then a foreign software screws up the system. There are reports that a software called 'Spyware Doctor' causes this effect. Uninstalling should fix it.
Since some month there are no new reports about this issue, the problem seems to be fixed.





Drive letters of CD-ROM drives revert

When the drive letters of CD-ROM drives revert to a default after every reboot, then we have to deal with the 'ZoneAlarm problem'.
The fix is to uninstall ZoneAlarm, change the drive letters, reboot and install ZoneAlarm again. But there are other reports that the drive letters revert again then. The problem exists since V6.5. The old V6.1 is still available for download.
There are reports that V6.5.737 fixed the problem too. Others reported the problem with V7.x..
Another suspect for this problem seems to be Norton GoBack.





USB drive appears to be write protected

1.
Check out if the USB drive has a small swich for write protection.
2.
Windows can write protect USB drives too. Check out the registry under
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\StorageDevicePolicies.
The value 'WriteProtect' should be absent or set to '0'.
3.
Flash memory has a limited lifetime of about 100.000 guaranteed write cycles. Most flash cells life much longer but cells that become defective must be replaced by reserve cells (bad block management). The flash controller manages this in the background. When all reserve cells are consumed then the flash controller rejects all write accesses. Then you can read your data and bring the device the recycling.
This can happen even the drive was never even nearly completely filled because the flash controller spreads write accesses over all physical blocks to ensure that all cells are weared out equally (wear levelling).





AutoRun works or does not

AutoRun can be disabled depending on the drive type and depending on the drive letter by Explorer Policies.
These setting can be made system wide under HKEY_LOCAL_MACHINE and for the current user under HKEY_CURRENT_USER. Microsoft TweakUI sets the values under HKEY_CURRENT_USER only and completely ignores HKEY_LOCAL_MACHINE. And it cannot make settings for hard disks.
Therefore I've made a tool for this:
AutoRunSettings
The list of AutoPlay handlers can be configured by means of this tool:
http://windowsxp.mvps.org/autoplayhandlers.htm or
http://www.winload.de/download/58272/Utilities/Sonstiges/Autoplay.Repair-2.1.0.html





XP asks for drivers or just want to install new hardware

XP comes with drivers for USB mass storage. If it asks for drivers then there are two common reasons:
1. It does not trust it's own drivers
This is the case when it cannot check if the drivers are signed which is true when the servicie 'Cryptographic Services' is not running (CryptSvc) or if its data are corrupt.
Start -> Execute -> services.msc
Check here for 'Cryptographic Services' being started automatically.
Fixing corrupted data of the 'Cryptographic Services' is described at Microsoft:
http://support.microsoft.com/kb/822798
2. It does not find the drives
This is the case when the registry key that points to the INF folder is corrupt.
Start the Registry Editor (Run -> Regedit). Check if under HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion the item 'DevicePath' points to '%SystemRoot%\inf'. Additional items, separated by semikolons, are ok but '%SystemRoot%\inf' has to be one of them.
Then delete the file C:\WINDOWS\inf\infcache.1 - XP will recreate it.
The INF folder and the infcache.1 file are 'hidden'. To see them in the Windows Explorer:
Menu 'Tools' -> 'Folder Options'
Tab 'View', mark 'show hidden files and folders'
If it still doesn't work after a restart, the files in C:\WINDOWS\inf might be corrupt. An Windows repair install helps then.
Another thing to check is if the values 'FactoryPreInstallInProgress' and 'AuditInProgress' are set to '1' under
HKEY_LOCAL_MACHINE\SYSTEM\Setup
and
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Factory
. They should be 0 or non present.





Vista asks for drivers or just want to install new hardware

Here the same is true as for XP. Furthermore Vista seems to tend to loose the files USBSTOR.INF, USBSTOR.PNF and other USBxxxx files from C:\Windows\INF. Probably there are more files missing then but the USBSTOR files are most frequently used ones.
There are copies of the files in C:\Windows\System32\DriverStore\FileRepository - just copy them to C:\Windows\INF.





USB drive not working stable

When an USB drive makes problem on one computer only then an updated mainboard/chipset driver may help.
If it doesn't help then it may be just incompatible with the computer's USB ports - that's not unusual. Therefore it's helpful to have an additional USB PCI card as alternative in the computer, best with NEC chip.
Cheap USB extension cables may cause problems too. The thinner and longer the higher the risk for problems. The plugs wear out in time.
USB ports on front of the computer are more problematic because the USB is leaded by a cable thru the computer case which is full of interferences.
Other attached USB devices may interfere, usually such ones that don't use a default Windows driver and which permanently transfer data, such as web cams.
If an USB device has been detected as 'unknown device' once it might be necessary to delete it in the device manager and replug it then.
Another try is a complete USB device clearing by Microsoft DEVCON and the RenewUSB.bat from http://www.robvanderwoude.com/devcon.html
Backup the system before...
A cleanup can be done manually too. Put the following two lines into Notepad and save them as DevManager.CMD:
set DEVMGR_SHOW_NONPRESENT_DEVICES=1
devmgmt.msc
Started thru this DevManager.CMD the Windows device manager shows non present devices too if you check 'View -> Show hidden devices'. Under 'Disk drives', devices shown with a light gray icon are non present. Just delete them. Same procedure under 'Storage volumes'. There may be a lot of them...
My commandline tool DriveCleanup does it for all currently non present storage volumes and USB drives.
Microsoft has set up a page for General USB troubleshooting in Windows XP





Data loss when certain occupancy level reached

When an USB flash drive causes errors when it reaches a certain occupancy level then it's probably a fake which has a fraction of the promised capacity only.
Written data then either overwrites data on other addresses or are just lost in space.
You can check suspicious and new drives by means of my simple test tool TestUsbStick.
For the german computer magazine c't there is a similar, better, tool:
H2TestW 1.4
If a drive is a fake then you can use MS-DOS or Linux to create a small partition to protect the rest from being used.





Format an USB drive

If the Windows Explorer fails to format a removable USB drive then one of these tools may help (for removable drives only):
HP USB Disk Storage Format Tool
SD Memory Card Formatting Software
To test if there is any access to the drive, you can use Hex Workshop.
'Disk' -> 'Open Drive...'
Select here the drive by its size. Stop here if you are not sure!
Once opened it shows the content of sector 0 where you find the partition table on harddisks. On removable drive there can be a partition table or a boot sector ('super floppy').
The format tool mentioned above write a partition table. XP creates super floppies on new medias.
To give a disk a complete new start, just overwrite sector 0 with zeros: Select all using the mouse, click '&', OK, save. Now you can go to the disk management console to partition and/or format the drive again.
Under XP it seems to be not possible to format a drive larger than 32GB with FAT32. But for photo storage devices ('image tanks') FAT32 is essential - they doesn't work with NTFS formatted drives.
The german computer magazine c't offers a format tool - H2Format. But it works on unformatted partitions only. To prepare a drive, go to the Disk Management, delete the partition, create a new one and select 'Do not format'. The use H2Format to write a FAT32 file system - usage is similar to the FORMAT.EXE. Sample:
h2format u: It's very fast because it does nothing else then writing an empty FAT32 file system.
Another FAT32 formatting tool is Fat32Formatter.
A modern BIOS sees USB drives (at least a single one), so you can deal with them under pure MS-DOS too. Or without any operating system: Get the great Ranish Partition Manager, unzip it, start the PART.EXE under Windows. It detects that it's running under Windows and offers the option 'Copy PART.EXE and update boot sector on A:'. This writes the program to a floppy in drive A: that you can boot from then. It does not contain an operating system, not even a file system. But it's bootable.





On flash drive only the first partition works

Nearly all USB flash drives pretend to have a removable media (even it's a lie), so Windows detects them as 'removable'. On drives with a removable media Windows 2000 and higher supports only one partition.
Finally it's a single bit in the device's device descriptor, the removable media bit (RMB). If you take away the RMB then Windows sees the drive as 'local disk' and multiple partitions work.
The Removable Media Bit can be changed either in the drive's hardware or by a Windows filter driver.
Changing in the hardware works with some flash drives by means of the tool Lexar BootIt.
Flash drives which has been successfully turned into fixed drives:
  • Corsair Flash Voyager 16 GB
  • Corsair Flash Voyager GT 4 GB
Please drop me a note if you have more, but please only drives with a known brand which can be easily been bought. Listing noname drives here is useless.
A filter driver for removing the RMB has been made by Hitachi for their Microdrives (Compatct Flash cards with a mini harddrive):
xpfildrvr1224_320.zip
By modifying the included INF file the filter driver can be used with any other 'removable' drive.
For the device detection there are the lines in section [cfadisk_device]:
[cfadisk_device]
%Microdrive_devdesc% = cfadisk_install,IDE\DiskIBM-DSCM-11000__________________________SC2IC801
"IDE\DiskIBM-DSCM-11000__________________________SC2IC801" is the device ID of one of the supported Microdrives.
In analogy to these lines we add one line for each 'removable' USB drive we want to turn into an USB hard drive. The ID is found in the Windows device management: Expand 'Disk drives', right click your USB drive, select Properties. On the tab "Details" under XP the item "Device instance ID" is already selected. Click on the ID in the List and press Ctrl+C, this copies the ID into the Windows Clipboard and can be pasted somewhere else with Ctrl+V.
Sample:
USBSTOR\DISK&VEN_LEXAR&PROD_JUMPDRIVE&REV_1.30\K326441127040&0
We need the fat part:
[cfadisk_device]
%Microdrive_devdesc% = cfadisk_install,USBSTOR\DISK&VEN_LEXAR&PROD_JUMPDRIVE&REV_1.30
In the last line of the INF file we change "Hitachi Microdrive" into something nice as "RemovableToFixed".
In the device manager again right-click the USB drive, "Update driver...", then "No, not this time" -> Next -> "Install from a list or..." -> Next -> "Don't search." -> Next -> "Have Disk" -> browse to the INF file here. Now "RemovableToFixed" should be in the list -> Next -> Confirm the two warnings -> Finish.
Now the drive is redetected, actually as USB hard drive. The drive can be partitioned, the policy "Optimize for performance" indeed activates a write cache on FAT formatted drives and Windows will create the popular folder "System Volume Information"...

Tidak ada komentar: