3 Replies Latest reply on Jun 24, 2014 2:27 AM by Akbar Aziz

    RHEL LVM creation

    Raja Mohan

      I want to be able to discover available disks within a provisioned RHEL server, I am thinking of a post provisioning batch job with a NSH script to discover all available disks, exclude the active boot disk, parse through each one of the available disks and then

      1. pvcreate
      2. pvdisplay (validation)
      3. vgcreate
      4. vgdisplay (validation)
      5. vgscan
      6. lvcreate
      7. lvdisplay (validation)
      8. lvscan
      9. mkfs
      10. mount
      11. df -h (validation)
      12. cp fstab to fstab.old
      13. update fstab for new mount
      14. mount to display all the mount (validation)


      Just wondering if there is any other nifty way within BSA (live browse or other methods) to perform this. Any insight is appreciated.

        • 1. Re: RHEL LVM creation
          Akbar Aziz

          Are you trying to create the lvm after the initial provisioning is done? Why not just put it as part of the kickstart configuration when provisioning the server via BSA?

          • 2. Re: RHEL LVM creation
            Raja Mohan

            Atleast one thought is I would like to ensure during provisioning It is using the drive I intend to be the boot partition. So want to leave the data disk not created and create it during post provisioning.

            • 3. Re: RHEL LVM creation
              Akbar Aziz

              You could add this flag:


              bootloader --location=mbr --driveorder=sda


              Here is an example of a LVM using kickstart in my environment:

              bootloader --location=mbr --driveorder=sda


              clearpart --all --drives=sda

              part /boot --fstype ext4 --size=256 --ondisk=sda

              part pv.01 --size=32768 --grow --ondisk=sda

              volgroup VolGroup00 pv.01

              logvol / --fstype ext4 --name=root-lv --vgname=VolGroup00 --size=4098

              logvol swap --fstype swap --name=swap-lv --vgname=VolGroup00 --size=4098

              logvol /usr --fstype ext4 --name=usr-lv --vgname=VolGroup00 --size=4098

              logvol /tmp --fstype ext4 --name=tmp-lv --vgname=VolGroup00 --size=4098

              logvol /var --fstype ext4 --name=var-lv --vgname=VolGroup00 --size=4098

              logvol /opt --fstype ext4 --name=opt-lv --vgname=VolGroup00 --size=4098