Created
January 3, 2018 15:10
-
-
Save yogeek/0a3504af089f15134cbf77750f0fb79f to your computer and use it in GitHub Desktop.
Disk management
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
# Adapted from <https://superuser.com/questions/332252/creating-and-formating-a-partition-using-a-bash-script> | |
( | |
echo d # Delete sda2 partition table | |
echo 2 # Default = sda2 | |
echo n # Add a new sda2 partition | |
echo p # Primary partition | |
echo 2 # Partition number | |
echo # First sector (Accept default: 2099200) | |
echo # Last sector (Accept default: varies, e.g 104857599) | |
echo t # Tag partition | |
echo 2 # Default = sda2 | |
echo 8e # Type "Linux VM" | |
echo w # Write changes | |
) | sudo fdisk /dev/sda | |
# REBOOT ! | |
pvresize /dev/sda2 | |
lvextend -L +5G /dev/mapper/vg_root-lv_home | |
xfs_growfs /home | |
lvcreate -L 25G -n lv_data vg_root | |
mkfs.xfs /dev/vg_root/lv_data | |
mkdir /data | |
mount -t xfs /dev/vg_root/lv_data /data | |
echo "/dev/mapper/vg_root-lv_data /data xfs defaults 0 0" >> /etc/fstab |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment