I was reading about magical Chinese drives. How would this be done? The post talks about a 'looped mode' and comments suggest having a different controller to lie to the OS.

I went and bought one of these devices, tried it and it worked as advertized (overwriting data when it was full), although when I formatted it, it started showing its 'true' capacity.

How is this achieved?

  • 6
  • 14
    I think the question would be better titled "How is the capacity of flash memory faked" since it is actually about faking the amount of storage on a flash drive, not a magnetic hard disk. Apr 13, 2011 at 12:12
  • I want one of those Chinese magic drives, but I am not flying to China to get one!, would make a great geek gag gift.
    – Moab
    Apr 13, 2011 at 15:23
  • +1. I had never heard of this before seeing this question "rocket to the top of the charts" in the Hot Questions view.
    – jprete
    Apr 13, 2011 at 23:05
  • heh.. thanks :) I wasn't expecting this kind of a response when i got curious about a 'harddisk' with 2 giant nut-bolts in the case Apr 14, 2011 at 5:46

7 Answers 7


FAT32 has a master table with free space. You can hexedit that master table to show any amount of free space. I've had a floppy disc sized 3.7 GB for ages now.

  • 4
    Yes, you can tamper with the FAT, but there are also ways to tinker with the micro-controller to lie to the OS. Windows will indeed repeatedly format the disk incorrectly identifying it as much larger than it actually is. Usually they have some sort of built-in algorithm to loop the flash chip in such a way that the OS actually is able to create a valid (looking) master-table.
    – TheCompWiz
    Apr 13, 2011 at 17:53
  • as i start to poke around and mess with the master table and the controller, I expect more questions to follow this :) Apr 14, 2011 at 6:05
  • 2
    Care to elaborate on where to find the master table or how to edit it?
    – Ivo Flipse
    Apr 19, 2011 at 19:02
  • 2
    I'd love to see some documentation on this, I've tried replicating this with programming and have been unable to fool the OS into seing the size. see this thread here to see what I tried stackoverflow.com/questions/7482920/…
    – cromestant
    Sep 22, 2011 at 8:13
  • I've had a magazine using Norton Commander and hexedit to change the reported partition size. Too bad I've lost the magazine.
    – Barfieldmv
    Sep 22, 2011 at 13:24

The hardware is not modified - the file table is simply modified to fool the OS. During a format the file table gets wiped and thus the genuine capacity reading is restored.

You can get caught by these type of cheap fake flashdrive or even hard drives in China all the time if you go to a non-reputable seller.

  • 11
    Last year I bought a supposedly 64Gb memory stick from China on Ebay for £15. I should have known that capacity wouldn't be available for the price. In fact it was 4Gb with a fake leading "6" etched on the label. The way the file system was scrambled meant you wouldn't notice a problem until more than 4Gb was copied onto the device, at which point new files just started overwriting portions of existing ones. I was never able to reformat the thing so I could at least use it as a 4Gb stick. Apr 13, 2011 at 13:33
  • 7
    @FumbleFingers, Yes, it is common for the sellers to screw up the chip info, so you can not format directly, but you have to do this: 1. use ChipGenius software+mass production tool to fix the chip info. 2. use a low level formatting tool to perform the actual format. Here's a guide: agnipulse.com/2010/04/how-i-fixed-a-fake-64gb-usb-drive
    – KoKo
    Apr 13, 2011 at 13:43
  • Thanks! Maybe I can get a bit of value out of it after all (if I haven't already chucked it in the bin in frustration). Apr 13, 2011 at 13:57
  • The hardware is not modified - sometimes the firmware is modified to lie, so even a reformat/partition table wipe won't reveal the truth. for example This fake-capacity drive comes with a lying firmware (where, after writing roughly 46GB, the data is written to GB #2 + , corrupting whatever was using GB #2 previously)
    – hanshenrik
    Jun 24, 2022 at 11:47

Until I saw your message I was sure it was a different controller - using a modified controller, you can tell anything you like to the OS. But given that the format modifies this behaviour, it means that some kind of trickery took place in the file system level as well. This raises two options:

  • This is a modification of the controller that simply doesn't work after formatting because it depends on a file system modification (which still seems to me as more likely).

  • There is another way to do this without a hardware modification, e.g. by modifying a free blocks linked list to be circular (I am not familiar enough with the specifics of FAT32 to decide if this is possible - might check in a few days if no one else does first...).

EDIT: It is naive to assume FAT32 is being used, a much more likely scenario is that a different file system that inadvertently allows such circular free space management trickery is used (as long as that file system is also supported by the OS - it would be virtually invisible to the user). This makes looking at such a device much more interesting...

  • 2
    It's a file system thing, I'm sure of it. These drives aren't modified physically.
    – crasic
    Apr 13, 2011 at 5:44
  • 4
    i would however buy such smaller thing.. for testing purpose :) Apr 13, 2011 at 5:49
  • 1
    If you're going to the effort of using a custom or modified controller then you lose the price savings of bulk buying cheap controllers. Thus it seems far more likely to me that it is purely done at the file system level - a raw write with dd is quick, cheap and easy compared to replacing/modifying hardware. Apr 19, 2011 at 13:02

Here is how you create a 1,000,000,000,000 bytes (1 TB) disk on key (using Linux):

  1. Create fake formatted 1 TB disk:

    mkdosfs -C  temp_file 1000000000
  2. Check that it really happened

    ls -lh temp_file
  3. Connect your DoK and check how it was mounted:

  4. Find the device name, something like /dev/sdb1 (If you make a mistake here, you might ruin some other disk connected to the system, so be careful !)

  5. Unmount it:

    sudo umount /dev/sdb1
  6. Find out the size of our FAT table:

    ls -s temp_file

(The first number is the size in kilobytes)

  1. Copy over to DoK

    echo "head -c [size_from_above]K temp_file > /dev/sdb1" | sudo sh
  2. Freak out your friend!You can mount it locally for playing around like this:

    mkdir test
    sudo mount temp_file test -o loop

Quite simple,

The flash chip controller contains some settings. Product ID, Vendor ID, and number & size of flashchips.

By taking an older device with a small chip, overwriting the firmware with an wrong number of flash chips, the total drive capacity will be larger than de number of installed flash.

Because the amount of adress lines has not changed, the chip will always be written to. For example, first 128 MB will be written, then the next chip is selected, then another 128 will be written.

Because there is only one chip, the select line is not connected and the second flashchip data overwrites the first chips data.

Because the controller reports the size of all the chips, including the not connected ones to the OS, the OS will happily format it the wrong size.

  • 3
    The problem here is that if it is done this way in hardware newer data would also overwrite the FAT32 file allocation table and root directory near the beginning of the drive, thus making the drive unusable until it is reformatted. The fact that this doesn't happen suggests that it is a filesystem hack that makes it work.
    – Mokubai
    Apr 14, 2011 at 7:44
  • yup, ingenious as it is, this would get caught very quickly. Apr 14, 2011 at 7:46

Two methods exist to do this:

  1. Partition :exist several tools for modify and create a partition manually. For example, it is possible to select more cylinders that the real available. Is trivial to do that. Ex. partition magic and i think even fdisk can do that

  2. Device Firmware :The other method is to modify the firmware of the device. Most devices (but not all), have their information (Plug&Play and other information) contained in the firmware.

For example, an usual trick is to use a firmware of a hard disk of more capacity in a device of less capacity and to "increase" the space.


Most common method is firmware 'hacking'. I deal with these cards and flash drives all the time and I have never seen this simplistic file system level hack. There's 2 things the 'hacker' needs to accomplish:

  1. Device has to report a fake capacity.
  2. Device has to suppress errors when data is written to non existing NAND.

Hardware does not have to be changed. The reason we can do this is, is because all LBA addresses are 'virtual' anyway, we can map any LBA address to any physical address (PBA) we want at the firmware level. And probably all the 'hacker' would need is a piece of software the manufacturer himself uses to configure the firmware.

Most common M.O. for a fake flash drive is to simply drop writes after actual capacity. So let's assume a 256 GB fake drive with only 8 GB NAND installed then up to 8 GB all's well and it is in this area the file system stores most of it's meta data. Assuming some variant of FAT:

Boot sector | File Allocation Fable(s) | Root | DATA

The ROOT and subfolder created at this time can be created without issues.

                    - FILE1
                    - FILE2
                    - FILE3
                    - FILE4

02 8A 00 28 A0 02 8A 00 28 A0 02 (FILE1)
8A 00 28 A0 02 8A 00 28 A0 02 8A
00 28 A0 02 8A 00 28 A0 02 8A 00 (FILE2)
28 A0 02 8A 00 28 A0 02 8A 00 28 
A0 02 8A 00 28 A0 02 8A 00 28 A0 (FILE3)
02 8A 00 28 A0 02 8A 00 28 A0 02 
-------------------------------- end real NAND
00 00 00 00 00 00 00 00 00 00 00 (FILE4)
00 00 00 00 00 00 00 00 00 00 00

As we save data 'real' NAND will gradually fill until we start writing to LBA sectors the firmware can not map to existing NAND. Usually this would get you an error but this is where the modified firmware starts fooling us.

Not only will it allow us to write to non existing NAND, it even allows us to read. And it's often at this point that user discovers something is wrong as he'll find such files to be corrupt.

While all meta data for FILE4 can be created as the directory structure and FAT are in real NAND memory, the file data will never actually be written anywhere.

We now immediately see why sometimes people catch the issue early when for example using a full NTFS format on their USB flash drive as this will try writing and verifying a backup boot sector towards the end and thus in non exiting NAND.

Since the 'hack' is at the firmware level, we can often undo it using so called mass-production tools (MPTools) that are normally used by the manufacturer to configure the firmware.

ChipGenius (the tool on the right) is used to determine the controller. With that we can find a MPTool to modify our firmware and restore the drive to it's real capacity:

enter image description here

BTW, one should wonder if it's wise to restore any such device to it's real capacity, IMO it's wiser to dispose of it.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .