欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页  >  网络运营

查看linux文件系统块大小的实现方法

程序员文章站 2023-02-14 17:55:27
在linux系统上,可以用命令tune2fs ,测试如下 [root@localhost test10g]# tune2fs -help tune2fs 1...

在linux系统上,可以用命令tune2fs ,测试如下

[root@localhost test10g]# tune2fs -help
tune2fs 1.35 (28-feb-2004)
tune2fs: invalid option -- h
usage: tune2fs [-c max-mounts-count] [-e errors-behavior] [-g group]
    [-i interval[d|m|w]] [-j] [-j journal-options]
    [-l] [-s sparse-flag] [-m reserved-blocks-percent]
    [-o [^]mount-options[,...]] [-r reserved-blocks-count]
    [-u user] [-c mount-count] [-l volume-label] [-m last-mounted-dir]
    [-o [^]feature[,...]] [-t last-check-time] [-u uuid] device
[root@localhost test10g]# df
filesystem      1k-blocks   used available use% mounted on
/dev/sda2       8776068  7576504  753764 91% /
/dev/sda1        497829   16303  455824  4% /boot
none          517300     0  517300  0% /dev/shm
/dev/sda5       1035660   96452  886600 10% /tmp
[root@localhost test10g]# tune2fs -l /dev/sda1|grep block
block count:       514048
block size:        1024      
blocks per group:     8192
[root@localhost test10g]# tune2fs -l /dev/sda2|grep block
block count:       2229018
block size:        4096
blocks per group:     32768

上面block size即为块大小。

在windows系统上,可以用命令fsutil来查看,测试如下:

c:\documents and settings\ct2>fsutil --help
--help 是无效参数。
---- 支持的命令 ----

behavior    控制文件系统行为
dirty      管理卷的被损坏的位数
file      文件特定命令
fsinfo     文件系统信息
hardlink    硬链接管理
objectid    对象 id 管理
quota      配额管理
reparsepoint  重分析点管理
sparse     稀疏文件控制
usn       usn 管理
volume     卷管理

c:\documents and settings\ct2>fsutil fsinfo ntfsinfo c:

ntfs 卷序列号 :    0x72ccb5f2ccb5b129
版本 :             3.1
区数量 :         0x0000000008ff8235
簇总数 :         0x00000000011ff046
可用簇 :         0x0000000000547b73
保留总数 :         0x0000000000000050
每个扇区字节数 :        512
每个簇字节数 :        4096
每个 filerecord 段的字节数  : 1024
每个 filerecord 段的簇数 : 0
mft 有效数据长度 :      0x0000000009cac000
mft 起始 lcn :         0x00000000000c4df6
mft2 起始 lcn :         0x00000000008ff823
mft 区域起始 :         0x0000000001067920
mft 区域结尾  :         0x000000000108ce60

上面簇字节数既为块大小。

注:第二扩展文件系统(second extended filesystem,ext2)。 ext3(third extended filesystem)

man fs
    ext2  is the high performance disk filesystem used by linux for fixed
       disks  as  well as removable media.  the second extended
       filesystem was designed as an extension of the extended file
       system (ext).  ext2 offers the best performance (in terms of
       speed and cpu usage) of the filesystems supported under linux.
    ext3  is a journaling version of the ext2 filesystem. it is easy to
       switch back and forth between ext2 and ext3.
    ext3  is a journaling version of the ext2 filesystem. ext3 offers the
       most complete set of journaling options  available  among
       journaling filesystems.

以上就是小编为大家带来的查看linux文件系统块大小的实现方法全部内容了,希望大家多多支持~