This discussion is archived
8 Replies Latest reply: Oct 25, 2013 5:01 AM by Actitud RSS

Linux multipath device how to partition?

MR.L Newbie
Currently Being Moderated

Linux multipath device how to partition?

Which command can realize the partition?

fdisk, kpartx and parted Which command correctly?

  • 1. Re: Linux multipath device how to partition?
    Dude! Guru
    Currently Being Moderated

    Multipath is not used to partition devices, but to manage access paths to storage devices, usually for redundancy purpose. To manage physical partitions you can use the parted or fdisk command. Other tools that may be required to manage the size of disk volumes belong to Linux LVM. A forum cannot teach you the basics of Linux device administration. The subject is very complex. You will need to read documentation or ask more specific questions.

  • 2. Re: Linux multipath device how to partition?
    Actitud Newbie
    Currently Being Moderated

    Hello.

    I usually use the command "parted". Here is an example of what I do. You have to run it as ROOT of course.

    Example drive: /dev/mapper/mpath_drive

     

    Steps:

    1. run command with the full path for the drive
    2. print what you have, just to make sure it's not being used
    3. IF there is not a label created, you will receive a warning telling that. Then, ceate the label for the drive making sure you are NOT using the drive or you will loose everything!
    4. print what you have
    5. Change the units to what's more suitable for you (maybe Megabytes)
    6. Print the partition table once again to see the space you have available
    7. create the partitions one by one, making sure you don't overlap them
    8. print once you finish the partitions definition
    9. quit
    10. Add (if you need/want to) the partitions into /etc/fstab

     

    1. bash>parted /dev/mapper/mpath_drive
    2. (parted)print
    3. (parted)mklabel gpt #MAKE SURE THE DISK IS NOT BEING USED OR YOU WILL REMOVE ALL THE DATA
    4. (parted)print
    5. (parted)unit Mb
    6. (parted)print

              Model: Linux device-mapper (multipath) (dm)

              Disk /dev/mapper/asm_data1: 2199023MB

              Sector size (logical/physical): 512B/512B

              Partition Table: gpt

              Number  Start   End     Size   File system  Name     Flags    

     

         7. (parted)mkpart primary ext2 INIT_MB END_MB  #YOU WILL SET THOSE VALUES BASED ON THE AMOUNT OF SPACE YOU HAVE    

         8. (parted)print #In this example, I have created four 500gb partitions with a 2tb drive for ASM.

              Model: Linux device-mapper (multipath) (dm)

              Disk /dev/mapper/mpath_drive: 2199023MB

              Sector size (logical/physical): 512B/512B

              Partition Table: gpt

              Number  Start      End        Size      File system  Name     Flags

               1      1.00MB     549757MB   549756MB               primary

               2      549758MB   1099515MB  549757MB               primary

               3      1099516MB  1649272MB  549756MB               primary

               4      1649273MB  2199023MB  549750MB               primary

         9. (quit)

     

    In the top of that, IF you want to be more clean, you can edit the file  /etc/multipath.conf to add pretty names to the drives. I do that to maintain control over the disks in ASM so I know what is what basically.

     

    Hope it helps.

    Thanks,

    Alex.

  • 3. Re: Linux multipath device how to partition?
    MR.L Newbie
    Currently Being Moderated


    thanks!!!

  • 4. Re: Linux multipath device how to partition?
    Actitud Newbie
    Currently Being Moderated

    Besides this is NOT a Linux forum (as Dude clearly stated), I faced this some years ago and I use it all the times for ASM.

    Let me know if you need more explanations to make sure your question is answered.

    Thanks,

    Alex.

  • 5. Re: Linux multipath device how to partition?
    Dude! Guru
    Currently Being Moderated

    Sorry, I'm a bit confused about your reply, because I did not say this was not a Linux forum. It's just that device installation and management are far to complex to explain in general, unless you want to write a book. Some people come here apparently not knowing or understanding yet the complexity of an answer that was required to answer their questions or topics.

  • 6. Re: Linux multipath device how to partition?
    Actitud Newbie
    Currently Being Moderated

    You are right Dude. You didn't said that but I felt that just mentioning the command name was not enough for him..

    I didn't get into the multipath configuration details but I offered him my help in case he needed it.

    Thanks,

    Alex.

  • 7. Re: Linux multipath device how to partition?
    BillyVerreynne Oracle ACE
    Currently Being Moderated

    MR.L wrote:

     

    Linux multipath device how to partition?

    Which command can realize the partition?

    fdisk, kpartx and parted Which command correctly?

    fdisk works fine - have used it a number of times on mpath devices. Keep in mind that you still will have a single config (in /etc/multipath.conf) for that device.

     

    A partition change to a mpath device used by multiple servers (shared storage), will not be seen by other servers using that device. Best is to flush multipath on those servers, and reload - or simply reboot (in the odd case a fabric layer reset on that server could be needed).

  • 8. Re: Linux multipath device how to partition?
    Actitud Newbie
    Currently Being Moderated

    While rebooting could be a great way to check everything is properly configured before starting the CRS installation (is that's your intention), I usually do it using the following method.

    This will allow you to see the recently created partitions from any of the nodes (by refreshing the partitions information and recreating the DMs).

     

    partprobe /dev/mpath_device

    kpartx -d /dev/mpath_device

    kpartx -a /dev/mpath_device

     

    Now, If you want to confirm the procedure finished succesfully, run:


    "dmsetup ls| grep mpath_device"


    For each "mpath_deviceXpY (z, N)" there has to be an associated dm-N which you can see by running:


    ls -ls /dev/ | grep dm

     

    and then compare the dm-N with the N from the first command.

     

    Thanks,

    Alex.

Legend

  • Correct Answers - 10 points
  • Helpful Answers - 5 points