Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

It is assumed that the operating system disk (sda) was already properly configured, and the is named sda, the application/logs disk is named sdb and the data disk is named sdc.

Code Block
# This is an example - make sure to adjust it to your system!
# If LVM is not available on you system you may use 'dnf install lvm2' before executing the commands.
APP_LOGS_DISK="sdb"
DATA_DISK="sdc"

# Creating the app/logs volume group as vg_app along with its logical volumes and file systems
pvcreate -ff /dev/sdb${APP_LOGS_DISK}
vgcreate vg_app /dev/sdb${APP_LOGS_DISK}

lvcreate -L 1G -n lv_shared vg_app
mkfs.xfs -f /dev/vg_app/lv_shared
echo "/dev/vg_app/lv_shared    /shared                   xfs     defaults        0 0" >> /etc/fstab
mkdir -p /shared
mount /shared

lvcreate -L 30G -n lv_app vg_app
mkfs.xfs -f /dev/vg_app/lv_app
echo "/dev/vg_app/lv_app    /app                   xfs     defaults        0 0" >> /etc/fstab
mkdir -p /app
mount /app

lvcreate -L 8G -n lv_app_tmp vg_app
mkfs.xfs -f /dev/vg_app/lv_app_tmp
echo "/dev/vg_app/lv_app_tmp    /app/tmp                   xfs     defaults        0 0" >> /etc/fstab
mkdir -p /app/tmp
mount /app/tmp

lvcreate -L 30G -n lv_installs vg_app
mkfs.xfs -f /dev/vg_app/lv_installs
echo "/dev/vg_app/lv_installs    /installs                   xfs     defaults        0 0" >> /etc/fstab
mkdir -p /installs
mount /installs

lvcreate -L 15G -n lv_logs vg_app
mkfs.xfs -f /dev/vg_app/lv_logs
echo "/dev/vg_app/lv_logs    /logs                   xfs     defaults        0 0" >> /etc/fstab
mkdir -p /logs
mount /logs

# Creating the data volume group as vg_data along with its logical volume and file system
pvcreate -ff /dev/sdc${DATA_DISK}
vgcreate vg_data /dev/sdc${DATA_DISK}

lvcreate -l 100%FREE -n lv_data vg_data
mkfs.xfs -f /dev/vg_data/lv_data
echo "/dev/vg_data/lv_data    /data                   xfs     defaults        0 0" >> /etc/fstab
mkdir -p /data
mount /data

...