Disk Map 2 5 Cylinder

broken image


Depending on the system, blocks may be referred to with a single block number, ( e.g. Block # 234234 ), or with head-sector-cylinder combinations. The file organization module knows about files and their logical blocks, and how they map to physical blocks on the disk. In addition to translating from logical to physical blocks, the file.

  1. Maxim Top-Link Welded Cylinder, 2.5 in. Stroke, 1.25 in. Rod Dia., 218567. SKU: 130756399 Product Rating is 0 0 (0) See price at checkout Was.
  2. Disk Map 2 5 Cylinder Diesel Engine; Disk Map 2 5 Cylinder Diameter; Disk Map 2 5 Cylinder Misfire; Disk Map 2 5 Cylinder Diesel Engine. The development of the expression for the moment of inertia of a cylinder about a diameter at its end (the x-axis in the diagram) makes use of both the parallel axis theorem and the perpendicular axis theorem.

Andries Brouwer, aeb@cwi.nl

v2.2x, 30 Aug 2001All about disk geometry and the 1024 cylinder limit for disks.

For the most recent version of this text, seewww.win.tue.nl.

Suppose you have a disk with more than 1024 cylinders.Suppose moreover that you have an operating system that uses theold INT13 BIOS interface to disk I/O.Then you have a problem, because this interfaceuses a 10-bit field for the cylinder on which the I/Ois done, so that cylinders 1024 and past are inaccessible.

Fortunately, Linux does not use the BIOS, so there is no problem.

Well, except for two things:

(1) When you boot your system,Linux isn't running yet and cannot save you from BIOS problems.This has some consequences for LILO and similar boot loaders.

(2) It is necessary for all operating systems that use one diskto agree on where the partitions are. In other words, if you useboth Linux and, say, DOS on one disk, then both must interpret thepartition table in the same way. This has some consequences forthe Linux kernel and for fdisk.

Below a rather detailed description of all relevant details.Note that I used kernel version 2.0.8 source as a reference.Other versions may differ a bit.

You got a new large disk. What to do? Well, on the software side:use fdisk (or, better, cfdisk) to create partitions,and then mke2fs to create a filesystem, and then mountto attach the new filesystem to the big file hierarchy.

You need not read this HOWTO since there are no problemswith large hard disks these days. The great majority ofapparent problems is caused by people who think there mightbe a problem and install a disk manager, or go into fdiskexpert mode, or specify explicit disk geometries to LILOor on the kernel command line.

However, typical problem areas are: (i) ancient hardware,(ii) several operating systems on the same disk, and sometimes(iii) booting.

Advice:

For large SCSI disks: Linux has supported them from very early on.No action required.

For large IDE disks (over 8.4 GB): get a recent stable kernel(2.0.34 or later). Usually, all will be fine now,especially if you were wise enough not to ask the BIOSfor disk translations like LBA and the like.

For very large IDE disks (over 33.8 GB): seeIDE problems with 34+ GB disks below.

If LILO hangs at boot time, also specifylinear in theconfiguration file /etc/lilo.conf.(And if you did have linear, try without it.)If you have a recent LILO (version 21.4 or later),the keyword lba32 will usually allow booting fromanywhere on the disk, that is, the 1024 cylinder limit is gone.(Of course, LILO is a bit fragile, and the use of a differentbootloader might be more convenient.)

There may be geometry problems that can be solved by givingan explicit geometry to kernel/LILO/fdisk.

If you have an old fdisk and it warns aboutoverlapping partitions:ignore the warnings, or check using cfdisk that really all is well.

For HPT366, see the Linux HPT366 HOWTO.

If at boot time the kernel cannot read the partition table,consider the possibility that UDMA66 was selected whilethe controller or the cable or the disk drive did notsupport UDMA66. In such a case every attempt to read willfail, and reading the partition table is the first thingthe kernel does. Make sure no UDMA66 is used.

If you think something is wrong with the size of your disk,make sure that you are not confusing binary and decimal units,and realize that the free space that df reports on an empty diskis a few percent smaller than the partition size, because thereis administrative overhead.

If for a removable drive the kernel reports two different sizes,then one is found from the drive, and the other from the disk/floppy.This second value will be zero when the drive has no media.

Now, if you still think there are problems, or just are curious,read on.

A kilobyte (kB) is 1000 bytes.A megabyte (MB) is 1000 kB.A gigabyte (GB) is 1000 MB.A terabyte (TB) is 1000 GB.This is theSI norm.However, there are people that use 1 MB=1024000 bytes and talkabout 1.44 MB floppies, and people who think that 1 MB=1048576 bytes.Here I follow the recent standardand write Ki, Mi, Gi, Ti for the binary units, so thatthese floppies are 1440 KiB (1.47 MB, 1.41 MiB),1 MiB is 1048576 bytes (1.05 MB),1 GiB is 1073741824 bytes (1.07 GB)and 1 TiB is 1099511627776 bytes (1.1 TB).

Quite correctly, the disk drive manufacturers follow the SI normand use the decimal units. However, Linux kernel boot messages(for not-so-recent kernels) and some fdisk-type programsuse the symbols MB and GB for binary, ormixed binary-decimal units. So, before you think your disk issmaller than was promised when you bought it, compute first theactual size in decimal units (or just in bytes).

Concerning terminology and abbreviation for binary units,Knuthhas an alternative proposal, namelyto use KKB, MMB, GGB, TTB, PPB, EEB, ZZB, YYB and to call theselarge kilobyte, large megabyte, .. large yottabyte.He writes: `Notice that doubling the letter connotes bothbinary-ness and large-ness.' This is a good proposal -`large gigabyte' sounds better than `gibibyte'. For our purposeshowever the only important thing is to stress that a megabytehas precisely 1000000 bytes, and that some other term and abbreviationis required if you mean something else.

3.1 Sectorsize

In the present text a sector has 512 bytes. This is almost alwaystrue, but for example certain MO disks use a sectorsize of 2048 bytes,and all capacities given below must be multiplied by four.(When using fdisk on such disks, make sure you have version2.9i or later, and give the `-b 2048' option.)

3.2 Disksize

A disk with C cylinders, H heads and S sectors per trackhas C*H*S sectors in all, and can storeC*H*S*512 bytes.For example, if the disk label says C/H/S=4092/16/63then the disk has 4092*16*63=4124736 sectors, and can hold4124736*512=2111864832 bytes (2.11 GB).There is an industry convention to give C/H/S=16383/16/63for disks larger than 8.4 GB, and the disk size can no longerbe read off from the C/H/S values reported by the disk.

In order to read or write something from or to the disk, we haveto specify a position on the disk, for example by giving a sectoror block number.If the disk is a SCSI disk, then this sector number goes directlyinto the SCSI command and is understood by the disk.If the disk is an IDE disk using LBA, then precisely the same holds.But if the disk is old, RLL or MFM or IDE from before the LBA times,then the disk hardware expects a triple (cylinder,head,sector) todesignate the desired spot on the disk.

The correspondence between the linear numbering and this 3D notationis as follows: for a disk with C cylinders, H heads and S sectors/trackposition (c,h,s) in 3D or CHS notation is the same as positionc*H*S + h*S + (s-1) in linear or LBA notation.(The minus one is because traditionally sectors are counted from 1,not 0, in this 3D notation.)

Consequently, in order to access a very old non-SCSI disk, we need to knowits geometry, that is, the values of C, H and S.(And if you don't know, there is a lot of good information onwww.thetechpage.com.)

4.1 BIOS Disk Access and the 1024 cylinder limit

Linux does not use the BIOS, but some other systems do.The BIOS, which predates LBA times, offers with INT13disk I/O routines that have (c,h,s) as input.(More precisely: AH selects the function to perform,CH is the low 8 bits of the cylinder number, CLhas in bits 7-6 the high two bits of the cylinder numberand in bits 5-0 the sector number, DH is the head number,and DL is the drive number (80h or 81h).This explains part of the layout of the partition table.)

Disk Map 2 5 Cylinder Driver

Thus, we have CHS encoded in three bytes,with 10 bits for the cylinder number, 8 bits for the head number,and 6 bits for the track sector number (numbered 1-63).It follows that cylinder numbers can range from 0 to 1023and that no more than 1024 cylinders are BIOS addressable.

DOS and Windows software did not change when IDE diskswith LBA support were introduced, so DOS and Windowscontinued needing a disk geometry, even when this wasno longer needed for the actual disk I/O, but only for talkingto the BIOS. This again means that Linux needs the geometryin those places where communication with the BIOS or withother operating systems is required, even on a modern disk.

2/5 as a decimal

This state of affairs lasted for four years or so,and then disks appeared on the market that could not beaddressed with the INT13 functions (because the 10+8+6=24bits for (c,h,s) can address not more than 8.5 GB) and a newBIOS interface was designed: the so-called Extended INT13functions, where DS:SI points at a 16-byte Disk Address Packetthat contains an 8-byte starting absolute block number.

Very slowly the Microsoft world is moving towards using theseExtended INT13 functions. Probably a few years from nowno modern system on modern hardware will need the conceptof `disk geometry' anymore.

4.2 History of BIOS and IDE limits

ATA Specification (for IDE disks) - the 137 GB limit

At most 65536 cylinders (numbered 0-65535), 16 heads (numbered 0-15),255 sectors/track (numbered 1-255), for a maximum total capacity of267386880 sectors (of 512 bytes each), that is, 136902082560 bytes (137 GB).This is not yet a problem (in 1999), but will be a few years from now.

BIOS Int 13 - the 8.5 GB limit

At most 1024 cylinders (numbered 0-1023), 256 heads (numbered 0-255),63 sectors/track (numbered 1-63) for a maximum total capacity of8455716864 bytes (8.5 GB). This is a serious limitation today.It means that DOS cannot use present day large disks.

The 528 MB limit

If the same values for c,h,s are used for the BIOS Int 13 call andfor the IDE disk I/O, then both limitations combine, and one canuse at most 1024 cylinders, 16 heads, 63 sectors/track, for amaximum total capacity of 528482304 bytes (528MB), the infamous504 MiB limit for DOS with an old BIOS.This started being a problem around 1993, and people resorted to all kindsof trickery, both in hardware (LBA), in firmware (translating BIOS),and in software (disk managers).The concept of `translation' was invented (1994): a BIOS could useone geometry while talking to the drive, and another, fake, geometrywhile talking to DOS, and translate between the two.

The 2.1 GB limit (April 1996)

Some older BIOSes only allocate 12 bits for the field in CMOS RAM thatgives the number of cylinders. Consequently, this number can be at most4095, and only 4095*16*63*512=2113413120 bytes are accessible.The effect of having a larger disk would be a hang at boot time.This made disks with geometry 4092/16/63 rather popular. And still todaymany large disk drives come with a jumper to make them appear 4092/16/63.See also over2gb.htm. Other BIOSeswould not hang but just detect a much smaller disk, like 429 MB instead of 2.5 GB.

The 3.2 GB limit

There was a bug in the Phoenix 4.03 and 4.04 BIOS firmware that wouldcause the system to lock up in the CMOS setup for drives with a capacityover 3277 MB. See over3gb.htm.

The 4.2 GB limit (Feb 1997)

Simple BIOS translation (ECHS=Extended CHS, sometimes called `Large disk support' or just `Large')works by repeatedly doubling the number of heads and halving the numberof cylinders shown to DOS, until the number of cylinders is at most 1024.Now DOS and Windows 95 cannot handle 256 heads,and in the common case that the disk reports 16 heads, this means thatthis simple mechanism only works up to 8192*16*63*512=4227858432bytes (with a fake geometry with 1024 cylinders, 128 heads, 63 sectors/track).Note that ECHS does not change the number of sectors per track, so ifthat is not 63, the limit will be lower.See over4gb.htm.

The 7.9 GB limit

Slightly smarter BIOSes avoid the previous problem by first adjusting thenumber of heads to 15 (`revised ECHS'), so that a fake geometry with240 heads can be obtained, good for1024*240*63*512=7927234560 bytes.

Disk Map 2 5 Cylinder

This state of affairs lasted for four years or so,and then disks appeared on the market that could not beaddressed with the INT13 functions (because the 10+8+6=24bits for (c,h,s) can address not more than 8.5 GB) and a newBIOS interface was designed: the so-called Extended INT13functions, where DS:SI points at a 16-byte Disk Address Packetthat contains an 8-byte starting absolute block number.

Very slowly the Microsoft world is moving towards using theseExtended INT13 functions. Probably a few years from nowno modern system on modern hardware will need the conceptof `disk geometry' anymore.

4.2 History of BIOS and IDE limits

ATA Specification (for IDE disks) - the 137 GB limit

At most 65536 cylinders (numbered 0-65535), 16 heads (numbered 0-15),255 sectors/track (numbered 1-255), for a maximum total capacity of267386880 sectors (of 512 bytes each), that is, 136902082560 bytes (137 GB).This is not yet a problem (in 1999), but will be a few years from now.

BIOS Int 13 - the 8.5 GB limit

At most 1024 cylinders (numbered 0-1023), 256 heads (numbered 0-255),63 sectors/track (numbered 1-63) for a maximum total capacity of8455716864 bytes (8.5 GB). This is a serious limitation today.It means that DOS cannot use present day large disks.

The 528 MB limit

If the same values for c,h,s are used for the BIOS Int 13 call andfor the IDE disk I/O, then both limitations combine, and one canuse at most 1024 cylinders, 16 heads, 63 sectors/track, for amaximum total capacity of 528482304 bytes (528MB), the infamous504 MiB limit for DOS with an old BIOS.This started being a problem around 1993, and people resorted to all kindsof trickery, both in hardware (LBA), in firmware (translating BIOS),and in software (disk managers).The concept of `translation' was invented (1994): a BIOS could useone geometry while talking to the drive, and another, fake, geometrywhile talking to DOS, and translate between the two.

The 2.1 GB limit (April 1996)

Some older BIOSes only allocate 12 bits for the field in CMOS RAM thatgives the number of cylinders. Consequently, this number can be at most4095, and only 4095*16*63*512=2113413120 bytes are accessible.The effect of having a larger disk would be a hang at boot time.This made disks with geometry 4092/16/63 rather popular. And still todaymany large disk drives come with a jumper to make them appear 4092/16/63.See also over2gb.htm. Other BIOSeswould not hang but just detect a much smaller disk, like 429 MB instead of 2.5 GB.

The 3.2 GB limit

There was a bug in the Phoenix 4.03 and 4.04 BIOS firmware that wouldcause the system to lock up in the CMOS setup for drives with a capacityover 3277 MB. See over3gb.htm.

The 4.2 GB limit (Feb 1997)

Simple BIOS translation (ECHS=Extended CHS, sometimes called `Large disk support' or just `Large')works by repeatedly doubling the number of heads and halving the numberof cylinders shown to DOS, until the number of cylinders is at most 1024.Now DOS and Windows 95 cannot handle 256 heads,and in the common case that the disk reports 16 heads, this means thatthis simple mechanism only works up to 8192*16*63*512=4227858432bytes (with a fake geometry with 1024 cylinders, 128 heads, 63 sectors/track).Note that ECHS does not change the number of sectors per track, so ifthat is not 63, the limit will be lower.See over4gb.htm.

The 7.9 GB limit

Slightly smarter BIOSes avoid the previous problem by first adjusting thenumber of heads to 15 (`revised ECHS'), so that a fake geometry with240 heads can be obtained, good for1024*240*63*512=7927234560 bytes.

The 8.4 GB limit

Finally, if the BIOS does all it can to make this translation a success,and uses 255 heads and 63 sectors/track (`assisted LBA' or just `LBA')it may reach 1024*255*63*512=8422686720 bytes, slightly lessthan the earlier 8.5 GB limit because the geometries with 256 heads must beavoided.(This translation will use for the number of heads the first value Hin the sequence 16, 32, 64, 128, 255 for which the total disk capacityfits in 1024*H*63*512, and then computes the number ofcylinders C as total capacity divided by (H*63*512).)

The 33.8 GB limit (August 1999)

The next hurdle comes with a size over 33.8 GB.The problem is that with the default 16 heads and 63 sectors/trackthis corresponds to a number of cylinders of more than 65535, whichdoes not fit into a short. Most BIOSes in existence today can't handlesuch disks. (See, e.g., Asus upgradesfor new flash images that work.)Linux kernels older than 2.2.14 / 2.3.21 need a patch.See IDE problems with 34+ GB disks below.

For another discussion of this topic, seeBreaking the Barriers, and, with more details,IDE Hard Drive Capacity Barriers.

Hard drives over 8.4 GB are supposed to report their geometry as 16383/16/63.This in effect means that the `geometry' is obsolete, and the total disksize can no longer be computed from the geometry.

When the system is booted, the BIOS reads sector 0 (known asthe MBR - the Master Boot Record) from the first disk(or from floppy or CDROM), and jumps to the code found there - usuallysome bootstrap loader. These small bootstrap programsfound there typically have no own disk drivers and useBIOS services. This means that a Linux kernel can only bebooted when it is entirely located within the first 1024cylinders, unless you both have a modern BIOS (a BIOS that supportsthe Extended INT13 functions), and a modern bootloader(a bootloader that uses these functions when available).

This problem (if it is a problem) is very easily solved:make sure that the kernel (and perhaps other files used during bootup,such as LILO map files) are located on a partition that is entirelycontained in the first 1024 cylinders of a disk that the BIOS can access -probably this means the first or second disk.

Thus: create a small partition, say 10 MB large, so that thereis room for a handful of kernels, making sure that it is entirelycontained within the first 1024 cylinders of the first or seconddisk. Mount it on /boot so that LILO will put its stuff there.

Most systems from 1998 or later will have a modern BIOS.

Executive summary: If you use LILO as boot loader, make sure you haveLILO version 21.4 or later. (It can be found atftp://metalab.unc.edu/pub/Linux/system/boot/lilo/.)Always use the lba32 option.

An invocation of /sbin/lilo (the boot map installer) stores a listof addresses in the boot map, so that LILO (the boot loader) knows fromwhere to read the kernel image. By default these addresses arestored in (c,h,s) form, and ordinary INT13 calls are used at boot time.

When the configuration file specifies lba32 or linear,linear addresses are stored. With lba32 also linear addressesare used at boot time, when the BIOS supports extended INT13.With linear, or with an old BIOS, these linear addresses areconverted back to (c,h,s) form, and ordinary INT13 calls are used.

Thus, with lba32 there are no geometry problems and there isno 1024 cylinder limit. Without it there is a 1024 cylinder limit.What about the geometry?

The boot loader and the BIOS must agree as to the disk geometry./sbin/lilo asks the kernel for the geometry,but there is no guarantee that the Linux kernel geometry coincideswith what the BIOS will use. Thus, often the geometrysupplied by the kernel is worthless. In such cases it helpsto give LILO the `linear' option. The advantage is thatthe Linux kernel idea of the geometry no longer plays a role.The disadvantage is that lilo cannot warn you whenpart of the kernel was stored above the 1024 cylinder limit,and you may end up with a system that does not boot.

5.2 A LILO bug

With LILO versions below v21 there is another disadvantage:the address conversion done at boot time has a bug: when c*H is 65536or more, overflow occurs in the computation.For H larger than 64 this causes a stricter limit on c than thewell-known c < 1024; for example, with H=255 and an old LILOone must have c < 258. (c=cylinder where kernel image lives,H=number of heads of disk)

5.3 1024 cylinders is not 1024 cylinders

Tim Williams writes: `I had my Linux partition within the first 1024cylinders and still it wouldnt boot. First when I moved it below 1 GBdid things work.' How can that be? Well, this was a SCSI disk withAHA2940UW controller which uses either H=64, S=32 (that is, cylindersof 1 MiB = 1.05 MB), or H=255, S=63 (that is, cylinders of 8.2 MB),depending on setup options in firmware and BIOS. No doubt the BIOSassumed the former, so that the 1024 cylinder limit was found at 1 GiB,while Linux used the latter and LILO thought that this limit was at 8.4 GB.

5.4 No 1024 cylinder limit on old machines with IDE

The nuni boot loader does not use BIOS servicesbut accesses IDE drives directly. So, one can put it on afloppy or in the MBR and boot from anywhere on any IDE drive(not only from the first two). Find it at//metalab.unc.edu/pub/Linux/system/boot/loaders/.

If you have several operating systems on your disks, then eachuses one or more disk partitions. A disagreement on where thesepartitions are may have catastrophic consequences.

The MBR contains a partition table describing where the(primary) partitions are. There are 4 table entries, for 4primary partitions, and each looks like

(where CHS stands for Cylinder/Head/Sector).

This information is redundant: the location of a partitionis given both by the 24-bit begin and end fields,and by the 32-bit start and length fields.

Linux only uses the start and length fields, and cantherefore handle partitions of not more than 2^32 sectors,that is, partitions of at most 2 TiB. That is thirty timeslarger than the disks available today, so maybe it will beenough for the next six years or so.(So, partitions can be very large, but there is a seriousrestriction in that a file in an ext2 filesystem on hardwarewith 32-bit integers cannot be larger than 2 GiB.)

DOS uses the begin and end fields, and uses theBIOS INT13 call to access the disk, and can therefore onlyhandle disks of not more than 8.4 GB, even with a translatingBIOS. (Partitions cannot be larger than 2.1 GB because ofrestrictions of the FAT16 file system.) The same holds forWindows 3.11 and WfWG and Windows NT 3.*.

Windows 95 has support for the Extended INT13 interface, anduses special partition types (c, e, f instead of b, 6, 5)to indicate that a partition should be accessed in this way.When these partition types are used, the begin and end fieldscontain dummy information (1023/255/63).Windows 95 OSR2 introduces the FAT32 file system (partition typeb or c), that allows partitions of size at most 2 TiB.

What is this nonsense you get from fdisk about `overlapping'partitions, when in fact nothing is wrong?Well - there is something `wrong': if you look at the beginand end fields of such partitions, as DOS does, they overlap.(And that cannot be corrected, because these fields cannot storecylinder numbers above 1024 - there will always be `overlap'as soon as you have more than 1024 cylinders.)However, if you look at the start and length fields,as Linux does, and as Windows 95 does in the case of partitionswith partition type c, e or f, then all is well.So, ignore these warnings when cfdisk is satisfied and youhave a Linux-only disk. Be careful when the disk is shared with DOS.Use the commands cfdisk -Ps /dev/hdx and cfdisk -Pt /dev/hdxto look at the partition table of /dev/hdx.

6.1 The last cylinder

Many old IBM PS/2 systems used disks with a defect map writtento the end of the disk. (Bit 0x20 in the control word of thedisk parameter table is set.)Therefore, FDISK would not use the last cylinder. Just to be sure, the BIOSoften already reports the size of the disk as one cylinder smaller thanreality, and that may mean that two cylinders are lost.Newer BIOSes have several disk size reporting functions, where internallyone calls the other. When both subtract 1 for this reserved cylinder andalso FDISK does so, then one may lose three cylinders.These days all of this is irrelevant, but this may provide an explanationif one observes that different utilities have slightly different opinionsabout the disk size.

6.2 Cylinder boundaries

A well-known claim says that partitions should start and endat cylinder boundaries.

Since 'disk geometry' is something without objective existence,different operating systems will invent different geometriesfor the same disk. One often sees a translated geometry like */255/63used by one and an untranslated geometry like */16/63 used by another OS.Thus, it may be impossible to align partitions to cylinder boundariesaccording to each of the the various ideas about the size of a cylinderthat one's systems have. Also different Linux kernels may assigndifferent geometries to the same disk.Also, enabling or disabling the BIOS of a SCSI card may change thefake geometry of the connected SCSI disks.

Fortunately, for Linux there is no alignment requirement at all.(Except that some semi-broken installation software likes to be very surethat all is OK; thus, it may be impossible to install RedHat 7.1on a disk with unaligned partitions because DiskDruid is unhappy.)

People report that it is easy to create nonaligned partitionsin Windows NT, without any noticeable bad effects.

But MSDOS 6.22 has an alignment requirement. Extended partition sectorsthat are not on a cylinder boundary are ignored by its FDISK.The system itself is happy with any alignment, but interpretsrelative starting addresses as if relative to an aligned address:The starting address of a logical partition is given relative notto the address of the extended partition sector that describes it,but relative to the start of the cylinder that contains that sector.(So, it is not surprising that also PartitionMagic requires alignment.)

What is the definition of alignment?MSDOS 6.22 FDISK will do the following:1. If the first sector of the cylinder is a partitiontable sector, then the rest of the track is unused,and the partition starts with the the next track.This applies to sector 0 (the MBR) and the partition table sectorspreceding logical partitions.2. Otherwise, the partition starts at the first sector of thecylinder. Also the extended partition starts at a cylinder boundary.The cfdisk man page says that old versions of DOS did notalign partitions.

Use of partition type 85 for the extended partition makes it invisibleto DOS, making sure that only Linux will look inside.

Adobe xd 24 2 22 8. As an aside: on a Sparc, the boot partition must start on a cylinderboundary (but there is no requirement on the end).

Disk geometry (with heads, cylinders and tracks) is somethingfrom the age of MFM and RLL. In those days it corresponded toa physical reality. Nowadays, with IDE or SCSI, nobody isinterested in what the `real' geometry of a disk is.Indeed, the number of sectors per track is variable - there aremore sectors per track close to the outer rim of the disk - so thereis no `real' number of sectors per track.Quite the contrary: the IDE command INITIALIZE DRIVE PARAMETERS (91h)serves to tell the disk how many heads and sectors per trackit is supposed to have today.It is quite normal to see a large modern disk that has 2 headsreport 15 or 16 heads to the BIOS, while the BIOS may again report255 heads to user software.

For the user it is best to regard a disk as just a linear arrayof sectors numbered 0, 1, .., and leave it to the firmwareto find out where a given sector lives on the disk. This linearnumbering is called LBA.

So now the conceptual picture is the following.DOS, or some boot loader, talks to the BIOS, using (c,h,s) notation.The BIOS converts (c,h,s) to LBA notation using the fake geometrythat the user is using. If the disk accepts LBA then this valueis used for disk I/O. Otherwise, it is converted back to (c',h',s')using the geometry that the disk uses today, and that is used fordisk I/O.

Note that there is a bit of confusion in the use of the expression `LBA':As a term describing disk capabilities it means `Linear Block Addressing'(as opposed to CHS Addressing). As a term in the BIOS Setup, it describesa translation scheme sometimes called `assisted LBA' - see aboveunder `The 8.4 GB limit'.

Something similar works when the firmware doesn't speak LBAbut the BIOS knows about translation. (In the setup this isoften indicated as `Large'.) Now the BIOS will presenta geometry (C,H,S) to the operating system, and use(C',H',S') while talking to the disk controller. Usually S = S',C = C'/N and H = H'*N, where N is the smallest power oftwo that will ensure C' <= 1024 (so that least capacityis wasted by the rounding down in C' = C/N).Again, this allows access of up to 8.4 GB (7.8 GiB).

(The third setup option usually is `Normal', where no translationis involved.)

If a BIOS does not know about `Large' or `LBA', then there aresoftware solutions around. Disk Managers like OnTrack or EZ-Drivereplace the BIOS disk handling routines by their own.Often this is accomplished by having the disk manager code livein the MBR and subsequent sectors (OnTrack calls this code DDO:Dynamic Drive Overlay), so that it is booted before any otheroperating system. That is why one may have problemswhen booting from a floppy when a Disk Manager has been installed.

The effect is more or less the same as with a translating BIOS -but especially when running several different operating systemson the same disk, disk managers can cause a lot of trouble.

Linux does support OnTrack Disk Manager since version 1.3.14,and EZ-Drive since version 1.3.29. Some more details aregiven below.

If the Linux kernel detects the presence of some disk manageron an IDE disk, it will try to remap the disk in the same waythis disk manager would have done, so that Linux sees the samedisk partitioning as for example DOS with OnTrack or EZ-Drive.However, NO remapping is done when a geometry was specifiedon the command line - so a`hd=cyls,heads,secs' command line optionmight well kill compatibility with a disk manager.

If you are hit by this, and know someone who can compile a newkernel for you, find the file linux/drivers/block/ide.cand remove in the routine ide_xlate_1024() the testif (drive->forced_geom) { ..; return 0; }.

The remapping is done by trying 4, 8, 16, 32, 64, 128, 255 heads(keeping H*C constant) until either C <= 1024 or H = 255.

The details are as follows - subsection headers are the stringsappearing in the corresponding boot messages. Here and everywhereelse in this text partition types are given in hexadecimal.

8.1 EZD

EZ-Drive is detected by the fact that the first primary partitionhas type 55. The geometry is remapped as described above,and the partition table from sector 0 is discarded - insteadthe partition table is read from sector 1. Disk block numbersare not changed, but writes to sector 0 are redirected to sector 1.This behaviour can be changed by recompiling the kernel with #define FAKE_FDISK_FOR_EZDRIVE 0 in ide.c.

8.2 DM6:DDO

OnTrack DiskManager (on the first disk) is detected by the factthat the first primary partition has type 54. The geometry isremapped as described above and the entire disk is shifted by63 sectors (so that the old sector 63 becomes sector 0).Afterwards a new MBR (with partition table) is read fromthe new sector 0. Of course this shift is to make room forthe DDO - that is why there is no shift on other disks.

8.3 DM6:AUX

OnTrack DiskManager (on other disks) is detected by the factthat the first primary partition has type 51 or 53.The geometry is remapped as described above.

8.4 DM6:MBR

An older version of OnTrack DiskManager is detected not bypartition type, but by signature. (Test whether the offsetfound in bytes 2 and 3 of the MBR is not more than 430, andthe short found at this offset equals 0x55AA, and is followedby an odd byte.) Again the geometry is remapped as above.

8.5 PTBL

Finally, there is a test that tries to deduce a translationfrom the start and end values of the primary partitions:If some partition has start and end sector number 1 and 63, respectively,and end heads 31, 63, 127 or 254, then, since it is customaryto end partitions on a cylinder boundary, and since moreoverthe IDE interface uses at most 16 heads, it is conjecturedthat a BIOS translation is active, and the geometry isremapped to use 32, 64, 128 or 255 heads, respectively.However, no remapping is done when the current idea of thegeometry already has 63 sectors per track and at least asmany heads (since this probably means that a remapping wasdone already).

8.6 Getting rid of a disk manager

When Linux detects OnTrack Disk Manager, it will shift all diskaccesses by 63 sectors. Similarly, when Linux detects EZ-Drive,it shifts all accesses of sector 0 to sector 1.This means that it may be difficult to get rid of these disk managers.Most disk managers have an uninstall option, but if you need to removesome disk manager an approach that often works is to give an explicitdisk geometry on the command line. Now Linux skips the ide_xlate_1024()routine, and one can wipe out the partition table with disk manager(and probably lose access to all disk data) with the command

The details depend a little on kernel version.Recent kernels (since 2.3.21) recognize boot parameters like 'hda=remap' and'hdb=noremap', so that it is possible to get or avoid the EZD shift regardless ofthe contents of the partition table. The 'hdX=noremap' boot parameter alsoavoids the OnTrack Disk Manager shift.

What does all of this mean? For Linux users only one thing:that they must make sure that LILO and fdisk use the rightgeometry where `right' is defined for fdisk as the geometryused by the other operating systems on the same disk, and forLILO as the geometry that will enable successful interactionwith the BIOS at boot time. (Usually these two coincide.)

How does fdisk know about the geometry?It asks the kernel, using the HDIO_GETGEO ioctl.But the user can override the geometry interactivelyor on the command line.

How does LILO know about the geometry?It asks the kernel, using the HDIO_GETGEO ioctl.But the user can override the geometry using the `disk=' optionin /etc/lilo.conf (see lilo.conf(5)).One may also give the linear option to LILO, and it will storeLBA addresses instead of CHS addresses in its map file,and find out of the geometry to use at boot time (by usingINT 13 Function 8 to ask for the drive geometry).

How does the kernel know what to answer?Well, first of all, the user may have specified an explicit geometrywith a `hda=cyls,heads,secs'kernel command line option (see bootparam(7)), perhaps by hand, or byasking the boot loader to supply such an option to the kernel.For example, one can tell LILO to supply such an option by addingan `append = 'hda=cyls,heads,secs''line in /etc/lilo.conf (see lilo.conf(5)).And otherwise the kernel will guess, possibly using valuesobtained from the BIOS or the hardware.

It is possible (since Linux 2.1.79) to change the kernel's ideasabout the geometry by using the /proc filesystem.For example

This is especially useful if you need so many boot parametersthat you overflow LILO's (very limited) command line length.

How does the BIOS know about the geometry?The user may have specified it in the CMOS setup.Or the geometry is read from the disk, and possibly translatedas specified in the setup. In the case of SCSI disks, where nogeometry exists, the geometry that the BIOS has to invent canoften be specified by jumpers or setup options. (For example,Adaptec controllers have the possibility to choose betweenthe usual H=64, S=32 and the `extended translation' H=255, S=63.)Sometimes the BIOS reads the partition table to see with whatgeometry the disk was last partitioned - it will assume thata valid partition table is present when the 55aa signatureis present. This is good, in that it allows moving disks toa different machine. But having the BIOS behaviour depend onthe disk contents also causes strange problems.(For example, it has been reportedthat a 2.5 GB disk was seen as having 528 MB because the BIOS readthe partition table and concluded that it should use untranslatedCHS. Another effect is found in the reportthat unpartitioned disks were slower than partitioned ones,because the BIOS tested 32-bit mode by reading the MBR andseeing whether it correctly got the 55aa signature.)

How does the disk know about the geometry?Well, the manufacturer invents a geometry that multiplies outto approximately the right capacity. Many disks have jumpersthat change the reported geometry, in order to avoid BIOS bugs.For example, all IBM disks allow the user to choose between15 and 16 heads, and many manufacturers add jumpers to makethe disk seem smaller than 2.1 GB or 33.8 GB. See alsobelow.Sometimes there are utilities that change the disk firmware.

9.1 Computing LILO parameters

Sometimes it is useful to force a certain geometryby adding `hda=cyls,heads,secs'on the kernel command line. Almost always one wants secs=63,and the purpose of adding this is to specify heads.(Reasonable values today are heads=16 and heads=255.)What should one specify for cyls? Precisely that numberthat will give the right total capacity of C*H*S sectors.For example, for a drive with 71346240 sectors (36529274880 bytes)one would compute C as 71346240/(255*63)=4441 (for example usingthe program bc), and give boot parameter hdc=4441,255,63.How does one know the right total capacity? For example,

gives two ways of finding the total number of sectors 71346240.The kernel outputtells us about (at least) 34837*2048=71346176 and about (at least)70780*16*63=71346240 sectors. In this case the second value happensto be precisely correct, but in general both may be rounded down.This is a good way to approximate the disk size when hdparmis unavailable. Never give a too large value for cyls!In the case of SCSI disks the precise number of sectors is givenin the kernel boot messages:(and MB, GB are rounded, not rounded down, and `binary').

10.1 IDE details - the seven geometries

The IDE driver has five sources of information about the geometry.The first (G_user) is the one specified by the user on the command line.The second (G_bios) is the BIOS Fixed Disk Parameter Table(for first and second disk only) that is read on system startup,before the switch to 32-bit mode.The third (G_phys) and fourth (G_log) are returned by the IDE controlleras a response to the IDENTIFY command - theyare the `physical' and `current logical' geometries.

On the other hand, the driver needs two values for the geometry:on the one hand G_fdisk, returned by a HDIO_GETGEO ioctl, andon the other hand G_used, which is actually used for doing I/O.Both G_fdisk and G_used are initialized to G_user if given, toG_bios when this information is present according to CMOS, andto G_phys otherwise. If G_log looks reasonable then G_used is setto that. Otherwise, if G_used is unreasonable and G_phys looksreasonable then G_used is set to G_phys. Here `reasonable' meansthat the number of heads is in the range 1-16.

To say this in other words: the command line overrides the BIOS,and will determine what fdisk sees, but if it specifies atranslated geometry (with more than 16 heads), then for kernel I/Oit will be overridden by output of the IDENTIFY command.

Note that G_bios is rather unreliable: for systems booting from SCSIthe first and second disk may well be SCSI disks, and the geometrythat the BIOS reported for sda is used by the kernel for hda.Moreover, disks that are not mentioned in the BIOS Setup are notseen by the BIOS. This means that, e.g., in an IDE-only system wherehdb is not given in the Setup, the geometries reported by the BIOSfor the first and second disk will apply to hda and hdc.

The IDENTIFY DRIVE command

When an IDE drive is sent the IDENTIFY DRIVE (0xec) command,it will return 256 words (512 bytes) of information.This contains lots of technical stuff.Let us only describe here what plays a role in geometry matters.The words are numbered 0-255.

We find three pieces of information here: DefaultCHS (words 1,3,6),CurrentCHS (words 54-58) and LBAcapacity (words 60-61).

fdisk has to invent some geometry, and also uses HDIO_GETGEO here -indeed, fdisk does not distinguish between IDE and SCSI disks.As one can see from the detailed description below, the variousdrivers each invent a somewhat different geometry. Indeed, one big mess.

If you are not using DOS or so, then avoid all extended translationsettings, and just use 64 heads, 32 sectors per track (for a nice,convenient 1 MiB per cylinder), if possible, so that no problemsarise when you move the disk from one controller to another.Some SCSI disk drivers (aha152x, pas16, ppa, qlogicfas, qlogicisp)are so nervous about DOS compatibility that they will not allowa Linux-only system to use more than about 8 GiB. This is a bug.

What is the real geometry?The easiest answer is that there is no such thing.And if there were, you wouldn't want to know, and certainlyNEVER, EVER tell fdisk or LILO or the kernel about it.It is strictly a business between the SCSI controller and the disk.Let me repeat that: only silly people tell fdisk/LILO/kernel aboutthe true SCSI disk geometry.

But if you are curious and insist, you might ask the disk itself.There is the important command READ CAPACITY that will give the totalsize of the disk, and there is the MODE SENSE command, that in theRigid Disk Drive Geometry Page (page 04) gives the number of cylindersand heads (this is information that cannot be changed), and in theFormat Page (page 03) gives the number of bytes per sector,and sectors per track. This latter number is typically dependent uponthe notch, and the number of sectors per track varies - the outertracks have more sectors than the inner tracks.The Linux program scsiinfo will give this information.There are many details and complications, and it is clear that nobody(probably not even the operating system) wants to use this information.Moreover, as long as we are only concerned about fdisk and LILO,one typically gets answers like C/H/S=4476/27/171 - values thatcannot be used by fdisk because the partition table reserves only10 resp. 8 resp. 6 bits for C/H/S.

Then where does the kernel HDIO_GETGEO get its information from?Well, either from the SCSI controller, or by making an educated guess.Some drivers seem to think that we want to know `reality', butof course we only want to know what the DOS or OS/2 FDISK(or Adaptec AFDISK, etc) will use.

Note that Linux fdisk needs the numbers H and S of heads and sectorsper track to convert LBA sector numbers into c/h/s addresses, but thenumber C of cylinders does not play a role in this conversion.Some drivers use (C,H,S) = (1023,255,63) to signal that the drivecapacity is at least 1023*255*63 sectors. This is unfortunate,since it does not reveal the actual size, and will limit theusers of most fdisk versions to about 8 GiB of their disks -a real limitation in these days.

In the description below, M denotes the total disk capacity,and C, H, S the number of cylinders, heads and sectors per track.It suffices to give H, S if we regard C as defined by M / (H*S).

By default, H=64, S=32.

aha1740, dtc, g_NCR5380, t128, wd7000:

H=64, S=32.

aha152x, pas16, ppa, qlogicfas, qlogicisp:

H=64, S=32 unless C > 1024, in which caseH=255, S=63, C = min(1023, M/(H*S)).(Thus C is truncated, and H*S*C is not an approximation tothe disk capacity M. This will confuse most versions of fdisk.)The ppa.c code uses M+1 instead of M and says that due to abug in sd.c M is off by 1.

advansys:

H=64, S=32 unless C > 1024 and moreover the `> 1 GB' optionin the BIOS is enabled, in which case H=255, S=63.

aha1542:

Ask the controller which of two possible translation schemesis in use, and use either H=255, S=63 or H=64, S=32. In the formercase there is a boot message 'aha1542.c: Using extended bios translation'.

aic7xxx:

H=64, S=32 unless C > 1024, and moreovereither the 'extended' boot parameter was given,or the `extended' bit was set in the SEEPROM or BIOS,in which case H=255, S=63.In Linux 2.0.36 this extended translation would always be setin case no SEEPROM was found, but in Linux 2.2.6 if no SEEPROMis found extended translation is set only when the user askedfor it using this boot parameter (while when a SEEPROM is found,the boot parameter is ignored).This means that a setup that works under 2.0.36 may fail to bootwith 2.2.6 (and require the linear keyword for LILO, orthe aic7xxx=extended kernel boot parameter).

buslogic:

H=64, S=32 unless C >= 1024, and moreover extended translationwas enabled on the controller, in which case if M < 2^22 thenH=128, S=32; otherwise H=255, S=63. However, after making this choicefor (C,H,S), the partition table is read, and if for one of thethree possibilities (H,S) = (64,32), (128,32), (255,63) the valueendH=H-1 is seen somewhere then that pair (H,S) is used, and a boot messageis printed 'Adopting Geometry from Partition Table'.

fdomain:

Find the geometry information in the BIOS Drive Parameter Table,or read the partition table and use H=endH+1, S=endS for the firstpartition, provided it is nonempty, or use H=64, S=32 for M < 2^21 (1 GiB),H=128, S=63 for M < 63*2^17 (3.9 GiB) and H=255, S=63 otherwise.

in2000:

Use the first of (H,S) = (64,32), (64,63), (128,63), (255,63)that will make C <= 1024. In the last case, truncate C at 1023.

seagate:

Read C,H,S from the disk. (Horrors!) If C or S is too large, thenput S=17, H=2 and double H until C <= 1024. This means that H willbe set to 0 if M > 128*1024*17 (1.1 GiB). This is a bug.

ultrastor and u14_34f:

One of three mappings((H,S) = (16,63), (64,32), (64,63))is used depending on the controller mapping mode.

If the driver does not specify the geometry, we fall backon an educated guess using the partition table, or using thetotal disk capacity.

Look at the partition table. Since by convention partitions endon a cylinder boundary, we can, given end = (endC,endH,endS)for any partition, just put H = endH+1 and S = endS. (Recallthat sectors are counted from 1.)More precisely, the following is done.If there is a nonempty partition, pick the partition with the largest beginC.For that partition, look at end+1, computedboth by adding start and length and by assuming that thispartition ends on a cylinder boundary. If both values agree, orif endC = 1023 and start+length is an integral multiple of(endH+1)*endS,then assume that this partition really was aligned on a cylinderboundary, and put H = endH+1 and S = endS.If this fails, either because there are no partitions, or becausethey have strange sizes, then look only at the disk capacity M.Algorithm: put H = M/(62*1024) (rounded up), S = M/(1024*H)(rounded up), C = M/(H*S) (rounded down).This has the effect of producing a (C,H,S) with C at most 1024and S at most 62.

The Linux IDE driver gets the geometry and capacity of a disk(and lots of other stuff) by using anATA IDENTIFY request.Until recently the driver would not believe the returned valueof lba_capacity if it was more than 10% larger than the capacitycomputed by C*H*S. However, by industry agreementlarge IDE disks (with more than 16514064 sectors)return C=16383, H=16, S=63, for a total of 16514064 sectors (7.8 GB)independent of their actual size, but give their actual size inlba_capacity.

Recent Linux kernels (2.0.34, 2.1.90) know about thisand do the right thing. If you have an older Linux kernel and donot want to upgrade, and this kernel only sees 8 GiB of a much larger disk,then try changing the routine lba_capacity_is_ok in/usr/src/linux/drivers/block/ide.c into something like

For a more cautious patch, see 2.1.90.

11.1 BIOS complications

As just mentioned, large disks return the geometryC=16383, H=16, S=63 independent of the actual size,while the actual size is returned in the value of LBAcapacity.Some BIOSes do not recognize this, and translate this16383/16/63 into something with fewer cylinders and more heads,for example 1024/255/63 or 1027/255/63. So, the kernel must notonly recognize the single geometry 16383/16/63, but also allBIOS-mangled versions of it.Since 2.2.2 this is done correctly (by taking the BIOS ideaof H and S, and computing C = capacity/(H*S)).Usually this problem is solved by setting the disk to Normalin the BIOS setup (or, even better, to None, not mentioningit at all to the BIOS). If that is impossible because you haveto boot from it or use it also with DOS/Windows, and upgradingto 2.2.2 or later is not an option, use kernel boot parameters.

If a BIOS reports 16320/16/63, then this is usually donein order to get 1024/255/63 after translation. Mail designer pro 2 2 3 1 download free.

There is an additional problem here. If the disk was partitionedusing a geometry translation, then the kernel may at boot timesee this geometry used in the partition table, and reporthda: [PTBL] [1027/255/63]. This is bad, because now thedisk is only 8.4 GB. This was fixed in 2.3.21. Again, kernelboot parameters will help.

Many disks have jumpers that allow you to choose betweena 15-head an a 16-head geometry. The default settings will giveyou a 16-head disk. Sometimes both geometries address the samenumber of sectors, sometimes the 15-head version is smaller.There may be a good reason for this setup: Petri Kaukasoinawrites: `A 10.1 Gig IBM Deskstar 16 GP (model IBM-DTTA-351010) wasjumpered for 16 heads as default but this old PC (with AMI BIOS)didn't boot and I had to jumper it for 15 heads. hdparm -i tellsRawCHS=16383/15/63 and LBAsects=19807200. I use 20960/15/63 toget the full capacity.'For the jumper settings, seehttp://www.storage.ibm.com/techsup/hddtech/hddtech.htm.

11.3 Jumpers that clip total capacity

Many disks have jumpers that allow you to make the diskappear smaller than it is. A silly thing to do, and probablyno Linux user ever wants to use this, but some BIOSes crashon big disks. The usual solution is to keep the disk entirelyout of the BIOS setup. But this may be feasible only if thedisk is not your boot disk.

Clip to 2.1 GB

The first serious limit was the 4096 cylinder limit (that is,with 16 heads and 63 sectors/track, 2.11 GB).For example, a Fujitsu MPB3032ATU 3.24 GB disk has default geometry6704/15/63, but can be jumpered to appear as 4092/16/63,and then reports LBAcapacity 4124736 sectors, so that the operatingsystem cannot guess that it is larger in reality.In such a case (with a BIOS that crashes if it hears how big the disk isin reality, so that the jumper is required) one needs boot parametersto tell Linux about the size of the disk.

That is unfortunate. Most disks can be jumpered so as to appear as a 2 GB diskand then report a clipped geometry like 4092/16/63 or 4096/16/63, but stillreport full LBAcapacity. Such disks will work well, and use full capacityunder Linux, regardless of jumper settings.

Clip to 33 GB

A more recent limit is the 33.8 GB limit.Linux kernels older than 2.2.14 / 2.3.21 need a patch to be able to cope withIDE disks larger than this.

With an old BIOS and a disk larger than 33.8 GB, the BIOS may hang,and in such cases booting may be impossible, even when the diskis removed from the CMOS settings.See also the BIOS 33.8 GB limit.

Therefore, large IBM and Maxtor disks come with a jumperthat make the disk appear as a 33.8 GB disk.For example, the IBM Deskstar 37.5 GB (DPTA-353750) with 73261440 sectors(corresponding to 72680/16/63, or 4560/255/63) can be jumpered to appearas a 33.8 GB disk, and then reports geometry 16383/16/63 like any big disk,but LBAcapacity 66055248 (corresponding to 65531/16/63, or 4111/255/63).Similar things hold for recent large Maxtor disks.

Maxtor

With the jumper present, both the geometry (16383/16/63) and the size(66055248) are conventional and give no information about the actual size.Moreover, attempts to access sector 66055248 and above yield I/O errors.However, on Maxtor drives the actual size can be found and made accessibleusing the READ NATIVE MAX ADDRESS and SET MAX ADDRESS commands.Presumably this is what MaxBlast/EZ-Drive does. Now there is alsoa small Linux utility setmax.c for this, and also a kernel patch has been published.

Early large Maxtor disks have an additional detail: the J46 jumperfor these 34-40 GB disks changes the geometry from 16383/16/63to 4092/16/63 and does not change the reported LBAcapacity.This means that also with jumper present the BIOS (old Award 4.5*)will hang at boot time. For this case Maxtor provides a utilityJUMPON.EXE that upgrades the firmware to make J46 behave asdescribed above.

On recent Maxtor drives the call setmax -d 0 /dev/hdX willgive you max capacity again. However, on slightly older drives afirmware bug does not allow you to use -d 0, andsetmax -d 255 /dev/hdX returns you to almost full capacity.For Maxtor D540X-4K, see below.

IBM

For IBM things are worse: the jumper really clips capacityand there is no software way to get it back. The solution isnot to use the jumper but use setmax -m 66055248 /dev/hdXto software-clip the disk. ('How?' you say - 'I cannot boot!'.IBM gives the tip: If a system with Award BIOS hangs during drivedetection: Reboot the system and hold the F4 key to bypass autodetectionof the drive(s). If this doesn't help, find a different computer,connect the drive to it, and run setmax there. After doing thisyou go back to the first machine and are in the same situation aswith jumpered Maxtor disks: booting works, and after getting pastthe BIOS either a patched kernel or a setmax -d 0gets you full capacity.

Maxtor D540X-4K

The Maxtor Diamond Max drives 4K080H4, 4K060H3, 4K040H2 (aka D540X-4K)are identical to the drives 4D080H4, 4D060H3, 4D040H2 (aka D540X-4D),except that the jumper settings differ. A Maxtor FAQ specifies theMaster/Slave/CableSelect settings for them, but the capacity clip jumperfor the '4K' drives seems to be undocumented. Nils Ohlmeier reports thathe experimentally finds that it is the J42 jumper ('reserved forfactory use') closest to the power connector.(The '4D' drives use the J46 jumper, like all other Maxtor drives.)

However, it may be that this undocumented jumper acts like the IBM jumper:the machine boots correctly, but the disk has been clipped to 33 GBand setmax -d 0 does not help to get full capacity back.And the IBM solution works: do not use any disk-clipping jumpers, butfirst put the disk in a machine with non-broken BIOS, soft-clip itwith setmax -m 66055248 /dev/hdX, then put it back in thefirst machine, and after booting run setmax -d 0 /dev/hdXto get full capacity again.

The HDIO_GETGEO ioctl returns the number of cylinders in a short.This means that if you have more than 65535 cylinders, the number istruncated, and (for a typical SCSI setup with 1 MiB cylinders)a 80 GiB disk may appear as a 16 GiB one.Once one recognizes what the problem is, it is easily avoided.

(Below a discussion of Linux kernel problems. BIOS problemsand jumpers that clip capacity were discussedabove.)

Drives larger than 33.8 GB will not work with kernels older than2.2.14 / 2.3.21.The details are as follows.Suppose you bought a new IBM-DPTA-373420 disk with a capacityof 66835440 sectors (34.2 GB). Pre-2.3.21 kernels will tell youthat the size is 769*16*63 = 775152 sectors (0.4 GB), whichis a bit disappointing. And giving command line parametershdc=4160,255,63 doesn't help at all - these are just ignored.What happens? The routine idedisk_setup()retrieves the geometry reported by the disk (which is16383/16/63) and overwrites what the user specified onthe command line, so that the user data is used onlyfor the BIOS geometry. The routine current_capacity()or idedisk_capacity() recomputes the cylinder number as66835440/(16*63)=66305, but since this is stored in a short,it becomes 769. Since lba_capacity_is_ok() destroyed id->cyls,every following call to it will return false, so that thedisk capacity becomes 769*16*63.For several kernels a patch is available.A patch for 2.0.38 can be found atftp.kernel.org.A patch for 2.2.12 can be found atwww.uwsg.indiana.edu(some editing may be required to get rid of the html markup).The 2.2.14 kernels do support these disks.In the 2.3.* kernel series, there is support for these diskssince 2.3.21.One can also `solve' the problem in hardware byusing a jumper to clip the size to 33.8 GB.In many cases a BIOS upgrade will berequired if one wants to boot from the disk.

Above, we saw the structure ofthe MBR (sector 0): boot loader code followed by 4 partitiontable entries of 16 bytes each, followed by an AA55 signature.Partition table entries of type 5 or F or 85 (hex) have a specialsignificance: they describe extended partitions: blobs ofspace that are further partitioned into logical partitions.(So, an extended partition is only a box, it cannot be used itself,one uses the logical partitions inside.)Only the location of the first sector of an extended partition isimportant. This first sector contains a partition table with fourentries: one a logical partition, one an extended partition, andtwo unused. In this way one gets a chain of partition table sectors,scattered over the disk, where the first one describes three primarypartitions and the extended partition, and each following partitiontable sector describes one logical partition and the location ofthe next partition table sector.

It is important to understand this: When people do something stupidwhile partitioning a disk, they want to know: Is my data still there?And the answer is usually: Yes. But if logical partitions were createdthen the partition table sectors describing them are written at thebeginning of these logical partitions, and data that was there before is lost.

The program sfdisk will show the full chain. E.g.,

It is possible to construct bad partition tables.Many kernels get into a loop if some extended partition points backto itself or to an earlier partition in the chain.It is possible to have two extended partitions in one of thesepartition table sectors so that the partition table chain forks.(This can happen for example with an fdisk that does not recognizeeach of 5, F, 85 as an extended partition, and creates a 5 next to an F.)No standard fdisk type program can handle such situations, and somehandwork is required to repair them.The Linux kernel will accept a fork at the outermost level.That is, you can have two chains of logical partitions.Sometimes this is useful - for example, one can use type 5 and beseen by DOS, and the other type 85, invisible for DOS, so thatDOS FDISK will not crash because of logical partitions past cylinder 1024.Usually one needs sfdisk to create such a setup.

Many people think they have problems, while in fact nothing is wrong.Or, they think that the problems they have are due to disk geometry,while in fact disk geometry has nothing to do with the matter.All of the above may have sounded complicated, but disk geometryhandling is extremely easy: do nothing at all, and all is fine;or perhaps give LILO the keyword lba32 if it doesn't get past`LI' when booting. Watch the kernel boot messages, andremember: the more you fiddle with geometries (specifying headsand cylinders to LILO and fdisk and on the kernel command line)the less likely it is that things will work.Roughly speaking, all is fine by default.

And remember: nowhere in Linux is disk geometry used, so no problemyou have while running Linux can be caused by disk geometry.Indeed, disk geometry is used only by LILO and by fdisk.So, if LILO fails to boot the kernel, that may be a geometry problem.If different operating systems do not understand the partition table,that may be a geometry problem. Nothing else. In particular, ifmount doesnt seem to work, never worry about disk geometry -the problem is elsewhere.

14.1 Problem: My IDE disk gets a bad geometry when I boot from SCSI.

It is quite possible that a disk gets the wrong geometry.The Linux kernel asks the BIOS about hd0 and hd1 (the BIOS drivesnumbered 80H and 81H) and assumes that this data is for hda and hdb.But on a system that boots from SCSI, the first two disks may wellbe SCSI disks, and thus it may happen that the fifth disk, which isthe first IDE disk hda, gets assigned a geometry belonging to sda.Such things are easily solved by giving boot parameters`hda=C,H,S' for the appropriate numbers C, H and S, either at boot timeor in /etc/lilo.conf.

14.2 Nonproblem: Identical disks have different geometry?

`I have two identical 10 GB IBM disks. However, fdiskgives different sizes for them. Look:

How come?'

What is happening here? Well, first of all these drivesreally are 10gig: hdb has size 255*63*1232*512 = 10133544960,and hdd has size 16*63*19650*512 = 10141286400, so, nothingis wrong and the kernel sees both as 10.1 GB.Why the difference in size? That is because the kernel getsdata for the first two IDE disks from the BIOS, and the BIOShas remapped hdb to have 255 heads (and 16*19650/255=1232 cylinders).The rounding down here costs almost 8 MB.

If you would like to remap hdd in the same way, give the kernelboot parameters `hdd=1232,255,63'.

14.3 Nonproblem: fdisk sees much more room than df?

fdisk will tell you how many blocks there are on the disk.If you make a filesystem on the disk, say with mke2fs, thenthis filesystem needs some space for bookkeeping - typicallysomething like 4% of the filesystem size, more if you ask fora lot of inodes during mke2fs. For example:

We have a partition with 4095976 blocks, make an ext2 filesystemon it, mount it somewhere and find that it only has 3574475 blocks -521501 blocks (12%) was lost to inodes and other bookkeeping.Note that the difference between the total 3574475 and the 3369664available to the user are the 13 blocks in use plus the 204798blocks reserved for root. This latter number can be changed by tune2fs.This `-i 1024' is only reasonable for news spools and the like,with lots and lots of small files. The default would be:Now only 137501 blocks (3.3%) are used for inodes, so that we have384 MB more than before. (Apparently, each inode takes 128 bytes.)On the other hand, this filesystem can have at most 1024000 files(more than enough), against 4096000 (too much) earlier.

To partition a 1TB hard disk, do as below, please.

  1. 1. Use Windows+R to open 'Run', type diskmgmt.
  2. 2. You can right-click a partition which has much free space and select 'Shrink Volume'.
  3. 3. Adjust the partition size and click 'Shrink' to confirm.
  4. 4. Now, you will get an unallocated space..Read More>>

If you prefer a third-party tool, you can download EaseUS partition manager software.

How to Partition 1TB Hard Disk in Windows 11/10/8/7

It's necessary to know how to partition a 1TB hard drive, external HDD, or SSD in Windows 11/10 into several volumes. For many of us using Windows computers, we typically have two to four hard drive partitions, such as C, D, E & F drive. We use each of them for different purposes. C drive, also known as the system drive, is for Windows OS installation and system files. The rest partitions are usually data partitions, which we may use them to store a specified type of data. The number of partitions doesn't really matter. It just depends on how many you want on your computer. Partitioning 1TB hard drive in Windows 10 can be done in two ways, either with third-party disk and partition software or Disk Management.

PAGE CONTENT:
Method 1. Partition a 1TB Hard Drive with a Partition Tool in Windows 11/10/8/7
Method 2. Partition a 1TB HDD/SSD with Disk Management

Method 1. Partition a 1TB Hard Disk with a Partition Tool

In consideration of the ease of use, efficiency, and popularity, we decided to recommend EaseUS Partition Master. The free partition manager comes with the best solution to partition a 1TB HDD/SSD in Windows 11/10/8.1/8/7/XP/Vista. What's more, it has many excellent features:

  • Accelerate the performance of SSD with optimized partition alignment
  • Extend the C drive and run Windows OS faster
  • Create a partition to store copies of data
  • Clone an entire disk or partition to another without data loss

You're going to utilize two features of the recommended software to make hard drive partitioning happen.

  • Create a partition

You can also follow the step-by-step guide to partition a hard disk:

Step 1. Launch EaseUS Partition Master. On the main window, right-click on the unallocated space on your hard drive or external storage device and select 'Create'.

Step 2. Adjust the partition size, file system (Choose the file system based on your need), label, etc. for the new partition and click 'OK' to continue.

Step 3. Click on the 'Execute Operation' button and create a new partition by clicking 'Apply'.

Watch the following video tutotial and learn how to create a partition in NTFS, FAT, or EXT file system.

Method 2. Partition a 1TB HDD/SSD with Disk Management

Partition a hard disk using disk management is a common method taken by computer users. This Windows built-in tool can satisfy the common demands of most users. In Windows 11/10/8/7, Vista, and Windows Server 2008, Disk Management can shrink a volume, extend a volume, create volume, delete the volume, format the volume, etc. Follow the steps to partition a 1TB HDD or SSD:

Disk Map 2 5 Cylinder Engine

Step 1. Open Disk Management in Windows 11/10/8/7

Right-click on This PC > Click 'Manage' > Enter Device Manager and click 'Disk Management'.

Step 2. Partition the 1TB HDD/SSD in Windows 11/10/8/7

To shrink a partition:

  1. 1. Right-click on the partition that you want to shrink and select 'Shrink Volume'.
  2. 2. Adjust the partition size and 'Shrink' to confirm.

To create a partition:

Once you've shrunk a partition, you can use the unallocated space to create another partition.

  1. 1. Right-click the unallocated space and select 'New Simple Volume'.
  2. 2. Click 'Next' to continue, set the new partition size, drive letter, file system, click 'Finish'. Wait for the formatting completes.

Disk Map 2 5 Cylinder Identification

In this way, you can partition your 1TB HDD/SSD into several partitions. You can also change your drive letter after the steps.

To change the drive letter:

  1. 1. Right-click on the partition and select 'Change Drive Letter and Paths'.
  2. 2. Click 'Change' to set a new drive letter for your partition.

Extra Tips - How Many Partitions Are Best for 1TB

Generally speaking, according to the file types and personal habits, a 1TB hard drive can be partitioned into 2-5 partitions. Here we recommend you to partition it into four partitions: Operating system (C drive), Program File(D drive), Personal Data (E drive), and Entertainment (F drive).

C Drive (100GB - 200GB) is the main disk that contains the operating system and the related system files. Therefore, sufficient capacity is essential for the C Drive. Usually, the operating system and related files take up 70GB space. Thus, allocate the hard drive to add about 100GB-200GB of space to C Drive.

D Drive (About 100GB) is the drive for applications. If you install too many programs on C drive, the efficiency and speed of system operation will be reduced. So it is a nice choice to create a separate partition from a 1TB hard drive to store the programs. Generally, 100GB of space for program disk is enough for most people to use.

E Drive (50GB-100GB) is mainly designed for personal files. You can save vital personal files, including office business files, study material, private videos, or photos separately. It is recommended to create a separate partition for those important individual files. Generally, 50GB-100GB of space is enough.

F Drive (600-700GB) is mainly used for entertainment, such as watching movies and listening to music. These files take up lots of space. You can allocate as much space as possible.

Conclusion

It is easy to shrink, create, or extend a partition with a third-party tool or Disk Management. Besides, we have given proper advice on partition number and size for 1TB hard disk. In addition to hard drive partitioning, you can also use the EaseUS disk management tool to merge partitions, migrate OS and convert MBR to GPT or GPT to MBR without losing data.

2/5 As A Decimal

Partition 1TB Hard Drive Windows 11/10 FAQs

Is it safe to partition C drive? How long does it take to partition a 1TB hard drive? If you have these kinds of questions, you can read the following questions and answers.

How many partitions are best for 1TB?

Disk Map 2 5 Cylinder Head

1TB hard drive can be partitioned into 2-5 partitions. Here we recommend you to partition it into four partitions: Operating system (C Drive), Program File(D Drive), Personal Data (E Drive), and Entertainment (F Drive).

How long does it take to partition a 1TB hard drive?

About 10 minutes. If your computer is in good situation, you can run EaseUS Partition Master to create, shrink, and extend partitions in a few minutes.

What is the best way to partition a hard drive?

The best way to partition a hard drive:

Step 1. Launch EaseUS Partition Master

Step 2. Adjust the new partition size, file system, label, etc.

Step 3. Confirm to create a new partition

How long does it take to format a 1TB hard drive?

For your information, you can always format a hard drive within minutes or half an hour, depending on the hard drive capacity and used space on it. As estimated, to do a full format on a 1TB hard disk in Windows, it will take a long time, like 2- hours, and over a USB 2.0 connection, it may take a day!





broken image