Ink Blot welcomes you to Lance's Web Site!

I've decided to resurrect my web site on a limited basis; mainly to discuss FAT32X, but also to test a new site build process. LC

(best viewed at 800x600 full screen!)


Home
Boot Sectors
FAT32X
Utility Programs
Site Map

FAT32X

The FAT32X Conversion

(Converting FAT32X to FAT32)

Disclaimer

This procedure is believed to be correct, but I assume no responsibility for your use of this procedure or the utility programs. Any damages or data loss caused is solely your reponsibilty.

Overview

This procedure was developed to determine the possibility of converting a FAT32X partition to a FAT32 partition. At the present time I have no real use for the procedure, but I thought it was an interesting problem.

Restrictions

This procedure as written will only work for a fixed disk with a single FAT32X partition. If you have multiple partitions then you will need to adjust the calculations for the addresses and number of sectors. If you have a disk over 8GB, then any sectors not physically addressable by the BIOS will be unavailable. (Although you can use an ExtendedX partition to get to the remainder of the disk).

Test Procedure

The test platform was a Tyan Titan motherboard with Award BIOS, and a Maxtor 4.3GB disk. The BIOS setting for the disk was set to NORMAL, which forced the BIOS geometry to 1023x16x63.

Another test case was run with the same motherboard, but using a Western Digital 1GB disk set to LBA mode. This put the BIOS geometry at CxHxS.

The boot floppy was a DOS 7.10 floppy created by Win95B (format a: /s). The FDISK and FORMAT utilities were copied to the floppy, along with my BOOTSECT, MBREDIT, and PBREDIT utilities.

Test Setup

  • Setup Disk as FAT32X.
    • Boot from floppy disk.
    • Create a primary DOS partition, FDISK.
    • Verify that a FAT32X partition (type 0Ch) was created, BOOTSECT 0 -M -T
    • Format the fixed disk and transfer the system, FORMAT C: /S
  • Install Windows95B
    • Boot from fixed disk.
    • Copy the iomega ZIP disk GUEST program and related files to fixed disk.
    • Copy the WIN95B setup files from ZIP disk to fixed disk.
    • Run SETUP and install Win95 with typical/default options.

Conversion

  • Defrag the disk.
    Boot Windows95. Run Defrag (Start/Programs/Accessories/System Tools/Disk Defragmenter) and defragment the disk whether it needs it or not. Exit Windows95.

  • Change BIOS disk parameters from NORMAL to LBA.
    This step is only necessary if your BIOS is set to NORMAL, i.e. not translating the actual disk geometry. When the BIOS is not translating, the BIOS disk parameters are usually 1023x16x63.

    If your disk is less than 8GB, after the switch the number of tracks (cylinders x heads) should be close to the actual number of tracks on the drive. In my case, the BIOS tracks are now 133875 (525 x 255), and the actual tracks are 133984 (8374 x 16).

    If your disk is larger than 8GB, your new BIOS geometry should be 1023x255x63, 1023x240x63, or something similar. This is the maximum number of sectors possible to address without using the int13 extensions.

    After the mode switch, the system should still boot properly. The master boot record hasn't changed, and neither has the location of the FAT32 partition boot record (0.1.1).

  • Boot from floppy.

  • Save current master boot record.
    A:\>bootsect 0 -m -r save.mbr
    
    BOOTSECT (01.07, 05/07/98) - Read/Write/etc Boot Records
    
    Reading master boot record from drive 0
    Writing to 'save.mbr'
    
  • Save current partition boot record.
    A:\>bootsect c: -p -r save.pbr
    
    BOOTSECT (01.07, 05/07/98) - Read/Write/etc Boot Records
    
    Reading partition boot record from drive C
    Writing to 'save.pbr'
    
  • Calculate disk parameters.
    Use the BOOTSECT utility to determine the BIOS disk parameters.
    A:\>bootsect 0 -m -t
    BOOTSECT (01.07, 05/07/98) - Read/Write/etc Boot Records
    
    Reading master boot record from drive 0
    
    Partition table for drive 0:
    Part  Boot  Sys   Start Address   End Address   Starting  Number of
    Num   Flag  Type   Cyl Head Sec   Cyl Head Sec    Sector    Sectors
      0    80h  0Ch      0   1   1   1022  15  63         63    8440929
      1    00h  00h      0   0   0      0   0   0          0          0
      2    00h  00h      0   0   0      0   0   0          0          0
      3    00h  00h      0   0   0      0   0   0          0          0
    
    Drive 0  Cylinders= 524 Heads=255 Sectors=63
    Actual   Cylinders=8374 Heads=16 Sectors=63
    
    Multiply the BIOS disk geometry parameters (Drive 0 line) together to determine the total number of addressable sectors. In my case the BIOS geometry is 524x255x63, or 8418060 sectors.

    Subtract 63 (sectors per track) from this number. This is the new number of sectors in the partition. In my case, the value is 8417997.

    Determine the ending address of the partition. Since cylinder and head numbers start from 0, the ending address will be (maxcyls-1).(maxheads-1).(maxsecs). In my case, the ending address is 523.254.63.

  • Modify the master boot record.
    The MBREDIT utility allows you to change data in the master boot record's partition table. A before and after snapshot will be printed, and the data is not actually changed until you include the -W flag. The partition type needs to be changed from FAT32X to FAT32, and the ending address of the partition also needs to be reset. The utility will automatically calculate the new number of sectors in the partition, which should match your calculation above.
    A:\>mbredit 0 -t $0b -e 524.254.63
    
    MBREDIT (01.04, 04/25/98) - Master Boot Record Edit
    
    Drive 0  Cylinders=524 Heads=255 Sectors=63
    Reading master boot record from drive 0
    
    Current partition table for drive 0:
    Part Boot Sys  Start Address  End Address    Start    End
    Num  Flag Type  Cyl Head Sec  Cyl Head Sec   Sector   Sector  Sectors
    Error in ending C.H.S for partition 0
      0   80h 0Ch     0   1   1  1022  15  63        63        0  8440929
      1   00h 00h     0   0   0     0   0   0         0        0        0
      2   00h 00h     0   0   0     0   0   0         0        0        0
      3   00h 00h     0   0   0     0   0   0         0        0        0
    
    Modified partition table for drive 0:
    Part Boot Sys  Start Address  End Address    Start    End
    Num  Flag Type  Cyl Head Sec  Cyl Head Sec   Sector   Sector  Sectors
      0   80h 0Bh     0   1   1   523 254  63        63  8418059  8417997
      1   00h 00h     0   0   0     0   0   0         0        0        0
      2   00h 00h     0   0   0     0   0   0         0        0        0
      3   00h 00h     0   0   0     0   0   0         0        0        0
    
    NOT Writing master boot record to drive 0
    
    The message 'Error in ending C.H.S for partition 0' is expected. This program does not take the int13 extensions into account. The program calculates the ending sector from the ending address based on the BIOS geometry, and compares it to the starting sector + number of sectors.

    The modified ending sector should be one less than the total number of sectors you calculated for the partition (sector numbering starts at 0). The modified number of sectors should be the same as the new number of sectors you calculated for the partition.

    Once you are satisfied with the result, actually write the data by adding the -W flag.
    A:\>mbredit 0 -t $0b -e 524.254.63 -w
    
  • Modify the partition boot record.
    The PBREDIT utility allows you to change data in the partition boot record. A before and after snapshot will be printed, and the data is not actually changed until you include the -W flag. The number of sectors needs to be changed to reflect the new partition size, and the number of heads needs to be changed (if that value changed).
    A:\>pbredit c: -t 8417997 -h 255
    
    PBREDIT (01.02, 05/03/98) - Partition Boot Record Edit
    
    Reading partition boot record from drive C
    
    Current FAT info for drive C:
    
    System ID            MSWIN4.1
    bytes.per.sector     512
    sectors.per.cluster  8
    reserved.sectors     32
    fat.copies           2
    root.dir.entries     0
    total.sectors        0
    media.desc           F8h
    sectors.per.fat      0
    sectors.per.track    63
    heads                16
    hidden.sectors       63
    big.total.sectors    8440929
    big.sectors.per.fat  8236
    extflags             0000h
    fsversion            0000h
    root.start.cluster   2
    fsinfo.sector        1
    backup.boot.sector   6
    reserved1            0000h
    reserved2            0000h
    reserved3            0000h
    reserved4            0000h
    reserved5            0000h
    reserved6            0000h
    drive                80h
    head                 0
    signature            29h
    volume.serial        0F34-1AE6
    volume.label         NO NAME
    file.system.id       FAT32
    
    Modified FAT info for drive C:
    
    System ID            MSWIN4.1
    bytes.per.sector     512
    sectors.per.cluster  8
    reserved.sectors     32
    fat.copies           2
    root.dir.entries     0
    total.sectors        0
    media.desc           F8h
    sectors.per.fat      0
    sectors.per.track    63
    heads                255
    hidden.sectors       63
    big.total.sectors    8417997
    big.sectors.per.fat  8236
    extflags             0000h
    fsversion            0000h
    root.start.cluster   2
    fsinfo.sector        1
    backup.boot.sector   6
    reserved1            0000h
    reserved2            0000h
    reserved3            0000h
    reserved4            0000h
    reserved5            0000h
    reserved6            0000h
    drive                80h
    head                 0
    signature            29h
    volume.serial        0F34-1AE6
    volume.label         NO NAME
    file.system.id       FAT32
    
    NOT Writing partition boot record to drive C
    
    Once you are satisfied with the result, lock the C: drive and actually write the data by adding the -W flag. The LOCK command enables you to write directly to the C: volume using the DOS direct disk I/O functions used by PBREDIT.
    A:\>lock c:
    
    WARNING: The LOCK command enables direct disk access by programs
    that can CORRUPT file names and/or DESTROY disk data, resulting in the
    loss of files on your disk.
    
    Are you sure (Y/N)?y
    
    A:\>pbredit c: -t 8417997 -h 255 -w
    
  • Start Windows95.
    If you did everything correctly, the system will boot and Windows 95 will start. If you didn't, then recheck your numbers and try again. If all else fails, see below for instructions on restoring your original boot sectors.

  • Run Scandisk.
    After you start Windows95, immediately run the ScanDisk utility (Start/Programs/Accessories/System Tools/ScanDisk). ScanDisk should detect an error in the 'boot area' of your disk. This is expected. This is caused by the 'free cluster count' field in the FSINFO sector (typically sector 2) being inconsistent with actual number of free clusters due to the reduced number of sectors on the drive. Allow ScanDisk to correct the errors.

  • Shutdown Windows95.

  • You're done!

Restoring Your Original Boot Sectors

You can use the BOOTSECT utility to restore your original saved boot sector images as follows:
A:\>bootsect 0 -m -w -z save.mbr

BOOTSECT (01.07, 05/07/98) - Read/Write/etc Boot Records

Reading master boot record from drive 0
Reading new record from 'save.mbr'
Replacing entire contents of record!
Writing master boot record to drive 0
OK

A:\>bootsect c: -p -w -z save.pbr

BOOTSECT (01.07, 05/07/98) - Read/Write/etc Boot Records

Reading partition boot record from drive C
Reading new record from 'save.pbr'
Replacing entire contents of record!
Writing partition boot record to drive C
OK

Gotchas

I would forsee two major problems:
1) If you were using more disk space than is BIOS addressable.
2) If you had unmovable clusters beyond the area that is BIOS addressable.
Both of these problems could be solved with a cluster scanner - a program that would be run after defrag to determine the highwater cluster number and its address.

Afterward

This procedure worked for me in two test cases. If you try this procedure, I'd like to hear about your results - good or bad.

References

BOOTSECT
MBREDIT
PBREDIT
Lance Costanzo, [email protected]