To: opendos AT delorie DOT com Date: Thu, 2 Nov 2000 05:20:05 -0800 Subject: RE: FDISK Message-ID: <20001102.052005.-3943975.1.domanspc@juno.com> X-Mailer: Juno 4.0.11 MIME-Version: 1.0 Content-Type: text/plain Content-Transfer-Encoding: 7bit X-Juno-Line-Breaks: 0-6,8-48,50-53,55-57,59-60,62-73,75-89,91-97,100-104,106-111,113-122,124-133,135-136,138-152,154-161,163-167,170-172,174-190,192-201,203-204,206-209,211-218,220,222,224,226-236,238-248 X-Juno-Att: 0 X-Juno-RefParts: 0 From: Robert W Moss Reply-To: opendos AT delorie DOT com I think I may have stumbled on something which resembles the answer to the first question in this thread. There is a 'signature block' on all hard disks partitioned with FDISK for DOS 'of any brand'. This 'signature block' consists of the last two bytes in Cylinder 0, Head 0, Sector 1, and consists of 55AAh. If these two bytes are damaged then the computer will not boot and will act as if there are no partitions at all. My scource is partial to Pure MSDOS, (or as Patrick would say "pure c*** DOS", so the following information doesn't relate to Compaq DOS, PC DOS, IBM DOS, DR DOS per se, but may help to give some people a general understanding of FDISK, since we had a lot of wandering in the thread. In order for DOS to use a disk it must be partitioned and this is the task of the FDISK Program. Partitioning a hard disk is the act of defining areas of the disk for an operating system to use as a volume. To DOS, a volume is an area of the disk denoted as a drive letter; for example the first volume will always be C, the second will be D, and so on. Some people think that a drive must be partitioned only if you want to divide it into more than one volume. This is a misunderstanding; a disk must be partitioned even if it will be the single volume c. When a disk is partitioned, a master partition boot sector is written at Cylinder 0, Head 0, Sector 1 - rhe first sector on the hard disk. This sector contains data that describes the partitions by their starting and ending cylinder, head, and sector locations. The partition table also indicates to the ROM BIOS which of the partitions is bootableand, therefore, where to look for an operating system to load. A single hard disk can have 1 to 24 partitions. This number includes all of the hard disks installed the system, which means that you can have as many as 24 hard disks with one partition rach, a single hard disk with 24 partitions, or a combination of disks and partitions such that the total number of partitions does not exceed 24. If you have more than 24 drives or partitions, DOS does not reconize them , although some other systems may. What limits DOS is that a letter is used to name a volume, and the Roman alphabet ends with Z - the 24th volume, when you begin with C. This will include any CDROM drives and removable drives (Syquest, tape drives, etc. L120 drives will show up as floppy drives A or B). The FDISK program is the accepted standard for partitioning hard disks. Partitioning prepares the boot sector of the disk in such a way that the DOS FORMAT peogram can operate correctly; it also enables different operating systems to coexist on a single hard disk. If a disk is set up with two or more partitions, FDISK shows only two total DOS partitions: the primary partition and the extended partition. The extended partition is then divided into logical DOS volumes, which are partitions themselves . FDISK gives a false impression of how the partitioning is done. FDISK reports that a disk divided as C, D, E, and F is set up as two partitions , with a primary partition having a volume designator C and a single extended partition containing logical DOS volumes D, E, and F. But in the real structure of the disk , each logical DOS volume is a separate partition with an extended partition boot sector describing it. Each drive volume constitutes a separate partition on the disk, and the partitions point to one another in a daisy-chain arrangement. Different versions of DOS have had different partitioning capabilities, as follows: * DOS 1.x had no support whatsoever for hard disk drives. * DOS 2.x was the first version to include hard disk support, including the capability to partition a drive as a single volume with a maximum partition size of 16MB. DOS versions 2.x support only 16MB-maximum partitions due to the limitations of the 12-bit FAT system. A 12-bit FAT can manage a maximum of only 4,096 total clusters on a disk. * The limit of 16MB did not come from the FAT, but from the high-level DOS FORMAT program, which aborts with an Invalid Media or Track 0 bad - disk unusable error message if the partition is larger than 16MB. On a disk that has no bad sectors beyond the first 16MB, you can ignore the error message and continue the setup of the disk with the SYS command. If the disk has defects after the first 16MB, those defects will not be properly marked in the FAT. Most Vendors supplied modified high-level format programs that permitted partitions of up to 32MB to be formatted properly. Unfortunately, each cluster or minimum allocation unit on the disk then is 8,192 bytes (8K) because of the 12-bit FAT. * DOS 3.x increased the maximum partition partition and, therefor, volume size to 32MB but still could support only a single partition for DOS (assigned the C volume designator). The size limit is 32MB, due to the limit of 65,536 total sectors in a partition. * DOS 3.3 introduce the concept of extended partitions, which enables DOS to see the drive as multiple volumes (drive letters). The extended partition's logical DOS volumes actually are partitions themselves. In the organization of the disk, the primary partition is assigned drive letter C, and the extended partitions are assigned letters sequentially from D through Z. Each drive letter Which is a volume or partition) can be assigned only as much as 32MB of disk space. * DOS 4.x increased the size of a single DOS partition or volume to 2GB. FDISK was modified to allocate disk space in megabytes rather than in individual cylinders, as with previous versions of DOS. IBM DOS FDISK handled up to eight physical hard disk drives. * DOS 5.x had no changes in partitioning capabilities, but MS-DOS now could universally handle up to eight physical hard disk drives. (IBM had this capability in IBM DOS 4.x.) * DOS 6.x had no changes in partitioning capabilities, although both Microsoft and IBM added disk-compression software to DOS that created additional compressed volumes. The minimum size for a partition in any version of DOS is one cylinder; however , FDISK in DOS 4 and later versions allocate partitions in megabytes, meaning that the minimum-size partition is 1MB. DOS 4.x and later versions permit individual partitions oe columes to be as large as 2GB, whereas versions of DOS earlier than 4.0 have a maximum partition size of 32MB. FDISK is a very powerful program, and in DOS 5 and later versions, it gained some additional capabilities. Unfortunately, these capabilities were never documented in the DOS manual and remain undocumented even in DOS 6.x. The most important undocumented parameter in FDISK is the /MBR (Master Boot Record) parameter, which causes FDISK to rewrite the Master Boot Record code area, leaving the partition tables intact. Beware: It will overwrite the partition tables if the two signature bytes at the end of the sector (55AAh) are damaged. This situation is highly unlikely , however. In fact, if these signature bytes are damaged, you will know it: the system would not boot and would act as if there were no partitions at all. The /MBR parameter seems tailor-made for eliminating boot-sector virus programs that infect the Master Partition Boot Sector (Cylinder 0, Head 0, Sector 1) of a hard disk. To use this feature, you simply enter FDISK /MBR FDISK then rewrites the boot sector code (with DR DOS it explains in the manual that this is a generic boot sector code), leaving the partition tables intact. This should not cause any problems on a normally functioning system, but just in case it is reccommended that you back up the partition tables information to a floppy disk before trying it. You can do this with the following command: FDISK /PARTN This procedure uses the MIRROR command to store partition-table information in a file called PARTNSAV.FIL, which should be stored on a floppy disk for safekeeping. To restore the complete partition-table information, including all the master and extended partition boot sectors, you would use the UNFORMAT command as follows: UNFORMAT /PARTN This procedure causes the UNFORMAT command to ask for the floppy disk containing the PARTNSAV.FIL file and then to restore that file to the hard disk. Note that if you are using WIN95 the MIRROR and UNFORMAT programs have been eliminated, and you will have to use a third party utility program instead, such as Norton Utilities. FDISK also has three other undocumented parameters: /PRI: , /EXT: , /LOG: . These parameters can be used to have FDISK create master and extended partitions, as well as logical DOS volumes in the extended partition, directly from the command line rather than through the FDISK menus. This feature was designed so you can FDISK in a batch file to partition drives automatically. Some system vendors probably use these parameters (if they know about them, that is!) when setting up systems on the production line. Other than that, these parameters have have little use for the 'normal' user, and in fact can be quite dangerous! There are many third party partitioning programs out there that will help you over ride DOS's limitations but they should be used carefully. They all use a non-standard formatting system and they almost all include a boot loader program which must be run before DOS loads. If you use one of these and someone doesn't know about it and sits down at the computer and uses a DOS boot floppy you can just kiss your data goodby almost every time. The oddball program sets up a special program in config.sys that allows DOS to see their hidden/compressed partition and a standard DOS boot disk cannot see the partition. Theis other person may use NDD or PCTools to check out the drive and those programs will try to correct what they see as a problem. They will write to the disk and you will never be able to correct the problem unless you know a lot about data recovery software you will have lost all the stuff on your computer. If you are new to DOS and want to learn more about DOS and/or just play around with it or if you have a second or third computer you can load just about anything you want on it and use it to practice with. I recommend anyone who wants to brush up on old stuff or new people who need to know a lot of stuff and have no reference books if you can afford to pay $50US, $71CAN, L46UK yo should go out and buy a copy of Upgrading and Repairing PC's, by Scott Mueller, Published by QUE Books. I got a copy of the Sixth Edition for $5US at a COMP USA store here in California. the ISBN is 0-7897-0825-6. You can problably get it in a Barnes and Nobles or Amazon.com on the internet with a little searching. There is a world of information in any of his manuals. I believe he is up to edition 11 or 12 now. There are others out there but the two I like best are Mueller's Upgrading and Repairing PC's and Mark Minassi's PC Upgrade & Maintenance , Published by SYBEX, which is up to about edition 11 or 12. Sometime back Paul Mattias wrote a post about those little annoying differences between between the different versions of DRDOS/MSDOS/PCDOS/NDOS and the entry in the OEM Label of the Boot Sector. You can probably find it if you want to crash back through the archives about 6/8/10 months ago. Or maybe if he reads this he will be so kind as to elucidate it for us again. If I can find it in my files I could probly repost it. BOB 'DOMAN' MOSS "Chocolate is a vitamin" Besides 'RTFM' there is: 'SUE' (Stupid User Error) and 'DDT' (Don't Do That) The software engineers use these eupemisms for software "BUGS" called in by customers with problems. Probably related to what the Old Tech was thinking to himself when he found that TV,VCR,Computer , etc., was not plugged into the wall receptacle. ________________________________________________________________ YOU'RE PAYING TOO MUCH FOR THE INTERNET! Juno now offers FREE Internet Access! Try it today - there's no risk! For your FREE software, visit: http://dl.www.juno.com/get/tagj.