16GB USB Drive – “disk is write protected” – Cannot Format or Wipe or Delete

The USB Pen Drive (16GB no-brand – cheap buy) got stuck on Read Only and I couldn’t format it. The error “Disk is write protected” kept appearing when trying to format the Usb drive in “Computer” on Windows 7.

I tried pretty much everything out there and was nearly ready to pack it in. Most websites (especially the sandisk forums) just said to return the USB Drive and get a refund – that this was a known issue and that if/when the USB Drive encounters an error, it puts the USB Drive into Read Only to allow for disaster recovery. It was possible to read and see the files on the USB Drive, but it wasn’t possible to delete or format the USB Key. You may want to copy everything you can off the USB Key first as the following fix wipes and re-flashes the USB Key.

These didn’t work:

  • URescue_v1.3.0.71
  • MDPT (Multi-Device Production Tool)
  • Registry settings
  • HP USB Disk Storage Format Tool
  • ChkFlsh.exe (in whatever destructive write mode I could find)
  • Running Virus scans etc.
  • Format (via the cli or gui)
  • Repair_Neo2.9.exe

The following worked! 🙂 ->

  • AlcorMP

While researching this USB Read-Only bug/issue/problem I encountered the program “ChipGenius” (local mirror) which provides detailed information on the memory chip and manufacturer of the USB Pen Drive. This revealed the keyword “Alcor”, however searching for this only revealed foreign language websites and no help.

ChipGenius did however provide the VID and PID numbers I needed for the final solution.

Onto the Solution. As on the superuser.com website, you need the following program: “AlcorMP_5T2F_6T2F_2011-11-10.02“. Google for it (or use this local mirror).

  1. Run the ChipGenius Program and locate the VID and PID Numbers (see image)
  2. Extract the AlcorMP_…rar File (mirror above) and run LoadDriver.exe Enter the VID and PID and click Install, which only takes a second to run. (see image)
  3. Unplug and Re-Plug in the USB Key
  4. Run the AlcorMP.exe utility. To the left of the Device listed, click the Gray button and click “Start”. (see image)

It took about 2.5 hours to complete, most of which was scanning for bad blocks.

As for what caused the USB Key to go into a Read-Only state, it may have been the fact of unplugging it while in use or some other reason. (This USB key was actually been used on a saorview box to record and pause tv, so it may have caused this problem again in combination with unplugging the tv box instead of powering it off.)

What I was most surprised about was the difficulty in discovering this solution on the Internet. There was so much junk suggested which didn’t work. Hopefully this article will help other people in a similiar situation.

References:

Posted in IT | Tagged , , , | 16 Comments

SQL Drill – Excel Add-In for building and running SQL queries

About SQL-Drill

Building complex SQL queries for a particular database can take some time and effort. SQL-Drill is a simple Excel Add-in which can connect to a SQL Server or MySQL Database, show all the tables, and allow you to easily pick what columns you want to select data from. It will take care of the inner selects and joins, and will give you the final SQL query (which you can use in SQL Server Management Studio for reports etc.)

Installation

  1. Download from: http://www.sqldrill.com/ (local mirror)
  2. Install MSI setup
  3. Run as Administrator – a Command Prompt
    regsvr32 “C:\Program Files (x86)\SQL Drill\SQLDrill.dll”
  4. Open Excel. The Add-Ins tab should now show, and in this Tab, will be “SQL Drill”
How SQL-Drill will appear in Excel once installed.

Connect with SQL Server

Connecting to SQL Server is very easy. Click the New/Edit, Add a new Profile, Edit the Connection String, choose “Microsoft OLE DB Provider for SQL Server” click next, enter the server name, and login details (or SA details). Clicking “Test Connection” should return “Test connection succeeded”.Connect SQL-Drill to Microsoft SQL Server

Create ODBC Connection to MySQLConnect SQL-Drill to MySQL via ODBC

Connect with MySQL Server

Connecting SQL-Drill with MySQL Server is a little more involved than connecting to Microsoft SQL Server. There are two main Steps. One is setting up the ODBC Connection in the Windows ODBC Data Sources. Two is using this connection inside of SQL-Drill.

  1. Download and install the MySQL ODBC Connector
    (I had to install both mysql-connector-odbc-5.1.10-winx64.msi and mysql-connector-odbc-5.1.10-win32.msi as I was on Win7 x64 with Excel x32)
  2. START -> Search/Run -> odbcad32
    This should open the “ODBC Data Source Administrator” app.
    (Also accessible from: Control Panel – Administrative Tools – Data Sources (ODBC))
  3. Under “User DSN”, choose Add. Choose “MySQL ODBD 5.1 Driver”, and click Finish.
  4. In the MySQL Connector/ODBC, enter the Connection details. Click Test and it should return “Test Successful”.
  5. Open up Excel. Open up SQLDrill.
    Click the New/Edit, Add a new Profile, Edit the Connection String, choose “Microsoft OLE DB Provider for ODBC Drivers” click next. Under “Use data source name” click the drop-down, and the earlier ODBC connection should be there. Clicking “Test Connection” should return “Test connection succeeded”.
Create ODBC Connection to MySQL
Connect SQL-Drill to MySQL via ODBC

Reference: -> http://blog.mclaughlinsoftware.com/microsoft-excel/accessing-to-mysql/

Using SQL Drill

SQL-Drill is very easy to use. After connecting, all the tables are shown on the right. Drag and drop tables into the workspace. Tick the columns you want data from; the select query will be visible, and you can execute the query.

SQL-Drill worked great for a SQL Server Database as it identified all foreign keys and relationships between the tables. As a result it made intelligent select statements.

For MySQL however, sql drill didn’t identify multiple foreign keys and as a result did not have the relationship between the tables. As a result for MySQL, it did not create intelligent select statements (i.e. with Joins and inner selects).SQL-Drill Usage on a SQLServer DB showing the relationships identified between tables.

SQL-Drill Usage on a SQLServer DB showing the relationships identified between tables.
Posted in Uncategorized | Tagged , | Comments Off on SQL Drill – Excel Add-In for building and running SQL queries

‘systeminfo’ – Information about Windows, uptime, etc.

If you need to find out when Windows last rebooted, due to Windows Updates etc, open a Command Prompt, and issue:

systeminfo

A sample of the output is as follows:

C:\Users\sburke>systeminfo  
Host Name:                 SSITECH
OS Name:                   Microsoft Windows 7 Professional OS
Version:                   6.1.7601 Service Pack 1 Build 7601 OS
Manufacturer:              Microsoft Corporation OS
Configuration:             Standalone Workstation OS Build
Type:                      Multiprocessor Free
Registered Owner:          sburke
Registered Organization:
Product ID:                00xxx-OEM-xxxxx
Original Install Date:     13/10/2011, 16:51:59
System Boot Time:          14/03/2012, 09:03:02
System Manufacturer:       Dell Inc.
System Model:              Precision M65
System Type:               x64-based PC
Processor(s):              1 Processor(s) Installed.                            
  [01]: Intel64 Family 6 Model 30 Stepping 5 GenuineIntel ~1728 Mhz
BIOS Version:              Dell Inc. A07, 25/09/2011
Windows Directory:         C:\Windows
System Directory:          C:\Windows\system32
Boot Device:               \Device\HarddiskVolume2
System Locale:             en-ie;English (Ireland)
Input Locale:              en-ie;English (Ireland)
Time Zone:                 (UTC) Dublin, Edinburgh, Lisbon, London Total
Physical Memory:           8,116 MB
Available Physical Memory: 5,579 MB
Virtual Memory: Max Size:  16,231 MB
Virtual Memory: Available: 13,342 MB
Virtual Memory: In Use:    2,889 MB
Page File Location(s):     C:\pagefile.sys
Domain:                    WORKGROUP
Logon Server:              \\PC-Name
Hotfix(s):                 77 Hotfix(s) Installed.                           
  [01]: 982861                           
  [02]: KB971033
Posted in IT | Comments Off on ‘systeminfo’ – Information about Windows, uptime, etc.

Resize VDI Virtual Disk in Virtual Box

VBoxManage modifyhd YOUR_HARD_DISK.vdi --resize SIZE_IN_MB

Also, when Windows is up, go to Disk Management and do a Extend. Job done.

http://www.webupd8.org/2011/02/how-to-easily-resize-virtualbox-40-hard.html

http://knol.google.com/k/charles-dow/oracle-vm-virtualbox-4-resize-a-vdi-file/144er4yyac1zo/14

Posted in Uncategorized | Comments Off on Resize VDI Virtual Disk in Virtual Box

Error (0xc0000225) installing Windows 7 on VirtualBox

What I thought would be very quick and easy, to install Windows 7 on Virtual Box, led me having to do some googling after getting the error:

Windows Boot Manager
Windows failed to start. A recent hardware or software change might be the cause.
To fix the problem......

Status: 0xc0000225
Info: An unexpected error has occurred.


When creating the VM in VirtualBox it asked me for the guest OS which I choose “Windows 7”, thinking that by doing this, it would all work!

To resolve this error, thankfully its a simple fix:

  • Power Down the Virtual Machine
  • Go to the Settings of the Virtual Machine
  • Under “System” tick on “Enable IO APIC”

(Reference)

 

Posted in IT, Virtualization | Tagged , | 8 Comments