how to delete cdfs partition from usb stick?

Place to discuss anything, almost. No politics, religion, Microsoft, or anything else that I (the nazi censor) deem inappropriate.
Post Reply
Ice9
guru
guru
Posts: 577
Joined: Thu Jan 09, 2003 12:40 am
Location: Belgium
Contact:

how to delete cdfs partition from usb stick?

Post by Ice9 »

I recently got one of those new U3 usb sticks and started to play with it.

On my linux box I couldn't see the whole 1GB (only 973MB) capacity and wondered why, so I plugged the stick into my work laptop running XPiss ...
What happens is that there is a small partition (cdfs formatted apparently)of about 4MB which identifies itself as a CD drive and launches an autorun, which in turn spawns a kind of start menu, etc ...
In Winblows I can see the partition, right-click on it but "format" is greyed out, in linux I can't even see anything more than the /dev/sda1 partition of 973MB.
I tried fdisk, cfdisk, sfdisk and qtparted, none of these showed the "hidden" cdfs partition.

When I do a tail /var/log/messages I can see 2 new entries though, one is /dev/sda1 and the other is /dev/sg0, but I can't seem to access or mount /dev/sg0

Does anyone have an idea on how I could delete that cdfs partition and have access to the 27MB space it reserves?

User avatar
Void Main
Site Admin
Site Admin
Posts: 5716
Joined: Wed Jan 08, 2003 5:24 am
Location: Tuxville, USA
Contact:

Post by Void Main »

Not having one of these I have read some things that would indicate this is a read-only partition. It might just be something that you can not mess with. However in the docs it says it will only take a maximum of 5MB of space away from your total:

http://www.verbatim.com/u3/docs/U3%20Smart%20Drive.PDF

You actually are not missing 27MB. In fact you are missing much more than that (there are 1024MB in a 1GB). But, you'll never get 1024MB of free space on a formated file system on a 1GB device. You have to remember that a chunk of space is allocated for the FAT or for the inode table (depending on what type of file system you are formatting). That area is not counted as free space and is where the extra space "disappears" to. So basically you probably only have 4 or 5MB that you can not touch due to that partition (or whatever it is).

Ice9
guru
guru
Posts: 577
Joined: Thu Jan 09, 2003 12:40 am
Location: Belgium
Contact:

Post by Ice9 »

From what I understood the 27MB is somewhat reserved for the installation of their custom applications as well ....

So you tend to think I can't wipe out that read-only partition?
If so I will be very quick to exchange it for a counterpart without that Windows only U3 marketing blitz!

Edit: I know this might seem childish, but since I started using Linux I grew very much into the "control" thing! I want to be able to control everything I own and if someone installs a Windows only piece of software on a storage device I onw I want to be able to wipe it clean instead of potentially carrying stuff I don't want it to ...

User avatar
Void Main
Site Admin
Site Admin
Posts: 5716
Joined: Wed Jan 08, 2003 5:24 am
Location: Tuxville, USA
Contact:

Post by Void Main »

But where are you getting this "27MB" number from? From their documentation is should only be 5MB. I could be completely wrong though. I just saw the 5MB number. As far as it not being able to be deleted it's very hard for me to say and I can only speculate. I think it could be made read-only at the hardware level (like ROM) in which case you wouldn't be able to delete it. The only thing that doesn't make sense about that is I would think that would require a separate chip. This sounds like it is taking an existing portion of the flash and making it read-only. Also, is that partition really read-only? Seems odd that it is done to take "advantage" of the autorun feature but not be able to change the contents of the autorun file. I did some searches but didn't come up with much. Wish I had one to play with. I fully understand you not wanting this space wasted on Windows only garbage though. I probably wouldn't buy one just because of that now that I know.

P.S. Maybe it's as simple as wiping out the partition table on the drive and creating a fresh one. Do a search for Damn Small Linux USB installs (or similar pen drive installs). They usually have instructions for wiping out the partition table.

Ice9
guru
guru
Posts: 577
Joined: Thu Jan 09, 2003 12:40 am
Location: Belgium
Contact:

Post by Ice9 »

The 27MB comes from the fact that I can only detect 973MB of free space when I plug in the stick, no matter what OS I use (if one can label Windows an "OS" anyway).
I asked the sales rep and that's what he told me, but I just said it he's a sales rep, not a techie so I might be totally wrong with my 27MB statement ...

Thanks for the DSL tip, I'll check it out right away while trying to solve the segmentation fault on my kid's quake3 install :D

User avatar
Void Main
Site Admin
Site Admin
Posts: 5716
Joined: Wed Jan 08, 2003 5:24 am
Location: Tuxville, USA
Contact:

Post by Void Main »

Ice9 wrote:The 27MB comes from the fact that I can only detect 973MB of free space when I plug in the stick, no matter what OS I use (if one can label Windows an "OS" anyway).
I asked the sales rep and that's what he told me, but I just said it he's a sales rep, not a techie so I might be totally wrong with my 27MB statement ...

Thanks for the DSL tip, I'll check it out right away while trying to solve the segmentation fault on my kid's quake3 install :D
I already explained the missing 27MB. I said that there is actually 1024MB in 1GB so you should actually see 51MB missing. But that is normal for any type of disk drive formatted with a file system. There is a certain percentage of the drive that has to be dedicated to the file allocation table (or inode table with UNIX type file systems). This percentage is not counted in the "free space" because it can't be used to store data. You will never see free space equal to the physical size of a drive on any type of drive, unless it's not formatted that is.

Check out my 256MB USB stick:

$ fdisk -l /dev/sda

Code: Select all

Disk /dev/sda: 256 MB, 256900608 bytes
8 heads, 62 sectors/track, 1011 cylinders
Units = cylinders of 496 * 512 = 253952 bytes

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *           1        1011      250697    6  FAT16
$ df -h /dev/sda1

Code: Select all

Filesystem            Size  Used Avail Use% Mounted on
/dev/sda1             245M  154M   92M  63% /media/usbdisk
Where did that 11MB disappear to? It's in the FAT.

Ice9
guru
guru
Posts: 577
Joined: Thu Jan 09, 2003 12:40 am
Location: Belgium
Contact:

Post by Ice9 »

I already explained the missing 27MB
I read it and it made perfect sense, I just didn't think that this much space would be needed for a FAT ...
And then there still is my gripe with the Windoze virus files on the stick :wink:

User avatar
Void Main
Site Admin
Site Admin
Posts: 5716
Joined: Wed Jan 08, 2003 5:24 am
Location: Tuxville, USA
Contact:

Post by Void Main »

As you can see there is 11MB on my 256MB stick. That would mean on yours you could expect about 44MB. Add the 5MB the company says is used by that hidden partition and it comes to 49MB which is pretty close to the 51MB you get when you subtract 973 from 1024. That looks normal. However, you have a good argument just based on principle and having those Windows files on there. I would probably react the same way.

Post Reply