Formatting Fat32 usb drive on Windows

4.1k views Asked by At

What is the best way to format an usb drive (> 32Gb) with Java on Windows?

I tried to use the format function:

Process p = Runtime.getRuntime().exec("CMD /C format f: /FS:FAT32 /Q /X /Y");

But the size of the drive is limited to 32Gb. My usb drive is larger than 100Gb.

Could I do it using JNI or will I be limited with the 32Gb?

4

There are 4 answers

2
r3ap3r On BEST ANSWER

Try this :

http://www.ridgecrop.demon.co.uk/index.htm?fat32format.htm

This is a 3rd party tool for formatting FAT32 drives beyond 32 GB limit. It has both command line and GUI modes.

Exceeding 32 GB limit for FAT32 drives is not possible through the native "format" command on windows.

0
Valentin On

If you keep using format, I don't think you'll be able to avoid the 32 GB limit that Microsoft imposes on FAT32 on all WinNT-based OSes (Win2K+) :

FAT16 and FAT32 do not scale well. As the volume gets bigger, the file allocation table gets bigger, which dramatically increases the amount of time it takes Windows 2000 to compute how much free space is on the boot volume when the system is restarted.

For this reason, you may not create a FAT32 volume larger than 32 GB using the Format utility. However, the Windows 2000 Fastfat driver enables you to mount and fully support a FAT32 volume larger than 32 GB.

You might be able to avoid this limitation using another implementation of FAT32 but I'm not sure one exists for Windows (I didn't find one googling a bit). Or you could use pre-WinNT Windows such as Windows 98 or Millenium Edition but I don't think it would be a good idea.

2
sx3 On

Try this,

Process p = Runtime.getRuntime().exec("CMD /C format f: /FS:NTFS /Q /X /Y");

It will sove your issue..NTFS

0
Nathaniel Hibbler On

APPROACH #1 If your flash drive is F then try formatting as FAT32 at CMD prompt

format F: /FS:FAT32
A failed attempt may look like this: Insert new disk for drive E: and press ENTER when ready... The type of the file system is EXFAT. The new file system is FAT32. Verifying 116.5 GB The volume is too big for FAT32. Format failed.

APPROACH #2 If that does not work then just download a software like Guiformat to perform the FAT32 format (http://ridgecrop.co.uk/index.htm?guiformat.htm)