To view the operating system block size: #tune2fs-L/dev/sda1 |grep ' block size ' (tune2fs-l/dev/sda1 can see more relevant file system details)
To view the size of the OS system page: #getconf PAGESIZE
When you create a file system, you can specify the size of the block。 If the future in your file system is some relatively large files, the use of large block size will be better performance. Adjust the block size of the ext2 file system to 4096byte instead ofthe default 1024byte, you can reduce file fragmentation, speed up the fsck scan, and the speed of file deletion and read operations. In addition, in the Ext2 file system, 5% of the space is reserved for the root directory, and for a large file system, unless used as a log file, the 5% ratio is somewhat excessive. You can use the command "#mke2fs-b 4096-m 1/dev/sda6"Change it to 1% and create the file system in block size 4096byte.
How much block size to use, depending on your system to consider, if the system as a mail or news server, the use of large block size, although performance has improved, but will cause a large amount of wasted disk space. For example, file system files average size of 2145byte, if the use of 4096byte block size, each file will be wasted 1951byte space. If you use a block size of 1024byte, you will waste 927byte of space on average per file.How to balance the cost of performance and disk depends on the needs of the specific application。
The 1th set of commands:
Mkfs.ext3-t News/dev/sda5 (specifies that the partition file system has a block size of 4096)
Mkfs.ext3-b 4096/dev/sda5
The 2nd set of commands:
Mkfs.ext3-i 4096/dev/sda5 (Specifies the number of bytes per inode is 4096)
Mkfs.ext3/dev/sda5
Mkfs.ext3-b 2046-m 2/dev/hda5 format and set the data block to 2KB, set the reserved block to 2%
Or use Tune2fs-m 2/dev/hda4 This method can be set without formatting
Tune2fs-l/dev/hda5 can view the file system details
Tune2fs-j/dev/hda4 can convert ext2 to ext3 without damaging data
File System Check tool: Fsck e2fsck
E2fsck time is dangerous, can not well identify the file system, especially EXT2,EXT3 mixing time
How to use fsck: Fsck-t ext3/dev/hda5 or Fsck.ext3/dev/hda5
Change the default block size for Linux systems