###ceph的rbd是可以进行调节大小的,但是调节需要进行一些操作,否则你看不到调节之后的效果,等于没调节,因为rbd就相当一块硬盘,但是文件系统一经初始化,分派的总容量大小、块大小 inode数量就定了,再去调节,势必要对sb分区进行重新才可以。 ###当然调节的方法要看具体的文件系统才能判断使用相应的工具
# rbd create --size 10000 test
# rbd map test
# mkfs.ext4 -q /dev/rbd1
# mount /dev/rbd1 /mnt
# df -h /mnt
Filesystem Size Used Avail Use% Mounted on
/dev/rbd1 9.5G 22M 9.0G 1% /mnt
# blockdev --getsize64 /dev/rbd1
10485760000
# rbd resize --size 20000 test
Resizing image: 100% complete...done.
# blockdev --getsize64 /dev/rbd1
20971520000
# resize2fs /dev/rbd1
resize2fs 1.42 (29-Nov-2011)
Filesystem at /dev/rbd1 is mounted on /mnt; on-line resizing required
old_desc_blocks = 1, new_desc_blocks = 2
The filesystem on /dev/rbd1 is now 5120000 blocks long.
# df -h /mnt
Filesystem Size Used Avail Use% Mounted on
/dev/rbd1 20G 27M 19G 1% /mnt
$ qemu-img info -f rbd "rbd:rbd/myrbd"
$ qemu-img resize -f rbd "rbd:rbd/myrbd" 600G
$ virsh domblklist myVM
$ virsh blockresize --domain myVM --path vdb --size 600G
$ rbd info rbd/myrb
$ xfs_growfs /mnt/rbd/myrbd