home *** CD-ROM | disk | FTP | other *** search
/ Caldera Network Desktop 1.0 / caldera-network-desktop-1.0-boot-disk.img / usr / doc / LST / BIGDISK.gz / BIGDISK
Text File  |  1996-01-15  |  13KB  |  257 lines

  1. Problems Using Very Large Hard Disks
  2.  
  3. Using very large hard disks in PCs can lead to problems because of
  4. the limitations of the BIOS and IDE standards on which most PCs are
  5. based. Problems arise because the BIOS can only manage hard disks with
  6. a maximum of 256 heads, 63 sectors, and 1024 cylinders; and because the
  7. IDE standard is based on a model that specifies the Cylinders, Heads,
  8. and Sectors of the hard diski (CHS model), but only allows a maximum of
  9. 16 heads, 255 sectors, and 65536 cylinders. The lowest limits of both of
  10. these standards combine to give a maximum size for standard hard disks
  11. of 504 MB (16 heads, 63 sectors, and 1024 cylinders).
  12.  
  13. The newer Enhanced-IDE (EIDE) standard avoids this limitation by not
  14. using CHS model. Instead, a Logical Block Addressing model is used
  15. (LBA). This model numbers all sectors on the disk sequentially.
  16.  
  17. Newer BIOS versions overcome the 504 MB limitation by using an Extended
  18. CHS model that extends the maximum number of heads to 256. The new upper
  19. size limit, from the Enhanced IDE and Extended CHS models, is almost
  20. 7.9 GB.
  21.  
  22. Linix does not use the BIOS to access your hard disk, so IDE and EIDE
  23. hard disks should not cause problems on Linux systems. If problems occur,
  24. however, Linux might be obtaining incorrect hard disk size parameters from
  25. the BIOS. To correct this problem, use boot parameters to pass the correct
  26. information to Linux. The parameter to pass is"hdx=cyl,heads,sect", where
  27. hdx is the hard disk device (hda, hdb, hdc, or hdd). More information
  28. is provided below on using these parameters to create cylinder counts
  29. of less than 1024.
  30.  
  31. SCSI Hard Disks
  32.  
  33. In general, all SCSI hard disks use the LBA mode mentioned above. SCSI
  34. hard disks do have a separate problem that EIDE hard disks do not have,
  35. however. SCSI hard disks larger than 1 GB must have special treatment with
  36. the 'fdisk' utility and while configuring the LILO boot manager. If your
  37. SCSI hard disk is affected by this problem, 'fdisk' will display messages
  38. regarding the problem when you prepare your hard disk. The expert mode
  39. of 'fdisk' can be used to correct the SCSI problems.  The LILO problems
  40. are fixed by adjusting the '/etc/disktab' file. Both of these fixes are
  41. described below with an example.
  42.  
  43. Why the Problem Arises
  44.  
  45. The problem with these larger hard disks is that the partition table must
  46. be read before any operating system becomes active. The partition table
  47. is accessed via the BIOS, which is limited to 256 heads, 63 sectors,
  48. and 1023 cylinders.  Because of this, the hard disk controller attempts
  49. to convert (or translate) the true parameters of hard disks with more
  50. than 1023 cylinders into values that can be accepted by the BIOS.
  51.  
  52. The partition table itself can always be found at the first cylinder,
  53. first sector and first header (which is the same in any translation);
  54. but because of this translation from the controller, if all data for
  55. the boot process (such as the boot loader and operating system kernel)
  56. are not found in the first 1024 cylinders, the BIOS cannot successfully
  57. boot the system.
  58.  
  59. Partitions can be created above 1024 cylinders, but you cannot boot these
  60. partitions because boot data in those high partitions cannot be accessed
  61. until after the system is booted. This only causes trouble when a system
  62. has multiple operating systems, and the user attempts to choose which
  63. to boot.
  64.  
  65. A work-around solution is to create a small Linux partition below 1023
  66. cylinders that can be used to boot the Linux system. This partition can
  67. be as little as 15 MB, because it only needs to contain the kernel and
  68. the root filesystem. The '/usr' directory and other information can be
  69. stored in a second Linux partition located above 1024 cylinders. Use the
  70. 'fdisk' utility of another operating system such as OS/2 to create these
  71. partitions. Then use the Linux 'fdisk' during installation to mark the
  72. partitions as Type 0x83, Linux.
  73.  
  74. A better solution is to enter the correct combination of cylinders,
  75. sectors, and heads that the hard disk controller is passing to the
  76. BIOS. Use the 'fdisk' expert mode, as described below. The following
  77. diagram shows an example of the translation of the physical values of
  78. the hard disk to LBA direct block addressing, which is finally used by
  79. the operating system to access the hard disk.
  80.  
  81. On the left, you can see that the physical layout of the hard disk is
  82. very different from the logical (LBA) values reported. Most hard disks
  83. have significantly fewer heads than are externally reported. The logical
  84. values reported by the hard disk should conform to the limitations of
  85. IDE or BIOS. In the case of an EIDE or SCSI controller, the controller
  86. itself will do another translation.
  87.  
  88. SCSI hard disks are usually reported as 64 heads and 32 sectors, giving
  89. a size of 64*32*512 Bytes = 1 MB per cylinder. EIDE usually reports 255
  90. heads. The last translation is done by the operating system itself. Here
  91. Linux uses logical block addressing (LBA) to refer to the blocks
  92. sequentially from the first block to the last block on the hard disk.
  93.  
  94. Many controllers use two different models in order to provide cylinder
  95. numbers under 1024. In most cases, the controller first tries to double
  96. the number of heads.  If this does not result in a cylinder count less
  97. than 1024, the controller increases the actual values for heads and
  98. sectors to the maximum possible number in order to minimize the number of
  99. cylinders. This process is used, for example, by the Extended Translation
  100. of the Adaptec controllers AH 274x/284x/294x. The NCR controller use a
  101. variant by which the number of heads and sectors is chosen to provide
  102. the correct size while being within the 1024 cylinder limit. Overlap
  103. between partitions is thereby minimizes because each partition begins
  104. and ends on a cylinder boundary.
  105.  
  106. The translation by an Adaptec controller of a 4 GB disk gives a count
  107. of 255 heads, 63 sectors, and 522 cylinders.
  108.  
  109. Your task is to find out the translation that the controller is doing,
  110. and enter the values that is passes for the hard disk into the expert
  111. mode of 'fdisk'. As you do this, remember that the total size of the
  112. hard disk must remain constant.
  113.  
  114. For example, assume that we have a computer with a 4 GB SCSI hard
  115. disk. This is more than 1024 cylinders, so 'fdisk' gives a warning
  116. during installation:
  117.  
  118.      The number of cylinders for this disk is set to 4095.
  119.  
  120.      This is larger than 1024, and may cause problems with:
  121.  
  122.      1) software that runs at boot time (e.g., LILO)
  123.  
  124.      2) booting and partitioning software form other OSs
  125.  
  126.       (e.g., DOS FDISK, OS/2 FDISK)
  127.  
  128. When you use the "p" command to display the partition table, you see a
  129. sequence of error messages:
  130.  
  131.         Device Boot  Begin   Start     End  Blocks   Id  System
  132.      /dev/sda1           1       1     754  771088+   6  DOS 16-bit>32M
  133.      Partition 1 does not end on cylinder boundary:
  134.           phys=(95, 254, 63) should be (95, 63, 32) 
  135.      /dev/sda2   *      97     754    1954 1228972+  82  Linux swap 
  136.      Partition 2 does not end on cylinder boundary:
  137.           phys=(248, 254, 63) should be (248, 63, 32) 
  138.      /dev/sda3        1274    1954    2456  514080   a5  BSD/386 
  139.      Partition 3 does not end on cylinder boundary:
  140.           phys=(312, 254, 63) should be (312, 63, 32) 
  141.      /dev/sda4        2362    2456    4095 1678792+   5  Extended 
  142.      Partition 4 does not end on cylinder boundary:
  143.           phys=(521, 254, 63) should be (521, 63, 32) 
  144.      /dev/sda5        2362    2456    2707  257008+  83  Linux 
  145.      /dev/sda6        2394    2707    2770   64228+  83  Linux native 
  146.      /dev/sda7        2402    2770    3436  682731    6  DOS 16-bit>32M 
  147.      /dev/sda8        2487    3436    4095  674698+   6  DOS 16-bit>32M
  148.  
  149.  
  150. To correct these errors, new values must be provided for 'fdisk' so that
  151. the partition boundaries match the values reported by the hard disk and
  152. controller. In this example, the 4 GB hard disk shown above has 64 heads,
  153. 32 sectors, and 4095 cylinders, for a total capacity of 64*32*4095 bytes =
  154. 4095 MB.
  155.  
  156. If you set the number of heads to 255, and the number of sectors to 63
  157. (a hint that this value is correct appears in the error messages shown
  158. above), the partition still must have 4095 MB. So if 255*63*cylinders =
  159. 4095 MB, then the number of cylinders would be 522.
  160.  
  161. These new values must be entered in 'fdisk'. First, you must change
  162. to the expert mode with the "x" command; then enter the new parameters
  163. for the heads, sectors, and cylinders. In expert mode the commands "c"
  164. (cylinders), "h" (heads), and "s" (sectors) can be used. According to
  165. the calculation above, these values should be 255 heads and 63 sectors.
  166.  
  167. NOTE: If you are using DOS on your system, never enter a head count
  168. of 256.  This value will cause DOS to crash without comment.
  169.  
  170. Below is how the screen might look as you enter these new values in
  171. 'fdisk'.
  172.  
  173.      Expert command (m for help): h Number of heads (1-256): 255
  174.  
  175.      Expert command (m for help): s Number of sectors (1-63): 63 
  176.      Warning: setting sector offset for DOS compatiblity
  177.  
  178.      Expert command (m for help): c Number of cylinders (1-65535): 522
  179.  
  180. After these values are entered in the "fdisk" expert mode, return to the
  181. normal main menu of "fdisk" with "r". Now using the "p" command should
  182. show all partitions without the warnings shown in the first listing above.
  183.  
  184.      Command (m for help): p Disk /dev/sda: 255 heads, 63 sectors, 522
  185.      cylinders Units = cylinders of 16065 * 512 bytes
  186.  
  187.         Device Boot  Begin   Start     End  Blocks   Id  System
  188.      /dev/sda1           1       1      96  771088+   6  DOS 16-bit>32M
  189.      /dev/sda2   *      97      97     249 1228972+  82  Linux swap
  190.      /dev/sda3         250     250     313  514080   a5  BSD/386
  191.      /dev/sda4         314     314     522 1678792+   5  Extended
  192.      /dev/sda5         314     314     345  257008+  83  Linux native
  193.      /dev/sda6         346     346     353   64228+  83  Linux native
  194.      /dev/sda7         354     354     438  682731    6  DOS 16-bit>32M
  195.      /dev/sda8         439     439     522  674698+   6  DOS 16-bit>32M
  196.  
  197.  
  198. If the error messages have not disappeared, you have not yet found the
  199. right values. Try again with new values until the error messages do
  200. not appear.
  201.  
  202. When you find the correct values, make a note of them in your system
  203. documentation.  You must enter these values each time you need to run
  204. 'fdisk'. They are not saved.
  205.  
  206. After the correct values are entered in expert mode, you can continue
  207. working normally with 'fdisk' to create the partitions that you need to
  208. install Linux on.
  209.  
  210. If you want to use LILO to boot Linux directly from the hard disk,
  211. you must list the correct partitions in the file '/etc/fstab/. These
  212. partitions are shown from the main menu of 'fdisk' once you have corrected
  213. the information in expert mode. Change the partition display of 'fdisk'
  214. from units to sectors with the "u" command. The sector values shown
  215. correspond to the block values of the LBA mode.
  216.  
  217.      Command (m for help): u Changing display/entry units to sectors
  218.  
  219.      Display the revised partition table:
  220.  
  221.      Command (m for help): p
  222.  
  223.      Disk /dev/sda: 255 heads, 63 sectors, 522 cylinders 
  224.      Units = sectors of 1 * 512 bytes
  225.  
  226.         Device Boot  Begin   Start     End  Blocks   Id  System
  227.      /dev/sda1          63      63 1542239  771088+   6  DOS 16-bit>32M
  228.      /dev/sda2   * 1542240 1542240 4000184 1228972+  82  Linux swap
  229.      /dev/sda3     4000185 4000185 5028344  514080   a5  BSD/386
  230.      /dev/sda4     5028345 5028345 8385929 1678792+   5  Extended
  231.      /dev/sda5     5028408 5028408 5542424  257008+  83  Linux native
  232.      /dev/sda6     5542488 5542488 5670944   64228+  83  Linux native
  233.      /dev/sda7     5671008 5671008 7036469  682731    6  DOS 16-bit>32M
  234.      /dev/sda8     7036533 7036533 8385929  674698+   6  DOS 16-bit>32M
  235.  
  236. Now the start, size and end of the partition are no-longer displayed in
  237. cylinders, but in sectors (which Linux uses to access the hard disk).
  238. Enter these sector values in the file '/etc/disktab'. The entries in
  239. this file would look like this for our example:
  240.  
  241.      # Dev.  BIOS    Secs/   Heads/  Cylin  Part.  
  242.      # num.  code    track   cylin.  ders   offset
  243.  
  244.      0x801   0x80    63      255     522     63      # /dev/sda1 
  245.      0x802   0x80    63      255     522     1542240 # /dev/sda2 
  246.      0x803   0x80    63      255     522     4000185 # /dev/sda3 
  247.      0x805   0x80    63      255     522     5028408 # /dev/sda5 
  248.      0x806   0x80    63      255     522     5542488 # /dev/sda6 
  249.      0x807   0x80    63      255     522     5671008 # /dev/sda7 
  250.      0x808   0x80    63      255     522     7036533 # /dev/sda8
  251.  
  252.  
  253. The process described here is a difficult one, and we cannot guarantee
  254. your success for any particular hardware configuration. We hope that the
  255. principal steps and concepts are clear, however. If you have trouble,
  256. please contact Caldera for additional information or suggestions.
  257.