Expanding Disks
Expanding Disks & LVM
------------------------------------------------------------------------------------------------------------------------------------------ ====================================================================================
Virtual Server:Disk
Firstly we need to rescan the SCSI hosts:
for i in /sys/class/scsi_host/host*/scan; do echo "- - -" > $i; done
Expanded2. Disk:Check for updated disk size:
lsblk
AdditionalYour Disk:output will look something like this:
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT sda 8:0 0 120G 0 disk ├─sda1 8:1 0 512M 0 part /boot └─sda2 8:2 0 103.5G 0 part ├─eCloud-root 253:0 0 102.5G 0 lvm / └─eCloud-swap 253:1 0 1G 0 lvm [SWAP] sdc 8:32 0 200G 0 disk └─sdc1 8:33 0 200G 0 part sr0 11:0 1 1024M 0 rom
------------------------------------------------------------------------------------------------------------------------------------------ 3. Check partitions using fdisk
fdisk -l
DedicatedOutput Server:will look something like this:
[root@server/dev/sda:~]#Diskfdisk-l
Additional4. Disk:Run growpart against the expanded device:
growpart /dev/sda 2
5. Run pvresize command against the partition:
pvresize /dev/sda2
6. Resize the logical volume, ensure to replace vg and lv with the appropriate values (these will typically be the same as seen on df -h):
lvresize -rl +100%FREE /dev/mapper/vg/lv
7. Check that the space has been applied to the filesystem:
df -h
====================================================================================