27 January 2009

Windows wont eject USB device.

I have an XP laptop that has some funky USB driver action going on and refuses to let me "Safely Remove" some devices; also my Vista desktop has a powered USB hub that refuses to eject anything at all so I went looking for a USB manager and found USBDeview.

Its a portable (ie no install) application that will show you every USB device installed on your system and its current state.





This gives you full control of your USB functions, like allowing you to uninstall any USB device even if its not plugged in or won't register on insertion and to properly eject most devices cleanly.
Usbdeview also has the ability to autorun any file on device insertion (like Antivirus scan etc) and has command line switches available. Tested on XP 32 and Vista x64, worked perfectly and did I mention its free ?

If you are still having problems getting your OS to let go of a device you can use Process Explorer to find out what process has hold of it.




Process Explorer has a huge amount of information about your running system and makes an excellent task manager replacement on all Windows platforms.
To find that allusive process : Open Process Explorer and go to the Find menu. Type in the name of the device (which you can get from the USBDeview description) and it will show all the processes that have it open, I have used my Xbox 360 controller as an example in the picture below.


As you can see the application XboxStat.exe has the controller open, if I double click it it will take me to its place in the process tree were I can end task it if I want. Be careful what you close, if you have to close explorer you will lose your taskbar and any explorer windows that are open. If explorer doesn't start back up automatically go to Process Explorer / File / Run and type explorer
Hit enter and your shell should come back.

20 January 2009

How to and why to create a RAM Disk

A RAM disk is a section of system memory that is sectioned off and treated as a hard drive. This has several benefits due to the speed of RAM being exponentially faster then any hard drive, and no physical moving parts, so no wear and tear on your disk from high throughput applications or scripts.

I started looking around for information after reading about putting your Firefox cache onto a ram disk to improve speed. After a couple of hours I have found the following for Windows, Linux and MacOsX.

Windows : I tried several different home brew options and noted that most of the solutions were based off of the W2k resource kit drivers which means no vista support. Finally I found DataRAM , grab the top download (Dataram RAMDisk Beta - Windows Vista, XP, Server) which is in public beta at the moment, its free and supports up to 4gb disks which is probably overkill for most users but allows for the intriguing possibility of loading a game into the RAMdisk to increase level load times etc.

The best feature of Dataram is the ability to save and load disk images, this allows you to save the content of the ramdisk and load it again on startup. There is also a auto save option which I havn't tested but could be very handy.
The best way to create the image, I have found, is in the settings tab set the size ( Dataram wont let you set more then half your RAM as a disk for obvious reasons ), select either FAT16, FAT32 or unformatted if you want an NTFS disk (You will have to go through the Computer Management tool found in the Administrator Tools menu once the driver is running and you will see an unformatted disk, format it as NTFS.)

Now go to the Load and Save tab and select Save image at shutdown, enter the location and file name to be used and select Save Image now. Copy the File name to the Load image settings section and select Load disk image at startup. Now stop the RAMdisk, depending on your OS you may have to actually restart windows to unload the driver.
If you had to restart the OS go back into the Dataram app and manually select Start. Once the driver is running it will automatically resume on OS startup.

Now you have a persistent RAM disk, awesome.

Linux : Here is a good article on RAM disk creation for kernel 2.4 and greater. When I get my Linux/Hackintosh box set-up i'll do some investigation into making a persistent image.

MacOsX : Here is a cool little GUI utility for creating RAM disks for OsX 10.4 and later, again no persistence yet, see previous comment.

While testing FireFox, I first just copied the entire FireFox folder from Program files\Mozilla Firefox onto the RAM disk and pointed the FireFox cache at it, this improved the load, shutdown and page load speed, I have since just left the cache on the RAMdisk as I leave my laptop turned on all the time anyway.

To change the Firefox cache location, do the following :

Type about:config into the firefox address bar, you will get a warning about dragons (!). If your brave enough to continue you will then see a list of all the inbuilt preferences inside FF. First we change the location of the cache, put browser.cache.disk.parent_directory into the search bar, double click the found entry and change the setting to your newly created RAMdisk, in my case G:\
I set my ram disk at 55mb, so now I want to make sure the cache doesn't exceed that size. To do this we have to create a new entry as its normally hidden, right click anywhere in the about:config page and select New, then Integer, copy and paste this browser.cache.memory.capacity

Now I give it a value of 50000 for 50mb.

My settings now look like this :



That's it, close the about:config page and restart FireFox, check the RAMdisk and it will now have a Cache folder.

06 January 2009

Please welcome..

Our new team member Rolex. He has many years IT experiance within the industry and im sure will have some interesting stuff to share...