當前位置:編程學習大全網 - 源碼下載 - 為什麽Linux的fdisk分區時First Sector是63或2048?

為什麽Linux的fdisk分區時First Sector是63或2048?

To understand why not 1, I need to describe some PC history. A long time ago, when the PC was first provided with hard drives, the first block on the drive was used by the Master Boot Record. Thats still true today, the first partition always began on Cylinder 0, Head 1, Sector 0, under the Cylinder/Head/Sector addressing scheme, whic is all there was than. To add to the interest, hard drives actually had differing numbers of sectors per track then and you had to describe the real geometry of the drive to the BIOS. There was no auto dectect or Logical Block Addressing as used today. The Cylinder/Head/Sector addressing scheme broke permently when hard drives reached 4Gb but its legacy lives on. The largest numbers that fit in the CHS addressing scheme is 255 heads and 63 sectors per track. Hence until recently, the first partition always started at sector 63. Thats head 1, sector 0. //CHS方式尋址時,扇區號是從1開始的。但是實際的物理扇區是從0開始的,對於LBA尋址方式來說扇區號也是從0開始。這裏出現的secotr 0是指物理扇區號。Over the years, boot loaders have used some of the 'unallocated' space between the MBR and the start of the first partition. With the death of the legacy BIOS (ok, its not quite dead yet) and its replacement with EFI BIOS, a special boot partitionis needed to allow EFI systems to boot in EFI mode. Starting the first partition at sector 2048 leaves 1Mb for the EFI boot code. Modern partitioning tools do this anyway and fdisk has been updated to follow suit. You can force some tools to give you back most of this 1Mb but its usually a bad idea. Your 2Tb drive will use 4k physical sectors. Its very important that you create partitions that are aligned on 4kb boundaries or your read/write speeds will be very poor. That is, partition starts must be a multiple of eight sectors. Notice that 63 is not a multiple of 8 but that 2048 is. As you really need to leave some space for grub, you should not start your first partition before sector 64. If you know how big grub is, you can make that smaller but its not worth the effort.

  • 上一篇:青蛙是青蛙嗎?
  • 下一篇:wifi路由器怎麽橋接?
  • copyright 2024編程學習大全網