Got it

Optimizing Block Device Parameter Settings of Linux - I/O Alignment

155 0 0 0 0

Block devices are important to host performance. Correct configuration of the block device queue depth, scheduling algorithm, prefetch amount, and I/O alignment improves system performance.


I/O Alignment

If MBR partitions are created in Linux or Windows (pre Windows Server 2003 versions), the first 63 sectors of a disk are reserved for the master boot record and partition table. The first partition starts from the 64th sector by default. As a result, misalignment occurs between data blocks (database or file system) delivered by hosts and data blocks stored in the storage array, causing poor I/O processing efficiency.

In Linux, you can resolve I/O misalignment in either of the following ways:

l   Method 1: Change the start location of a partition.

When creating MBR partitions in Linux, it is recommended that you enter the expert mode of the fdisk command and set the start location of the first partition to that of the second extent on a LUN. The default extent size is 4 MB. The following is a quick command used to create an MBR partition in /dev/sdb. The partition uses all space of /dev/sdb. The start sector is set to 8192, namely, 4 MB.

printf "n\np\n1\n\n\nx\nb\n1\n 8192\nw\n" | fdisk /dev/sdb

l   Method 2: Create GPT partitions.

The following is a quick command used to create a GPT partition in /dev/sdb. The partition uses all space of /dev/sdb. The start sector is set to 8192, namely, 4 MB.

parted -s -- /dev/sdb "mklabel gpt" "unit s" "mkpart primary 8192 -1" "print"

To create MBR partitions in Windows (pre Windows Server 2003 versions), it is recommended that you run diskpart to set partition alignment.

diskpart> select disk 1

diskpart> create partition primary


Comment

You need to log in to comment to the post Login | Register
Comment

Notice: To protect the legitimate rights and interests of you, the community, and third parties, do not release content that may bring legal risks to all parties, including but are not limited to the following:
  • Politically sensitive content
  • Content concerning pornography, gambling, and drug abuse
  • Content that may disclose or infringe upon others ' commercial secrets, intellectual properties, including trade marks, copyrights, and patents, and personal privacy
Do not share your account and password with others. All operations performed using your account will be regarded as your own actions and all consequences arising therefrom will be borne by you. For details, see " User Agreement."

My Followers

Login and enjoy all the member benefits

Login

Block
Are you sure to block this user?
Users on your blacklist cannot comment on your post,cannot mention you, cannot send you private messages.
Reminder
Please bind your phone number to obtain invitation bonus.