I did this on Ubuntu 9.10, on other Linux versions it may be a bit more complicated.
The general idea is to use an Open Source removal tool, and apply it to the specific 'generic device' that corresponds to the U3 CD-ROM image. Please note that following these instructions will likely erase all data on the USB key, so only proceed if you don't care.
- Install u3-tool using apt-get (alternatively download it from http://sourceforge.net/projects/u3-tool/ and build it yourself).
- Insert the USB key, notice that both an U3 CD-ROM image and a normal filesystem are mounted
- Use 'df' to check which device is linked to the U3 image, it will show a line like this:
/dev/sr1 6828 6828 0 100% /media/U3 System
- 'dmesg|grep sr1' will show a line like this:
[ 2161.461482] sr 8:0:0:1: Attached scsi CD-ROM sr1
- 'dmesg|grep 8:0:0:1' will show a line like this:
[ 2161.461548] sr 8:0:0:1: Attached scsi generic sg6 type 5
- This finally gives us the device we were looking for; sg6.
- u3_tool_sg -p 0 /dev/sg6
- Agree at the prompt, and poof, U3 will be gone.
- Now you can use a partition editor like GParted to repartition the USB key and reclaim the space used by U3.
Update
On the bright side: the reverse also works. Always wanted to have a USB key that you could load an ISO onto and then boot from it as if it was a real CD-ROM drive?
- u3_tool_sg -p 5000000000 /dev/sg5
- (re-insert the key and re-determine the generic device)
- u3_tool_sg -l some_dvd.iso /dev/sg6
- (optionally re-partition and reformat the plain USB part, which will be sized to the remained of your USB key)