Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Re-partitioning (or re-sizing) Compact Flash

0 views
Skip to first unread message

cpnet

unread,
Nov 11, 2009, 3:40:13 PM11/11/09
to
I'm looking for info on how to write some code that will allow a user to
re-partition or at least resize the partition of their Compact Flash cards.
I'm not sure this is the best newsgroup for this question so if this is not
the place, can someone direct me to a better newsgroup?

I'm hoping to write my code in C#, but from what I have found so far, it
looks like I'll have to dip into unmanaged code (it seems I'll need to use
DeviceIOControl). I want my app to run on XP, Vista and Windows 7. My
first question, is whether or not this is even possible? It seems that in
XP at least, there's restrictions against repartitioning removable media? I
just don't want to spend hours trying to figure out how to use
DeviceIOControl only to find out that it doesn't work because the OS simply
blocks partitioning/formatting of Compact Flash media.

Thanks for any help.

David Craig

unread,
Nov 11, 2009, 7:50:35 PM11/11/09
to
You can partition a removable media any way you like, but the OS won't like
it. Open the physical drive and you can write anywhere, anytime, anything.
You may need and should lock the drive and dismount it, but that is just
some IoCtls. Also check out some open source utilities such as mkdosfs.exe
to assist you. There are Windows versions available that I use on CF cards.
Just make sure, using WinHex, that the media reader/writer you are using
allow you access to the entire media and not just the volume. Some
notebooks have card slots that only expose the volume via their driver
(Ricoh, is one).

"cpnet" <cp...@newsgroup.nospam> wrote in message
news:eED8x4wY...@TK2MSFTNGP04.phx.gbl...

cpnet

unread,
Nov 12, 2009, 12:24:32 PM11/12/09
to
Hi David,

Thanks for the info. When you say the "OS won't like it" if I partition the
card what exactly do you mean? Does this mean that Windows won't be able to
use/see the card? My goal here would be to only have a single partition,
but just to change the size, and then format it as FAT32 volume. If I keep
things to a single active partition formatted with FAT32, will Windows still
not like it?

The reason I'm looking for this is that I have a drum sound module that can
only use CF cards up to 512 MB. It's hard to find CF cards that small these
days, and bigger cards are cheap. I'm hoping to be able to provide people a
way to 'shrink' the size of their larger CF cards so that they'll work with
the module. There is already other PC software that allows people to manage
to save a load drum kits from the CF card. I'm not sure exactly how this
software works, but I'm assuming if Windows can still read the card after
I've 'shrunk' it, then this software should be able to continue to work, and
the drum module will also work with the cards.

David Craig

unread,
Nov 12, 2009, 4:44:40 PM11/12/09
to
Normally the OS will not mount any additional partitions on removable media.
I do not have access to the CF specifications, but you may want to consider
reviewing them to ensure your smaller partition is formatted according to
those specifications, if they have such specs. I know that SD, Memory
Stick, and xD have VERY specific layouts for each media size that are
designed to reduce wear on the media by keeping logical and physical blocks
aligned. If a logical block requires more than one physical block to be
written that would require two erases, two writes and two reassignments of
logical to physical mapping. It is the erasure of flash memory that causes
wear.


"cpnet" <cp...@newsgroup.nospam> wrote in message

news:%23n0RGw7...@TK2MSFTNGP04.phx.gbl...

0 new messages