Reformat an NTFS disk to FAT32?

Ben Scott dragonhawk at gmail.com
Sun Apr 20 12:18:27 EDT 2008


On Sun, Apr 20, 2008 at 11:11 AM, Bruce Labitt <bruce.labitt at verizon.net> wrote:
> I've looked around for this and I see a way or two to do this.

  As usual, I'm going to ask: Why are you doing this?  What are you
trying to accomplish?  :-)

>  One could use mkdosfs, but the documentation indicates that
> the disk won't be bootable.

  Any FAT filesystem created by mkdosfs won't be bootable, because all
mkdosfs does is create a filesystem.  It doesn't install an operating
system.

  What OS are you looking to boot from the FAT partition?  Or are you?

  Generally speaking, if you're looking to install a bootable OS, I
recommend using the tools native to that OS to do so.

  In the world of Microsoft, to install a bootable MS-DOS, you boot
from floppy or CD.  You use FDISK to create the partition, then
rebooted (still from floppy/CD) (DOS only checked the partition table
at boot).  Then you ran "SYS C:" (where "C:" is the partition you just
created).  That installed a boot loader and copied the DOS sustems
files (IO.SYS and MSDOS.SYS) to the proper places, along with the
shell (COMMAND.COM).

  Windows NT and descendants generally require you to run the
full-blown GUI "SETUP" routine.  The OS is too complicated; there's no
trivial install possible.

  Windows 3.x/95/98/ME load on top of DOS, and aren't really magic
beyond that, but getting a working install going in the first place
still needs the "SETUP" routine.

>  I think it should be possible in fdisk ...

  fdisk only works with partitions, not filesystems.

  You might want to use a more sophisticated tool, like qtparted or
gparted or even parted (command line), which handles more of this
stuff for you.  If you'd rather know the gory details:

  Generally speaking, creating a mountable filesystem is a two-step process.

  First, you create a partition for the filesystem to live in.  A
partition designates a "slice" of the disk for some particular task
(like holding a filesystem).  Each partition has a type code which
helps the OS identify what's supposed to be in the partition.  That's
the type you're seeing in fdisk.  Setting the partition type doesn't
do anything other than change the "type" field in the partition table;
it's up to other things to make the contents of the partition actually
match the type.

  Step two is create the filesystem in the partition.  A filesystem
contains all the housekeeping information to keep track of files,
directories, permissions, last-modified-time, free space, and so on.
Under *nix, one generally uses the some kind of "mkfs" tool to do
this.  (In the Microsoft world, one uses "FORMAT" for all the
Microsoft filesystems.)  "mke2fs" creates Linux EXT2 and EXT3
filesystems.  "mkdosfs" creates FAT and FAT32 filesystems.  "mkswap"
marks a swap partition (which isn't technically a filesystem, but
serves the same purpose for this discussion).

  If the partition type doesn't match the filesystem you actually
write to the partition, things may actually still work, depending on
the OS, the tools you're using, and what you wrote there.  For
example, the ext2 and ext3 drivers in the kernel don't care what the
partition table says; they look for a signature in the superblock.
But tools which look for ext2/3 filesystems to mount for you may only
look at the partition table.  Microsoft's OSes generally require the
partition table to be correct, or Bad Things happen.

>  I'm sure which of the million format options available is "FAT32".

  There are several partition types for FAT32; which one to use
depends on the disk geometry.  If the disk is big enough that it can
no longer use CHS (cylinder, head, sector) to address disk blocks, and
instead *must* use LBA (linear block addressing), FAT partitions get
different type codes.  (Why?  Because MS-DOS, which Windows 98/ME
still boot from, couldn't figure it out without help.)

  You have to use the LBA types for partitions located above the
roughly 8 GB limit of the classic INT13 BIOS interface.  Partitions
which exist entirely below the 8 GB line use the non-LBA type.  (I
think.  It's been a long time.)

  According to my fdisk, the non-LBA FAT32 is type 0x0B, while the LBA
FAT32 is 0x0C (don't enter the "0x" prefix when working in fdisk).

  To get an idea of just what a mess this is, you can see the list of
the approximately 15 different "size barriers" here:

http://www.storagereview.com/guide2000/ref/hdd/bios/size.html

-- Ben


More information about the gnhlug-discuss mailing list