Windows XP Windows 7 Windows 2003 Windows Vista Windows 綜合教學 Linux 系統教學
Windows 10 Windows 8 Windows 2008 Windows NT Windows Server 電腦軟體教學
您现在的位置: Windows教程網 >> Windows教程 >  >> Linux 系統教學 >> Linux 教學

Linux 查看磁碟扇區大小:fdisk -l 一鍵確認 512B/4K 物理扇區

編輯:Linux 教學

磁碟預設邏輯扇區 512 Bytes,現代大容量硬碟常用 4K (4096 Bytes) 物理扇區 (Advanced Format)。快速確認:

[root@localhost ~]# fdisk -l
Disk /dev/sda: 500.1 GB, 500107862016 bytes, 976773168 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes

關鍵輸出解讀

  • Sector size (logical/physical): 512 bytes / 4096 bytes → 邏輯 512B、物理 4K (Advanced Format)。
  • I/O size (minimum/optimal): 4096 bytes / 4096 bytes → 建議 I/O 對齊 4K 倍數。
  • 若顯示 512 bytes / 512 bytes 傳統 512B 物理扇區。

補充指令

# lsblk 顯示邏輯/物理扇區
lsblk -t

# smartctl 查看詳細 (需 smartmontools)
smartctl -a /dev/sda | grep -i sector

# blockdev 獲取邏輯扇區
blockdev --getss /dev/sda

對齊最佳實踐

  • 分區起始扇區對齊 2048 (1MiB) 或 4096 扇區倍數。
  • 檔案系統建立指定 mkfs.ext4 -E stride=8,stripe-width=256 /dev/sdX (RAID 條帶優化)。
  • 資料庫/虛擬機映像檔建議 fallocate -l 10G /path/file 預分配對齊。
Copyright © Windows教程網 All Rights Reserved