2021-05-12 14:32:11
Debian SSD ext4 4K 對齊
新入手了一台thinkpad, 原來的機械硬碟是500G的, 於是購入一塊鎂光的MX200 250G的SSD來新裝debian stable(jessie)
1, 安裝系統的之前按住F1進入bios後把模式改為AHCI.
2, 用U盤做的啟動盤.版本是debian 8.1 AMD64
3, 安裝系統的時候選擇預設推薦分割區,也就是一整塊
4, debian8 預設是ext4 檔案系統.
5, 裝完後fdisk -lu 發現已經是4K對齊了.
root@debian:/home/tommy# fdisk -lu
Disk /dev/sda: 232.9 GiB, 250059350016 bytes, 488397168 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
Disklabel type: dos
Disk identifier: 0xa6c609e3
Device Boot Start End Sectors Size Id Type
/dev/sda1 * 2048 499711 497664 243M 83 Linux
/dev/sda2 501758 488396799 487895042 232.7G 5 Extended
/dev/sda5 501760 488396799 487895040 232.7G 8e Linux LVM
Disk /dev/mapper/debian--vg-root: 223.2 GiB, 239649947648 bytes, 468066304 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
Disk /dev/mapper/debian--vg-swap_1: 9.5 GiB, 10150215680 bytes, 19824640 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
原來核心>=2.6.3以後ext4就可以直接支援了.
測試下寫入
#dd if=/dev/zero of=./largefile bs=1M count=1024
1024+0 records in
1024+0 records out
1073741824 bytes (1.1 GB) copied, 0.800335 s, 1.3 GB/s
#sh -c "sync && echo 3 > /proc/sys/vm/drop_caches"
#dd if=./largefile of=/dev/null bs=4k
262144+0 records in
262144+0 records out
1073741824 bytes (1.1 GB) copied, 4.68755 s, 229 MB/s
這寫入速度,1.3GB/s, 讀取的速度比較符合接入的是sata2的速度.
本文永久更新連結地址:http://www.linuxidc.com/Linux/2015-10/123783.htm
相關文章