Linux – Create file system on multipath volume

filesystemslinuxlvmmultipath

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?

Best Answer

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>