Last active
June 8, 2020 07:03
-
-
Save mamedshahmaliyev/1e1d6090702a051502a2dd0bac2ac965 to your computer and use it in GitHub Desktop.
extend linux disk volume size in virtual machina
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
reboot # if no free sector error occurs | |
fdisk -l | |
fdisk /dev/sda | |
# type n -> p -> 3 | |
# type t -> 3 -> 8e | |
# type w | |
reboot | |
pvcreate /dev/sda3 | |
vgdisplay | |
vg_name='centos' | |
vgextend $vg_name /dev/sda3 | |
# vgextend `vgdisplay | awk '{print $3}' | sed -n 2p` /dev/sda3 | |
lvdisplay | |
lv_root_path='/dev/centos/root' | |
lvextend $lv_root_path /dev/sda3 | |
resize2fs $lv_root_path | |
xfs_growfs $lv_root_path # if resize2fs fails | |
df -h |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment