Oracle Linux 6.6
To create Physical Volumes for Volume groups (LVM) , the disk need to be partitioned to LVM type ie. 'Linux LVM' type . In fdisk , this can done by choosing 8e when prompted for partition type.
Since it is easy to script (non-interactive), I use parted command rather than fdisk to create partitions
For creating standard partitions, I use the below 2 non-interactive steps in our scripts
Step1. Creating the partition table for the device
parted -s /dev/sda mklabel msdos
For gpt, I use
parted -s /dev/sda mklabel gpt
Step2. create a primary partition that starts after 1mb (to ensure proper alignement)
parted -s /dev/sda unit mib mkpart primary 1 100%
From the below link , I gathered that partition can be set to LVM type interactively using
set [partition number] lvm on
http://computernetworkingnotes.com/p...-in-linux.html
But, how can I incorporate this into step2 (non-interactive) shown above ?
How to create LVM Partition in Linux