Linux上ssd硬盘如何4k对齐
1、查看现有磁盘是否是4k对齐
fdisk -l -u
如图,Start 为8的倍数则4k对齐,否则没有对齐

2、如何用 fdisk 对齐分区
fdisk /dev/vdb
WARNING: DOS-compatible mode is deprecated. It's strongly recommended to
switch off the mode (command 'c') and change display units to
sectors (command 'u').
Command (m for help): n
Command action
e extended
p primary partition (1-4)
p
Partition number (1-4): 1
First cylinder (1-208050, default 1):
Using default value 1
Last cylinder, +cylinders or +size{K,M,G} (1-208050, default 208050):
Using default value 208050
Command (m for help): x
Expert command (m for help): b
Partition number (1-4): 1
New beginning of data (1-209714399, default 63): 128
Expert command (m for help): p
Disk /dev/vdb: 16 heads, 63 sectors, 208050 cylinders
Nr AF Hd Sec Cyl Hd Sec Cyl Start Size ID
1 00 1 1 0 15 63 1023 128 209714272 83
2 00 0 0 0 0 0 0 0 0 00
3 00 0 0 0 0 0 0 0 0 00
4 00 0 0 0 0 0 0 0 0 00
Expert command (m for help): w
The partition table has been altered!
Calling ioctl() to re-read partition table.
The kernel still uses the old table. The new table will be used at
the next reboot or after you run partprobe(8) or kpartx(8)
Syncing disks.
这样分区之后再用 fdisk -l -u
查看,已经是分区对齐了。