Partition and Format the LUN Disk (Optional)

Follow these instructions if you plan to use the Linux fdisk or parted utilities to partition and format the disk on which a LUN resides.

The fdisk utility cannot be used with devices listed in the /dev/mapper directory. Instead, use fdisk on one of the underlying paths, and then run the scripts to restart the multipath-tools and FSPM daemons to notify device-mapper that a /dev/mapper device has a new partition.
  1. Identify one of the highest priority paths to the LUN using the output of the multipath -ll command as shown: multipath —ll /dev/mapper/2000b08008e00135
    Example: In the output below, you could identify either the /⁠dev/⁠sdd path or the /⁠dev/sdt path such as 4:0:1:1 sdd... or 5:0:1:1 sdt....
    2000b08008e001305 dm-0 Oracle,FS1-2
    size=50G features='1 queue_if_no_path' hwhandler='0' wp=rw
    |-+- policy='round-robin 0' prio=4000000 status=active
    | |- 4:0:1:1 sdd 8:48  active ready running
    | `- 5:0:1:1 sdt 65:48 active ready running
    |-+- policy='round-robin 0' prio=3000000 status=enabled
    | |- 8:0:0:1 sdj 8:144 active ready running
    | `- 6:0:0:1 sdk 8:160 active ready running
    |-+- policy='round-robin 0' prio=2000000 status=enabled
    | |- 4:0:0:1 sdb 8:16  active ready running
    | `- 5:0:0:1 sdf 8:80  active ready running
    `-+- policy='round-robin 0' prio=1000000 status=enabled
      |- 9:0:0:1 sdl 8:176 active ready running
      `- 7:0:0:1 sdp 8:240 active ready running
    
    Note: The output displayed depends upon the SAN configuration and the version of Multipath tools. Choose a path from the group which has the largest prio value. In the above example, the highest prio value is prio-4000000 which Oracle recommends you choose.
  2. Use fdisk to partition one of the highest priority paths identified in Step 1.
  3. Create the device files and links to access the new partitions. The best way to do this depends on the operating system, see the operating system’s multipath disk administration documentation. On some operating system, this is completed by triggering the udev mechanism to inform it that partitions have been added.
    For example: # echo add > /sys/block/dm-0/uevent with dm-0 replaced by the dm name listed in the first step. Udev is used to create set of rules to create any necessary files. On other operating systems, you may need to use the kpartx command manually as shown here:

    # kpartx -a /dev/mapper/2000b08008e001305.

  4. Run one of the the following commands to restart the Multipath Daemon:
    # service multipathd restart

    or

    # /etc/init.d/multipathd restart
  5. Verify that devices were created for the new partitions .Partition device files in/dev/mapper consist of the disk name followed by a delimiter followed by the partition number. The delimiter is usually p' or part, so partition devices are usually named

    For Linux versions:

    /dev/mapper/LUNpx
    /dev/mapper/LUN_partx

    Example: In the example above, if only partition 1 were created with fdisk, it could appear as follows:
    localhost$ ls -l /dev/mapper/2000b08008e001305*
    brw-rw----  1 root disk 253,  2 Jul  7 12:02 2000b08008e001305
    brw-rw----  1 root disk 253,  3 Jul  7 15:12 2000b08008e001305p1
    
  6. Format the new partition.
    Example: To format the partition created in the example above, you might run the following command:
    # mke2fs -j /dev/mapper/2000b08008e001305p1
  7. Mount the filesystem.
For detailed information, refer to your Linux documentation.