lv on specific pv

Logical volumes ( lvm ) are very convenient feature for managing storage space on linux/unix systems. We all know that creating logical volume can be roughly described in next three steps. Let say we have physical disks /dev/sda and /dev/sdb

create physical volumes:

# pvcreate /dev/sda

  1. pvcreate /dev/sdb

create volume group:

# vgcreate myvg /dev/sda /dev/sdb

Next step is to create logical volume on top of newly created logical volume. If we run next

# lvcreate -L 100M -n mylv /dev/myvg

logical volume mylv will be created on from volume group myvg, on so called next free basis — what means it will start logical volume first on /dev/sda filling up space we specified in lvcreate command.

Sometimes we would like to lock down logical volume to be created on specified physical volume, to do that we can run

# lvcreate -L 100 -n mylv /dev/myvg /dev/sda

In last command, we are instructing lvcreate to create logical volume on top of myvg and placing it on physical volume /dev/sda

Running

# lvs -a -o +devices

you can see was above process sucessful. It should show that mylv is scattered over desired pv

Advertisements

#lvm-lvcreate-pvcreate-storage