我打算爲閃存可移動設備編寫一個磁盤分區創建程序,主要由基於SCSI的I/O控制並通過LBA地址訪問。在閃存存儲分區表上如何確定磁盤幾何形狀(C/H/S)?
作爲參考,我正在研究由Ubuntu的磁盤實用程序進行分區和格式化的SD卡上的分區表。
我在Linux中使用'parted'軟件的'unit'命令來觀察CHS單元和字節單元的卡參數。
下面是一個8GB的SD卡15122432個部門LBA的:
[email protected]:~ $ sudo parted /dev/sda
GNU Parted 3.2
Using /dev/sda
Welcome to GNU Parted! Type 'help' to view a list of commands.
(parted) unit chs print
Model: Generic CRM01 SD Reader (scsi)
Disk /dev/sda: 1020,130,11
Sector size (logical/physical): 512B/512B
BIOS cylinder,head,sector geometry: 1020,239,62. Each cylinder is 7587kB.
Partition Table: msdos
Disk Flags:
Number Start End Type File system Flags
1 0,1,0 1019,238,61 primary ext3
(parted) unit b print
Model: Generic CRM01 SD Reader (scsi)
Disk /dev/sda: 7742685184B
Sector size (logical/physical): 512B/512B
Partition Table: msdos
Disk Flags:
Number Start End Size Type File system Flags
1 31744B 7738552319B 7738520576B primary ext3
下面是一個4GB的SD卡7585792個部門LBA的:
(parted) unit chs print
Model: Generic CRM01 SD Reader (scsi)
Disk /dev/sda: 1019,71,29
Sector size (logical/physical): 512B/512B
BIOS cylinder,head,sector geometry: 1019,120,62. Each cylinder is 3809kB.
Partition Table: msdos
Disk Flags:
Number Start End Type File system Flags
1 0,1,0 1018,119,61 primary ext3
(parted) unit b print
Model: Generic CRM01 SD Reader (scsi)
Disk /dev/sda: 3883925504B
Sector size (logical/physical): 512B/512B
Partition Table: msdos
Disk Flags:
Number Start End Size Type File system Flags
1 31744B 3881656319B 3881624576B primary ext3
從我的觀察,磁盤幾何值(C/H/S)在不同容量的SD卡上不同,幾何值似乎與分區末尾的CHS地址相關聯。它看起來像..
具有分區結束CHS元組的卡是(c,h,s),其磁盤幾何形狀將是(c + 1/h + 1/s + 1)。他們有關係嗎?
但是如何確定這些值?這些依賴於操作系統或文件系統嗎?
我投票結束這個問題作爲題外話,因爲這更適合Unix和Linux堆棧交換! –