6/02/2008

看操作系统块大小

查看操作系统块大小


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

C:\Documents and Settings\administrator>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
上面簇字节数既为块大小。


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

[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即为块大小。

在Solaris系统上,可以用命令fstyp,测试如下:

bash-2.05# fstyp -v /dev/rdsk/c0t2d0s0 |more
ufs
magic 11954 format dynamic time Mon Nov 4 17:46:05 2002
sblkno 16 cblkno 24 iblkno 28 dblkno 408
sbsize 2048 cgsize 4096 cgoffset 160 cgmask 0xfffffff0
ncg 697 size 17827200 blocks 17553949
bsize 4096 shift 12 mask 0xfffff000
fsize 1024 shift 10 mask 0xfffffc00
frag 4 shift 2 fsbtodb 1
minfree 1% maxbpg 1024 optim time
maxcontig 256 rotdelay 0ms rps 120
csaddr 408 cssize 11264 shift 8 mask 0xffffff00
ntrak 10 nsect 320 spc 3200 ncyl 11142
cpg 16 bpg 6400 fpg 25600 ipg 3040
nindir 1024 inopb 32 nspf 2
nbfree 4388485 ndir 2 nifree 2118876 nffree 4
cgrotor 0 fmod 0 ronly 0 logbno 0
上面sbsize即为块大小。