Mike's PBX Cookbook

Partition a Compact flash

Older Nortel/Avaya systems only accept 512MB Compact flash (CF) cards, and these can be rather hard to find these days! The following procedure shows how to format a larger CF to a smaller compatible size using the Windows command line utility Diskpart.
You can do the same thing on a Mac, by using the diskutil partitionDisk command in Terminal.

BE CAREFUL! This procedure is destructive! Be sure to select the correct disk and volume.
Compact Flash
  1. Put the compact flash into a USB read/writer, and attach it to a Windows computer.
  2. Open a Command prompt window, and type diskpart to open the utility.
  3. Type: list disk
  4. Type: select disk X
    Where X = the disk number assigned to your CF device.
  5. Type: list volume
  6. Type: select volume X
    Where X = the volume number assigned to your CF device
  7. Type: clean all
    This will remove all partitions and data and can take 30 minutes for a 4GB CF card on a modern computer. 'Diskpart succeeded in cleaning the disk' will display when the process is complete.
  8. Type: create partition primary
  9. Type: shrink querymax
    This will display amount by which the volume size can be reduced.
  10. Type: shrink desired X
    Where X = the desired size subtracted from the size listed by the shrink querymax command.
  11. Type: format fs=fat label='mydisk'
    The volume is formatted to the specified size.
  12. Type: exit the leave the utility.

Disk Management utility confirms the CF has a 512MB FAT partition, the remaining space is unallocated:

Partitioning a Compact flash

A 1GB (977MB) CF with a 512MB primary FAT partition.

Note, the CF will stay at it's new size until you run through the procedure again, but without shrinking. Simply reformatting in Windows will not recover the unallocated space, you must run though the procedure to 'clean all' and 'create partition primary'.

TTY Output

The following output shows the process, with a 1GB (977 MB) CF.
Note that an Asterix denotes the currently selected disk or volume in a list:

Microsoft DiskPart version 6.1.7601
Copyright (C) 1999-2008 Microsoft Corporation.
On computer: MIKES-PC

DISKPART> list disk

  Disk ###  Status         Size     Free     Dyn  Gpt
  --------  -------------  -------  -------  ---  ---
  Disk 0    Online          465 GB      0 B
  Disk 1    No Media           0 B      0 B
  Disk 2    No Media           0 B      0 B
  Disk 3    No Media           0 B      0 B
  Disk 4    No Media           0 B      0 B
  Disk 5    Online          977 MB      0 B

DISKPART> select disk 5

Disk 5 is now the selected disk.

DISKPART> list volume

  Volume ###  Ltr  Label        Fs     Type        Size     Status     Info
  ----------  ---  -----------  -----  ----------  -------  ---------  --------
  Volume 0     D                       DVD-ROM         0 B  No Media
  Volume 1         RECOVERY     NTFS   Partition      8 GB  Healthy    System
  Volume 2     C                NTFS   Partition    456 GB  Healthy    Boot
  Volume 3     E                       Removable       0 B  No Media
  Volume 4     F                       Removable       0 B  No Media
  Volume 5     G                       Removable       0 B  No Media
  Volume 6     H                       Removable       0 B  No Media
  Volume 7     I                FAT    Removable    977 MB  Healthy

DISKPART> select volume 7

Volume 7 is the selected volume.

DISKPART> clean all

DiskPart succeeded in cleaning the disk.

DISKPART> create partition primary

DiskPart succeeded in creating the specified partition.

DISKPART> shrink querymax

The maximum number of reclaimable bytes is:  976 MB

DISKPART> shrink desired 465

DiskPart successfully shrunk the volume by:  465 MB

DISKPART> list volume

  Volume ###  Ltr  Label        Fs     Type        Size     Status     Info
  ----------  ---  -----------  -----  ----------  -------  ---------  --------
  Volume 0     D                       DVD-ROM         0 B  No Media
  Volume 1         RECOVERY     NTFS   Partition      8 GB  Healthy    System
  Volume 2     C                NTFS   Partition    456 GB  Healthy    Boot
  Volume 3     E                       Removable       0 B  No Media
  Volume 4     F                       Removable       0 B  No Media
  Volume 5     G                       Removable       0 B  No Media
  Volume 6     H                       Removable       0 B  No Media
* Volume 7     I                RAW    Removable    512 MB  Healthy

DISKPART> format fs=fat label="mydisk"

  100 percent completed

DiskPart successfully formatted the volume.

DISKPART> exit