There are various complicated ways to expand a Linux volume. Here is an easy one using parted.
First, use command lsblk to show disk volume info, for example:
$ lsblk
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
fd0 2:0 1 4K 0 disk
sda 8:0 0 40G 0 disk
├─sda1 8:1 0 1G 0 part /boot
└─sda2 8:2 0 19G 0 part
├─cl-root 253:0 0 17G 0 lvm /
└─cl-swap 253:1 0 2G 0 lvm [SWAP]
To expand cl-root volume, enter command:
parted ---pretend-input-tty /dev/sda resizepart 2 100%;
partx -u /dev/sda; pvresize /dev/sda2;
lvextend -r /dev/cl/root /dev/sda2
If the command does not work, just update
parted
by
yum update parted
. This works in CentOS 7.
No comments:
Post a Comment