How to resize VM's disk with ceph

jjc27017

Member
Dec 14, 2017
40
0
6
36
Hi all, I build up proxmox with 3 nodes as cluster, and also enabled to use ceph for stroe vms and lxc.
And I found that when I add some space into disk with lxc, it can apply and type command "df -h" can show the right space size.
But when I test with vm, I found that it only modify the gui on website and `fdisk -l` show the added space, but not `df -h`, it only show the origin space.

command result as below:
[root@localhost ~]# fdisk -l
Disk /dev/sda: 23.6 GB, 23622320128 bytes
64 heads, 32 sectors/track, 22528 cylinders
Units = cylinders of 2048 * 512 = 1048576 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00090a90
Device Boot Start End Blocks Id System
/dev/sda1 * 2 501 512000 83 Linux
Partition 1 does not end on cylinder boundary.
/dev/sda2 502 4597 4194304 82 Linux swap / Solaris
Partition 2 does not end on cylinder boundary.
/dev/sda3 4598 12288 7875584 8e Linux LVM
Partition 3 does not end on cylinder boundary.
Disk /dev/mapper/vg_root-lv_root: 8061 MB, 8061452288 bytes
255 heads, 63 sectors/track, 980 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00000000

[root@localhost ~]# df -h
Filesystem Size Used Avail Use% Mounted on
/dev/mapper/vg_root-lv_root
7.3G 4.0G 3.0G 58% /
tmpfs 499M 0 499M 0% /dev/shm
/dev/sda1 477M 28M 425M 7% /boot
 
Hi,

with KVM VM you have to resize the partition and fs manually. Only the vdisk will extent.
How to resize the FS depend on your installed FS and Volume-manager.
 
Hi,

with KVM VM you have to resize the partition and fs manually. Only the vdisk will extent.
How to resize the FS depend on your installed FS and Volume-manager.

Hi,
I am new in this area, may you give more instructions about resize and fs?

and also I create a 12GB disk and install CentOS7
but it show 12.9G with command `fdisk -l`
and `df -h` just show 7.5G for /
do you know why it show that?
 
Last edited:
Please send the output of
Code:
lsblk
lvs
 
Please send the output of
Code:
lsblk
lvs



[root@localhost ~]# lsblk
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
sda 8:0 0 14G 0 disk
├─sda1 8:1 0 500M 0 part /boot
├─sda2 8:2 0 4G 0 part [SWAP]
├─sda3 8:3 0 7.5G 0 part
│ └─vg_root-lv_root 253:0 0 7.5G 0 lvm /
└─sda4 8:4 0 2G 0 part
sr0 11:0 1 1024M 0 rom

[root@localhost ~]# lvs
LV VG Attr LSize Pool Origin Data% Meta% Move Log Cpy%Sync Convert
lv_root vg_root -wi-ao---- 7.49g