linux 磁盘系统block区别

linux磁盘block和系统block区别

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
磁盘里面和文件系统里面都有一个叫"block size"的值,但它们的大小不一定一样.
磁盘里面一般都是512bytes;文件系统里面的不一定也是512bytes,一般是1024bytes

例如:
[root@dev ~]# fdisk -l /dev/vda
Disk /dev/vda: 21.5 GB, 21474836480 bytes, 41943040 sectors
Units = sectors of 1 * 512 = 512 bytes # 512 表示单个磁盘 block 是 512字节
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk label type: dos
Disk identifier: 0x0009d5a6

Device Boot Start End Blocks Id System
/dev/vda1 * 2048 1026047 512000 83 Linux
/dev/vda2 1026048 41943039 20458496 8e Linux LVM


[root@dev ~]# tune2fs -l /dev/vda1 |grep "Block size"
Block size: 1024