Karbosguide.com - Module 6a.6

About file systems (continued)


The contents:

  • Partitioning with FDISK
  • More than one boot record
  • An FDISK example
  • FDISK /mbr
  • The primary partition and booting
  • Long file names with FAT32
  • Next page
  • Previous page


  • Partitioning with FDISK

    Hard disks can be divided in more than one partition. That is done with the program FDISK, which is found in all PCs - regardless of which version of DOS, Windows , or OS/2 is the operating system. They all have FDISK.

    FDISK can divide the hard disk in up to four partitions. In FAT16, the individual partition must not exceed 2 GB. Therefore it is often seen that the hard disk is not utilized 100%. Look at this picture of FDISK, which has partitioned a 2 GB hard disk. The illustration is in Danish, but you'll see the same in English:


    You can clearly see, that there are actually only two partitions. However, only the upper is assigned a drive letter (C:). The other partition consists of 43 MB unused hard disk, which FDISK identifies as Non DOS. It is not used, because you asked for a 2,020 MB partition. The remainder is left over. The 43 MB is not enough to bother to place in a new partition.


    More than one boot record

    When FDISK has partitioned the hard disk, the file system must be able to recognize this partitioning. Information about the location of beginning and end of each partition is stored in the first sector (number 0), which is called Master Boot Record (MBR). Then, regular boot records are stored in the beginning of each partition on the disk.

    Here is a disk divided in two logical drives, which will be named C: and D:. The Master Boot record is in the first sector of the physical disk. It contains information about the two partitions. In the beginning of each partition we find a new boot record, describing that partition.


    An FDISK example

    You use FDISK to divide the hard disk in one or more partitions. FDISK writes a MBR in sector zero. That divides the rest of the disk in logical drives, each of which is regarded as a "real" drive by the operating system.

    Let us look at the division of an old EIDE hard disk, as it was formatted using Windows 95. The harddisk was sold as 5.1 GB. Actually, it holds 4.8 GB. Through FDISK, this capacity is distributed in three partitions using FAT16. Here are the expressions, as used in Windows 95 version of FDISK:

    First a primary partition is created. We choose to assign it maximum size. That is 2,047 MB, corresponding to 2,146,467,840 bytes. That becomes our C drive, which is activated, so we can boot from there.

    We choose to establish an extended DOS partition for the rest of the disk.

    The extended DOS partition must be divided in logical DOS drives. We choose to make the first logical DOS drive the maximum allowable size. The D drive will then be 2,047 MB, just like the primary partition is.

    A smaller part of the hard disk still remains. We will make that into anaother logical DOS drive. That will have 813,561,344 bytes, or 775 MB. That becomes the E drive.

    Now FDISK reports that the disk has three drives. C: is the primary partition, D: and E: are two logical DOS drives, which are in the extended partition.

    The Physical Disk

    If we look at the physical hard disk, we find that it has a total of 9,974,720 sectors, 512 bytes each. After the partitioning, these almost 10 million sectors are distributed as shown below:

    Physical sector number Contents
    0 Master Boot Record, which describes the entire hard disk
    1 - 4,192,866 Drive C:
    4,192,867 - 8,385,732 Drive D:
    8,385,732 - 9,974,719 Drive E:

    Note, that each of three drives has its own disk administration divided in boot record, FAT, root directory, and data area. If we select the C drive from above, we can see here how the sectors are distributed in the C drive partition:

    Physical sector number Contents
    1 Boot record
    2 - 513 FAT 1 + 2
    514 - 545 The root directory
    546 - 4,192,866 Data area, which is divided in 32 KB clusters


    FDISK /mbr

    Usually the Master Boot Record holds read-only information. It is written once by FDISK during the process of partitioning the drive, but after that it should be left unchanged. However, some programs do change the content of the MBR. This goes for:

  • Virus, certain viruses are occupying the MBR giving them a safe position.
  • System Commander and other multiple boot utilities.

    The multiple boot utilities replace the MBR with code belonging to the utility. This way a utility like System Commander takes over the boot process and allows the user to install several operating systems at the same PC. It works fine, I can say; I have used it for a long time without any problems.

    But how do I get rid of these MBRs, if I want to re-establish the original MBR. One way is to use the command fdisk /mbr. It simply re-writes the MBR and the other boot sectors.

    I have used it against a virus a few times, having to boot from a floppy disk first. And I recently experienced a disk, where System Commander was installed and protected by a password! This disk was inaccessible even after FDISK'ing and formatting until we used fdisk/mbr. So please remember this command!


    The primary partition and booting

    There will always be one primary partition on the hard disk. Booting must be from the primary partition and the operating system is read from here.

    The hidden system files

    The core of the operating system is stored in the two hidden system files, which are always found in a primary DOS partition. In traditional MS-DOS, the files are named IO.SYS and MSDOS.SYS. These files have the same names in Windows 95/98, but the contents are changed slightly compared to the traditional DOS. This review is from the old fashioned DOS, but tells something general about the boot process of an operating system.

    The DOS system formatted disk contains two hidden system files. The first, IO.SYS, must be the first entry in the root directory. MSDOS.SYS must be on entry number two.

    Start-up on disk

    When the start-up program has finished POST (Power On Self Test) and the loading of BIOS routines, the boot process starts. It follows the following steps:

  • MBR is read first. The sector number of the primary partition's boot record is found here.

  • A small boot program is read from the primary partition's boot record. That activates the loading of the two hidden files.

  • IO.SYS is saved to working memory. Besides creating an interface "downwards" to the BIOS programs, IO.SYS includes a small program called SYSINIT. This program starts the next steps of the boot process.

  • Now MSDOS.SYS is read from the disk.

  • Then SYSINIT looks in root directory for a file named CONFIG.SYS. All commands in CONFIG.SYS are executed, gradually configuring the PC to have a ready and usable DOS.

  • Then SYSINIT looks for the command interpreter COMMAND.COM. If that is not found, we will get an error message about this. When it is found, AUTOEXEC.BAT, which contains the last information for personal configuration of the PC, is executed.

    That was a little bit about the boot process.


    OS/2 Boot Manager

    With OS/2's FDISK edition, you can divide the hard disk into more primary partitions. That allows use of the special Boot Manager, which comes with OS/2. Even if you do not use OS/2, you can still use Boot Manager let us say to have DOS /Windows 3.11 on one primary partition and Windows 95/98 on another. They will both appear as C drives, but you can only see one at a time. This, you control with the Boot Manager.

    I hope you understand the importance of FDISK. It is a good program to be fluent in. Altogether, it is important to understand the file system, the boot process, etc.

    There are two excellent utilities - Partition Magic and System Commander, which give further facilities to change the partitions and the start-up sequences, etc.


    Long file names with FAT32

    You can store long file names in Windows 95/98, which uses the VFAT file system. That is a 32 bit edition of FAT. VFAT was introduced with Windows 3.11, but the long file names did not become available until Windows 95.

    The file systems in Unix, NT, and OS/2 have always been able to store long file names, but now Windows can do it too. Also VFAT is compatible with regular FAT, which is smart. You can exchange files with other PCs - regardless of whether they can use long file names or not.

    Actually, the VFAT file system is much like regular FAT. But in a smart way Microsoft has been able to break the heavy 8.3 file name limitation, which limits regular FAT.

    Physically, the file names are stored in a traditional 8.3 file name, which VFAT creates (without user control). The user can assign a long file name. As an example, a file is named "Ford Escort sales.doc". That will be translated to "FORDES~1.DOC", when the filename is registered by FAT.

    The long file names may be up to 255 characters long, but they are translated to an "alias," which follows the traditional 8.3 FAT format. The trick is, that the long file name is written across multiple directory entries. Normally, one directory entry points towards one file, but in this case one file can occupy several root directories, each of which provides 32 bytes to the file name.

    You should be happy about the long file names in Windows - it makes it much easier to identify saved files. The only "danger" is, that you must not defragment the hard disk with a DOS based application. Then the long file names are destroyed. The files still exist, but you can only find them under their 8.3 name and that is an annoying experience, especially if you have thousands of files.

    However, you should not waste memory and disk space using filenames 50 characters long. Usually filenames of 15-20 characters work fine.


  • Next page
  • Previous page


    To learn more

    Read Module 6b with a little about Windows 95/98.

    Read Module 7a about the videosystem

    Read about video cards in Module 7b .

    Read about digital sound in Module 7c .

    [Main page]
    [Karbo's Dictionary]
    [The Software Guides]


    Copyright (c) 1996-2017 by Michael B. Karbo. www.Karbosguide.com.