我們輸入 fdisk /dev/磁碟代號 會看到磁碟有以下資訊 (依照版本略有不同,不過差異不大):
Disk /dev/sda: 255 heads, 63 sectors/track, 4462 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
首先列一下空間單位的基本概念:
1GBytes = 1024MBytes
1MBytes = 1024KBytes
1KBytes = 1024Bytes
1Byte = 8bits
電腦以1024切換單位
1. 計算每一磁柱大小:
255 (heads) x 63 (sectors) x 512 = 8225280 Bytes (cylinder size)
2. 計算總容量
(電腦算法 - 容量/ 1024)
8225280 (cylinder size) x 4462 = 36701199360 (bytes)
36701199360 / 1024 = 35841015 Kbytes
35841015 /1024 = 35000.99 MBytes
3500.99 / 1024 = 34.18 GBytes
(硬碟廠商算法 - 容量 / 1000)
36701199360 / 1000 = 36701199.360 Kbytes
36701199.360 / 1000 = 36701.11 MBytes
36701.11 / 1000 = 36.7 GBytes
PS:所以買36.7GB的硬碟,回家安裝之後,作業系統看到的是34.18GB
3.依照大小計算切割的磁柱:
如果要新增一個大小為512MB的磁區,個人是先將 cylinder 容量轉換為 MB:
8225280 / 1024 (轉Kbytes) / 1024 (轉Mbytes) = 7.844 MB / 每Cylinder
512 / 7.844 = 65.2
所以第一磁區為起始磁柱為 0,結束磁柱為 66 。
Posted by 椰子殼
