0

I have the following query:

I want to increase the I/O size (minimum / optimal) of the CentOS.

By default the value is 512 bytes and I want to increase it to 262144 bytes / 524288 bytes.

Currently executing the fdisk -l command I get the following result:


WARNING: fdisk GPT support is currently new, and therefore in an experimental phase. Use at your own discretion.

Disk /dev/sda: 53.7 GB, 53687091200 bytes, 104857600 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk label type: gpt
Disk identifier: D9567AE9-EB97-4AD7-BA7B-9A2C0EE06951


#         Start          End    Size  Type            Name
 1         2048       411647    200M  EFI System      EFI System Partition
 2       411648      2508799      1G  Microsoft basic
 3      2508800    104855551   48,8G  Linux LVM

Disk /dev/sdb: 42.9 GB, 42949672960 bytes, 83886080 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk label type: dos
Identificador del disco: 0x62b5095d

Disposit. Inicio    Comienzo      Fin      Bloques  Id  Sistema
/dev/sdb1            2048    83886079    41942016   8e  Linux LVM
WARNING: fdisk GPT support is currently new, and therefore in an experimental phase. Use at your own discretion.

Disk /dev/sdc: 21.5 GB, 21474836480 bytes, 41943040 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk label type: gpt
Disk identifier: 98228612-062D-4DDC-9CC6-4B849FA55DAF


#         Start          End    Size  Type            Name
 1         2048     41943006     20G  Linux filesyste

0

What fdisk is telling you here is a function of the hardware: that it physically has sectors of 512 bytes and that it wishes for them to be addressed logically as 512-byte chunks. While it is possible to set the logical size with hdparm --set-sector-size, there is a large warning in the manual page about doing so and the sizes you want aren't supported.

Moreover, even if you could do that, you probably wouldn't want to, because increasing the sector size means that your file system would have to support such a size (which it doesn't) and that the smallest size your file system could be support would be the logical size, which would mean that storing many small files would be wildly inefficient. In addition, every time you wrote a chunk smaller than the logical size, you'd incur the expense of reading the full chunk from disk and writing the full chunk back, which would hurt performance.

If you want to change the size of a program's I/O operations, you can do so with the program's source code and change the size of the buffers used. However, there isn't a way to do this on a system-wide basis, because in general it's unnecessary and the kernel does the most efficient thing automatically. If you explain a bit more about what you want to do, perhaps we can help you do that.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.