1

I'm completely new to linux admin and file system. Recently we acquired an HP MSA P2000 san. I've setup the disk into a vdisk and created 3 volumes on it. On Centos 7, I've also setup the multipath mapper and have those volumes mapped into /dev/mapper/mpatha, mpathb and mpathc.

I saw on a couple of web site that they do the following: (whichever is the underlying disk of e.g. mpatha)

 # fdisk /dev/sdd
 # kpartx -a /dev/mapper/mpatha
 # mkfs.ext3 /dev/mapper/mpathap1

to format the disk. Redhat DM multipath document recommend

 # pvcreate /dev/mapper/mpatha

to create an LVM volume.

My question is

  1. For the former, when the volume is expanded later, do I need to backup and fdisk, mkfs the entire /dev/sdd again?
  2. For the latter, it seems like vdisk and volume creation is already managed by the HP P2000 disk management tool, it seems I don't really need to further create partitions/volumes on top of it. Should I probably not LVM here, no?
  3. What's the right thing to do? do I really need to 'format' and initialize a further partition?
1

1. For the former, when the volume is expanded later, do I need to backup and fdisk, mkfs the entire /dev/sdd again?

You don't

pvcreate /dev/mapper/mpatha

But instead

pvcreate /dev/mapper/mpatha1

Then when you expand your disk, you do a fdisk to create a new partition and you do a>

pvcreate /dev/mapper/mpatha2
vgextend VOLGROUPNAME /dev/mapper/mpatha2

2.For the latter, it seems like vdisk and volume creation is already managed by the HP P2000 disk management tool, it seems I don't really need to further create partitions/volumes on top of it. Should I probably not LVM here, no?

Believe me, you want to. Managing disk spaces with pvs vgs and lvms is really neat and easy

3.What's the right thing to do? do I really need to 'format' and initialize a further partition?

pvcreate /dev/bla
vgcreate vgname /dev/bla
lvcreate -n lv_name -L 1G vgname
mkfs.ext4 /dev/mapper/<vgname>-<lvname>

When you want to get more space:

lvextend -L +1G  /dev/mapper/<vgname>-<lvname>
resize2fs  /dev/mapper/<vgname>-<lvname>
  • thanks. Could you point more information why I need to do 'pvcreate' on path /dev/mapper/mpatha1 instead of /dev/mapper/mpatha? I see some other site mentioned /dev/mapper/mpathap1 after kpartx -a .. – surfcode Jul 17 '15 at 3:26
  • pvcreate /dev/mapper/patha seems to work fine. The rest seems to work great as well. Thank you! – surfcode Jul 17 '15 at 10:13
  • As i said before. When you whant to grow up your LUN its easer to add another partition and another PV without messing with your first partition. Otherwise you will be resizing the partition and using pvresize. I'm glad everything worked for you. – FarDarkMist Jul 17 '15 at 14:52
  • 1
    Nah, don't even partition it. That's just a needless layer of complexity. If you expand a PV, you can run pvresize /dev/mapper/mpatha to re-detect volume size and then automatically expand. – Spooler Apr 4 '17 at 0:41

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.