View the size of the OS system block in linux

Source: Internet
Author: User
Linux: view the size of the OS system block-general Linux technology-Linux technology and application information. For more information, see the following section. Skate

View OS system block size

[Root] #/sbin/tune2fs-l/dev/sda1

View OS system page size

[Oracle @ skate-test ~] $ Getconf PAGESIZE
4096

Modify the block size:

You can specify the block size when creating a file system. In the future, if some large files are used in your file system, using a large block size will provide better performance. Adjust the block size of the ext2 File System to 4096byte instead of the default 1024 byte, which can reduce file fragmentation and speed up fsck scanning and file deletion and read operations. In addition, the ext2 file system retains 5% of the space for the root directory. For a large file system, unless used as a log file, the proportion of 5% is too large. You can use commands

# Mke2fs-B 4096-m 1/dev/hda6

Change it to 1% and create a file system with a block size of 4096byte.

The size of the chunks to be used depends on the overall consideration of your system. If the system is used as a mail or news server, a large chunk size is used, although the performance is improved, however, this will cause a large waste of disk space. For example, the average file size in the file system is 2145 bytes. If the block size of 4096byte is used, every file will waste bytes of space on average. If the block size of bytes is used, each file will waste bytes of space on average. How to balance the cost of performance and disk depends on the needs of specific applications.
Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.