• 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的速度.

    參考
    https://wiki.debian.org/SSDOptimization?action=show&

  • 相关阅读:
    AppleID的双重认证
    swift 分组tableview 设置分区投或者尾部,隐藏默认间隔高度
    swift 警告框
    数组
    循环结构(二)
    循环结构
    选择结构
    选择结构
    变量 数据类型和运算符
    (五)Spring 中的 aop
  • 原文地址:https://www.cnblogs.com/llguanli/p/8650810.html
Copyright © 2020-2023  润新知