How to solve misalignment lun netapp on linux servers by Ivan

3
Creating disk alignment on Linux Servers using Netapp Luns (iscsi or FC/FCOE) I decided to create this report, because i have found that many customers facing this problem that the principle is not critical, but as the storage grows it can become a major performance problem. Follow below the tasks to be executed: - Install the correct host utilities version on Linux server - Install the correct snapdriver version on Linux server - Configure correct parameters on the file configuration of the multipath software (/etc/multipath.conf) - Create lun selecting type Linux,because if you don´t select correct operation system Type the lun will be misalignment on the Storage - Create the initiator group selecting the correct operation system (In this case Linux) and don´t forget to enable ALUA if you are using multiple paths. - After alocate the lun and recognize on the server do the follow: #fdisk /dev/mapper/"disk" Create the primary partition and after create, enter on the expert mode typing X on the follow fdisk options" Command (m for help):X " You will see the follow below when entry on the expert mode: Enter expert mode in fdisk and change the starting LBA of the partition to a value that is evenly divisible by eight. In the following example, the default starting sector is 63 and it is changed to 64 because 64 is evenly divisible by eight. The default starting sector chosen by fdisk is based on the size of the LUN. The LUN size is used by fdisk to calculate a pseudo geometry which can vary between different versions of fdisk. Command (m for help): x Expert command (m for help): b Partition number (1-4): 1 New beginning of data (63-62926604, default 63): 64 Expert command (m for help): p Disk /dev/mapper/”disk” : 255 heads, 63 sectors, 3917 cylinders Nr AF Hd Sec Cyl Hd Sec Cyl Start Size ID 1 00 1 1 0 254 63 1023 64 62926541 83 2 00 0 0 0 0 0 0 0 0 00 3 00 0 0 0 0 0 0 0 0 00 4 00 0 0 0 0 0 0 0 0 00 (Fdisk may print a warning similar to the following as a result of the new offset, this warning may be ignored.) Partition 1 has different physical/logical beginnings (non-Linux?): phys=(0, 1, 1) logical=(0, 1, 2)

Transcript of How to solve misalignment lun netapp on linux servers by Ivan

Page 1: How to solve misalignment lun netapp on linux servers by Ivan

Creating disk alignment on Linux Servers using Netapp Luns (iscsi or FC/FCOE)

I decided to create this report, because i have found that many customers facing this

problem that the principle is not critical, but as the storage grows it can become a

major performance problem.

Follow below the tasks to be executed:

- Install the correct host utilities version on Linux server

- Install the correct snapdriver version on Linux server

- Configure correct parameters on the file configuration of the multipath software

(/etc/multipath.conf)

- Create lun selecting type Linux,because if you don´t select correct operation system Type the

lun will be misalignment on the Storage

- Create the initiator group selecting the correct operation system (In this case Linux) and don´t

forget to enable ALUA if you are using multiple paths.

- After alocate the lun and recognize on the server do the follow:

#fdisk /dev/mapper/"disk"

Create the primary partition and after create, enter on the expert mode typing X on the

follow fdisk options" Command (m for help):X "

You will see the follow below when entry on the expert mode:

Enter expert mode in fdisk and change the starting LBA of the partition to a value that is evenly

divisible by eight. In the following example, the default starting sector is 63 and it is changed to

64 because 64 is evenly divisible by eight. The default starting sector chosen by fdisk is based

on the size of the LUN. The LUN size is used by fdisk to calculate a pseudo geometry which can

vary between different versions of fdisk.

Command (m for help): x

Expert command (m for help): b

Partition number (1-4): 1

New beginning of data (63-62926604, default 63): 64

Expert command (m for help): p

Disk /dev/mapper/”disk”: 255 heads, 63 sectors, 3917 cylinders

Nr AF Hd Sec Cyl Hd Sec Cyl Start Size ID

1 00 1 1 0 254 63 1023 64 62926541 83

2 00 0 0 0 0 0 0 0 0 00

3 00 0 0 0 0 0 0 0 0 00

4 00 0 0 0 0 0 0 0 0 00

(Fdisk may print a warning similar to the following as a result of the new offset, this

warning may be ignored.)

Partition 1 has different physical/logical beginnings (non-Linux?):

phys=(0, 1, 1) logical=(0, 1, 2)

Page 2: How to solve misalignment lun netapp on linux servers by Ivan

Write the partition table and create the new device files for the partition. The kpartx

command is used to create the device node for the new partition automatically.

Don´t forget to execute kpartx -a to create the device node for the new partition automatically.

#kpartx -a /dev/"disk"

Optionally, create a file system or LVM physical volume using the partition. File systems should

be configured to use a 4kB block or a larger block size that is a multiple of 4kB.

# mkfs.ext3 -b 4096 /dev/mapper/"disk"

mke2fs 1.39 (29-May-2006)

Filesystem label=

OS type: Linux

Block size=4096 (log=2)

Fragment size=4096 (log=2)

3933120 inodes, 7865817 blocks

393290 blocks (5.00%) reserved for the super user

First data block=0

Maximum filesystem blocks=0

241 block groups

32768 blocks per group, 32768 fragments per group

16320 inodes per group

Superblock backups stored on blocks:

32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632, 2654208,

4096000

Writing inode tables: done

Creating journal (32768 blocks): done

Writing superblocks and filesystem accounting information: done

To see on the storage if the lun created are alignment do the follow:

Netatpp# priv set diag

Netapp# lun alignment show

The command above will show 5 lines of the information like follow :

/vol/vol_name/lun_name

Multiprotocol type: linux

Alignment: partial-writes

Write alignment histogram percentage: 0, 0, 0, 0, 0, 0, 0, 14

Read alignment histogram percentage: 0, 0, 0, 0, 0, 0, 0, 2

Partial writes percentage: 85

Partial reads percentage: 97

On the information above you must analyse the third and the fourth line "Write aligment

histogram percentage" and "Read alignment histogram percentage" that have 8 bits of the

information.

Page 3: How to solve misalignment lun netapp on linux servers by Ivan

The lun will be alignment if you have only percentage of the Read and Write on the first bit, like

we can see below:

/vol/vol_name/lun_name

Multiprotocol type: linux

Alignment: indeterminate

Write alignment histogram percentage: 92, 0, 0, 0, 0, 0, 0, 0

Read alignment histogram percentage: 13, 0, 0, 0, 0, 0, 0, 0

Partial writes percentage: 5

Partial reads percentage: 86

After you have 99% of the read or write on the any bit, the information of the Alignment will

show "aligned like follow :

/vol/vol_name/lun_name

Multiprotocol type: linux

Alignment: aligned

Write alignment histogram percentage: 99, 0, 0, 0, 0, 0, 0, 0

Read alignment histogram percentage: 76, 0, 0, 0, 0, 0, 0, 0

Partial writes percentage: 0

Partial reads percentage: 23

Don´t forget to reset the counters on the Netapp Storage to get the true analysis

Netapp# lun stats -z

I hope to help all people that have problem with misalignment Linux lun on the Netapp

Storages...

Best regard to all and enjoy the information

Ivan J.B.Silva