Solved

How to change disk block size in Redhat linux server

Posted on 2014-04-10
5
6,080 Views
Last Modified: 2014-04-19
I was trying to change disk block size in linux server but it does not work for me,

blockdev -setbsz 8192 /dev/sdb

Can someone let me know, what should be the proper procedure to change block size for disk on linux.

Thanks
0
Comment
Question by:sams20
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
5 Comments
 
LVL 62

Accepted Solution

by:
gheist earned 250 total points
ID: 39993127
To change disk blocksize to 8K you need to go to blacksmith... It is not a software option.

cat /sys/block/sda/queue/*_block_size
basically any mention of 4096 says you have AF drive and 4k block is optimal (you can still try to set such drive to 512 byte blocks to reduce performance 8x and rise disk wear 8x
0
 
LVL 6

Assisted Solution

by:xeroxzerox
xeroxzerox earned 250 total points
ID: 39993378
In ext3, an 8K block size on the fs is only possible if you use Itanium and other 8K architectures. If your architecture is x86, x86_64, it is not possible to have a block size greater than 4k. If you try to make an ext3 fs you will fail with an error message similar to this:

mkfs.ext3: 8192-byte blocks too big for system (max 4096)

So,if your server architecture can take it, you can
use parted post installation to make the partition and then type the following example

mkfs -t ext3 -b 8192 /dev/sda

For more information you should go redhat site
https://access.redhat.com/site/documentation/en-US/
0
 

Author Comment

by:sams20
ID: 39994889
What about ext4, In my system most of file systems type is ext4. In this case, what about this command  " mkfs -t ext4 -b 8192 /dev/sda" .
0
 
LVL 62

Expert Comment

by:gheist
ID: 39994904
Did you check physical disk block size?
"cat /sys/block/sda/queue/*_block_size"
If it is 4K in either number - 4K is your only choice
If it is both 512 you have choices of 1K 2K 4K (but other than 4K will not work for /boot)

your command will not work:
"man 2 mke2fs"
OPTIONS
       -b block-size
              Specify the size of blocks in bytes.  Valid block-size values are 1024, 2048 and 4096 bytes per block.  If omitted, block-size is heuristically determined by the filesystem size and the expected usage of the filesystem (see the  -T
              option).   If  block-size is preceded by a negative sign ('-'), then mke2fs will use heuristics to determine the appropriate block size, with the constraint that the block size will be at least block-size bytes.  This is useful for
              certain hardware devices which require that the blocksize be a multiple of 2k.
0

Featured Post

Are You Using the Best Web Development Editor?

The worlds of web hosting and web development are constantly evolving. Every year we see design trends change, coding standards adapt and new frameworks/CMS created. With such a quick pace of change it’s easy to get lost trying to keep up.

See if your editor made the list.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Java performance on Solaris - Managing CPUs There are various resource controls in operating system which directly/indirectly influence the performance of application. one of the most important resource controls is "CPU".   In a multithreaded…
Linux users are sometimes dumbfounded by the severe lack of documentation on a topic. Sometimes, the documentation is copious, but other times, you end up with some obscure "it varies depending on your distribution" over and over when searching for …
Learn how to find files with the shell using the find and locate commands. Use locate to find a needle in a haystack.: With locate, check if the file still exists.: Use find to get the actual location of the file.:
In a previous video, we went over how to export a DynamoDB table into Amazon S3.  In this video, we show how to load the export from S3 into a DynamoDB table.
Suggested Courses

635 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question