Skip to content

Instantly share code, notes, and snippets.

@briancline
Last active September 16, 2020 13:42

Revisions

  1. briancline renamed this gist Jan 18, 2014. 1 changed file with 0 additions and 0 deletions.
    File renamed without changes.
  2. briancline created this gist Jan 18, 2014.
    53 changes: 53 additions & 0 deletions ceph-grow-rbd-xfs.sh
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,53 @@
    # df -h /dev/rbd0
    Filesystem Size Used Avail Use% Mounted on
    /dev/rbd0 1.5T 1.5T 557M 100% /mnt/media

    # rbd info media/media01
    rbd image 'media01':
    size 1536 GB in 393216 objects
    order 22 (4096 kB objects)
    block_name_prefix: rb.0.1098.74b0dc51
    format: 1



    # rbd resize media/media01 --size 4194304

    # rbd info media/media01
    rbd image 'media01':
    size 4096 GB in 1048576 objects
    order 22 (4096 kB objects)
    block_name_prefix: rb.0.1098.74b0dc51
    format: 1



    # umount -l /mnt/media01
    # rbd unmap /dev/rbd0
    # rbd map media/media01
    # mount -o nouuid /dev/rbd/media/media01 /mnt/media

    # xfs_growfs /mnt/media -d
    meta-data=/dev/rbd3 isize=256 agcount=33, agsize=12581888 blks
    = sectsz=512 attr=2
    data = bsize=4096 blocks=402653184, imaxpct=5
    = sunit=1024 swidth=1024 blks
    naming =version 2 bsize=4096 ascii-ci=0
    log =internal bsize=4096 blocks=196608, version=2
    = sectsz=512 sunit=8 blks, lazy-count=1
    realtime =none extsz=4096 blocks=0, rtextents=0
    data blocks changed from 402653184 to 1073741824

    # df -h /dev/rbd0
    Filesystem Size Used Avail Use% Mounted on
    /dev/rbd3 4.0T 1.5T 2.6T 38% /mnt/media



    # umount /mnt/media
    # xfs_admin -U generate /dev/rbd3
    Clearing log and setting UUID
    writing all SBs
    new UUID = 3c2275d5-2527-49c8-8adc-3fee074e51d1

    # mount /mnt/media