Applies to:
---------------------------------------------------------------------------------------------------------------------------

Operating System(s) - Oracle Enterprise Linux 4.x, Oracle Enterprise Linux 5.x, RedHat Enterprise Kernel 4.x, RedHat Enterprise Kernel 5.x, Unbreakable Enterprise Kernel for Oracle Linux 5.5 and higher

Storage Platform(s) - Dell EqualLogic PS Series, Dell PowerVault MD Series

Author:
---------------------------------------------------------------------------------------------------------------------------

Naveen Iyengar

Problem:
---------------------------------------------------------------------------------------------------------------------------
How do I align disk partitions for systems running a Linux operating system using the fdisk utility?

Solution:
--------------------------------------------------------------------------------------------------------------------------

 This article uses Linux's native partition utility fdisk to align the partitions on the Volumes/Virtual Disks (VD). The following example indicates the arguments for the fdisk utility.

To use the fdisk utility to adjust a disk partition, do the following steps:

NOTE This article assumes that the disk to be aligned already contains a single primary partition. If that is not the case then create a new single primary partition on the disk before following the steps below.

 

CAUTION In a system running the Linux operating system, align the partition table before data is written to the Volume/Virtual Disk (VD). The partition map is rewritten and all data on the Volume/VD is destroyed.

 At the command prompt, type:

  1.   #> fdisk /dev/<block_device>

    where <block_device> is the name of the block device that you are adjusting. For example, if the block device is /dev/sdb, type: fdisk /dev/sdb

    The system displays the following message:

    The number of cylinders for this disk is set to 8782. There is nothing wrong with that, but this is larger than 1024, and could in certain setups cause problems with:
    1) software that runs at boot time (e.g., old versions of LILO)2)
    booting and partitioning software from other OSs
    (e.g., DOS FDISK, OS/2 FDISK)

        a. Command (m for help): x # To enter the expert Mode
            b.  Expert command (m for help): b # To move beginning of data in a partition
            c.  Partition number (1-4): 1 # The partition number to be aligned
            d.  New beginning of data (128-xxxxx, default 128): 128


    NOTE 128 blocks or 64KB is the default Stripe Element Size of EqualLogic PS Series and PowerVault MD Line of storage arrays. Hence we adjust the beginning of the data partition to 128 blocks.

        e. Expert command (m for help): wq # write and quit
  2. Repeat step 1 for all the disks that need to be aligned

  3. Run the following command to re-scan all the partitions:

    #> partprobe

  4. Verify that the partition has been aligned by running the following command:

    #> fdisk -ul /dev/<block_device>

    where <block_device> is the name of the block device that we aligned the partition of. Below is an example of a sample output of the above command on a block device that has been aligned. If you partition is properly aligned then you will see 128 under the Start column against your partition.

    Disk /dev/mapper/mpath70: 53.6 GB, 53697576960 bytes
    255 heads, 63 sectors/track, 6528 cylinders, total 104878080 sectors
    Units = sectors of 1 * 512 = 512 bytes
    Device Boot      Start         End      Blocks   Id  System

    /dev/mapper/mpath70p1  128   104872319    52436096   83  Linux

  5. If required, reboot the system for the kernel to be able to re-read the new partition table or if you do not see your newly created aligned partition.