Created
November 24, 2018 21:10
-
-
Save janschumann/f171ce9aae86e8ac189a2abb49ccb3f1 to your computer and use it in GitHub Desktop.
LVM commands
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# create physical volume | |
pvcreate /dev/<volume_name> | |
# create volume group | |
vgcreate <group_name> /dev/<volume_name> | |
# create volume | |
lvcreate -L <size>G -n <volume_name> <group_name> | |
# create fs | |
mkfs.<type> <vol_path> | |
# example mongodb | |
pvcreate /dev/xvdb /dev/xvdc | |
vgcreate mongodb-data /dev/xvdb | |
vgcreate mongodb-logs /dev/xvdc | |
lvcreate -L 40G -n data mongodb-data | |
lvcreate -L 8G -n logs mongodb-logs | |
mkfs.xfs /dev/mongodb-data/data | |
mkfs.ext4 /dev/mongodb-logs/logs | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment