What does 'IO Block' mean in the out put of stat command
Linux - NewbieThis Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place!
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
I believe the IO block size of an NFS disk is "not really specified" (I think you are seeing an uninitialized value). NFS can't use a block size, as it is limited by the network. Any block size specifications are only on the server, but that information isn't passed to the client, as there is no way for the client to make use of it.
A block is the minimal size that can be written to disk. Even if the size is smaller then this block, a full block is needed.
On modern Linux systems the block size is 4096 (but it can be smaller/larger). The block size is set/determined when creating a file system, you can retrieve it by using the following command (as root):
Code:
# dumpe2fs /dev/sda2 | grep "^Block size:"
Replace the bold part with the device you want to check.
When using NFS you can set the rsize and wsize while mounting; The 1048576 seen on the NFS share is the largest read/write payload supported by the Linux NFS client.
Thanks for your effort. But I want to know what exactly 'IO Block' mean in stat command and the value of 'IO Block' in nfs is quite different, so what resulted in this?
Thanks for your effort. But I want to know what exactly 'IO Block' mean in stat command and the value of 'IO Block' in nfs is quite different, so what resulted in this?
I'm not sure what more I can tell you.
IO Block is a fixed thing, it shows the block size that is being used. 4096 on the ext4 files-system you use, 1048576 on the NFS file-system you use.
The stat line: Size: shows the actual size (what you expect: a 1 byte file will show up as 1). Blocks: Is the amount of blocks used (a 1 byte file will use 1 block, which is 4096 bytes on disk for a normal file-system). IO Block: Size of the block used.
IO Block is a fixed thing, it shows the block size that is being used. 4096 on the ext4 files-system you use, 1048576 on the NFS file-system you use.
The stat line: Size: shows the actual size (what you expect: a 1 byte file will show up as 1). Blocks: Is the amount of blocks used (a 1 byte file will use 1 block, which is 4096 bytes on disk for a normal file-system). IO Block: Size of the block used.
Hi,
I mean the value of 'IO Block' in nfs directory is not always 1048576. It could be any other value, like 4096, 32768 etc after checking some other nfs. I want to know what decides this value?
I mean the value of 'IO Block' in nfs directory is not always 1048576. It could be any other value, like 4096, 32768 etc after checking some other nfs. I want to know what decides this value?
As mentioned in post #3: The rsize/wsize option.
This from the nfs manual page:
Quote:
The rsize value is a positive integral multiple of 1024.
Specified rsize values lower than 1024 are replaced with
4096; values larger than 1048576 are replaced with
1048576. If a specified value is within the supported
range but not a multiple of 1024, it is rounded down to
the nearest multiple of 1024.
5.1. Setting Block Size to Optimize Transfer Speeds
The mount command options rsize and wsize specify the size of the chunks of data that the client and server pass back and forth to each other. If no rsize and wsize options are specified, the default varies by which version of NFS we are using. The most common default is 4K (4096 bytes), although for TCP-based mounts in 2.2 kernels, and for all mounts beginning with 2.4 kernels, the server specifies the default block size.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.