zoukankan      html  css  js  c++  java
  • ceph的image扩容

    root@ceph01:/etc/ceph# rbd create --size 1024 test
    root@ceph01:/etc/ceph# 
    root@ceph01:/etc/ceph# 
    root@ceph01:/etc/ceph# rbd ls
    mysql-hzb
    test
    root@ceph01:/etc/ceph# 
    root@ceph01:/etc/ceph# 
    root@ceph01:/etc/ceph# 
    root@ceph01:/etc/ceph# 
    root@ceph01:/etc/ceph# rbd info
    rbd: image name was not specified
    root@ceph01:/etc/ceph# rbd info test
    rbd image 'test':
        size 1024 MB in 256 objects
        order 22 (4096 kB objects)
        block_name_prefix: rbd_data.10ac74b0dc51
        format: 2
        features: layering
        flags: 
    root@ceph01:/etc/ceph# rbd map test
    /dev/rbd0
    root@ceph01:/etc/ceph# 
    root@ceph01:/etc/ceph# 
    root@ceph01:/etc/ceph# 
    root@ceph01:/etc/ceph# mkdir -p /root/testrbd/
    root@ceph01:/etc/ceph# mkfs.xfs -q /dev/rbd0
    root@ceph01:/etc/ceph# 
    root@ceph01:/etc/ceph# 
    root@ceph01:/etc/ceph# 
    root@ceph01:/etc/ceph# 
    root@ceph01:/etc/ceph# rbd showmapped
    id pool image snap device    
    0  rbd  test  -    /dev/rbd0 
    root@ceph01:/etc/ceph# mount /dev/rbd0 /root/testrbd/
    root@ceph01:/etc/ceph# 
    root@ceph01:/etc/ceph# 
    root@ceph01:/etc/ceph# 
    root@ceph01:/etc/ceph# df -h /root/testrbd/
    文件系统        容量  已用  可用 已用% 挂载点
    /dev/rbd0      1014M   33M  982M    4% /root/testrbd
    root@ceph01:/etc/ceph# 
    root@ceph01:/etc/ceph# 
    root@ceph01:/etc/ceph# rbd resize --size 2048 test
    Resizing image: 100% complete...done.
    root@ceph01:/etc/ceph# 
    root@ceph01:/etc/ceph# 
    root@ceph01:/etc/ceph# 
    root@ceph01:/etc/ceph# df -h /root/testrbd/
    文件系统        容量  已用  可用 已用% 挂载点
    /dev/rbd0      1014M   33M  982M    4% /root/testrbd
    root@ceph01:/etc/ceph# rbd map test
    /dev/rbd1
    root@ceph01:/etc/ceph# df -h /root/testrbd/
    文件系统        容量  已用  可用 已用% 挂载点
    /dev/rbd0      1014M   33M  982M    4% /root/testrbd
    root@ceph01:/etc/ceph# 
    root@ceph01:/etc/ceph# 
    root@ceph01:/etc/ceph# 
    root@ceph01:/etc/ceph# 

    由以上可以看出:虽然image已经增大了两倍,但是挂载此image的文件系统/dev/rbd0/的大小并没有变

    要想/dev/rbd0也增大,则要做下面操作,ext4和xfs格式的方法不一样

    1)ext4

     resize2fs /dev/rbd0

    2)xfs

    要在 resize之后执行
    # xfs_growfs /root/testrbd/
  • 相关阅读:
    CSS3 鲜为人知的属性-webkit-tap-highlight-color的理解
    14 个折磨人的 JavaScript 面试题
    JavaScript 开发的45个技巧2
    JavaScript 开发的45个技巧
    JavaScript 中的 this !
    JavaScript里的循环方法:forEach,for-in,for-of
    JS类型判断typeof PK {}.toString.call(obj)
    Object.prototype.toString()
    MinGW gcc 生成动态链接库 dll 的一些问题汇总 (补充)
    Selenium之偷懒教程
  • 原文地址:https://www.cnblogs.com/boshen-hzb/p/6744335.html
Copyright © 2011-2022 走看看