Skip to content

Instantly share code, notes, and snippets.

@vermashi
Last active August 28, 2018 20:19
Show Gist options
  • Save vermashi/1b2381b3cc87af9d402e4a3d33ab419d to your computer and use it in GitHub Desktop.
Save vermashi/1b2381b3cc87af9d402e4a3d33ab419d to your computer and use it in GitHub Desktop.
Format the data disks with LVM in an azure linux VM
#!/usr/bin/env bash
set -x
pvcreate -f /dev/disk/azure/scsi1/lun1
vgcreate vg0 /dev/disk/azure/scsi1/lun1
lvcreate -l100%FREE -n lv0 vg0
echo "y" | mkfs.ext4 /dev/mapper/vg0-lv0
mkdir /data1
echo "/dev/mapper/vg0-lv0 /data1 ext4 defaults,nofail 0 0" >>/etc/fstab
mount -a
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment