这篇文章给大家分享的是有关ceph中如何测试rbd snap的内容。小编觉得挺实用的,因此分享给大家做个参考,一起跟随小编过来看看吧。
测试rbd snap
创建并挂载rbd1:
[root@mon0 ceph]# rbd create myrbd/rbd1 -s 1024 --image-format=2[root@mon0 ceph]# rbd map myrbd/rbd1[root@mon0 ceph]# rbd showmappedid pool image snap device 0 test test.img - /dev/rbd0 1 myrbd rbd1 - /dev/rbd1 [root@mon0 ceph]# mkfs.xfs /dev/rbd1log stripe unit (4194304 bytes) is too large (maximum is 256KiB)log stripe unit adjusted to 32KiBmeta-data=/dev/rbd1 isize=256 agcount=9, agsize=31744 blks = sectsz=512 attr=2, projid32bit=0data = bsize=4096 blocks=262144, imaxpct=25 = sunit=1024 swidth=1024 blksnaming =version 2 bsize=4096 ascii-ci=0log =internal log bsize=4096 blocks=2560, version=2 = sectsz=512 sunit=8 blks, lazy-count=1realtime =none extsz=4096 blocks=0, rtextents=0[root@mon0 ceph]# blkid|grep rbd1/dev/rbd1: UUID="643b509f-406b-411b-b3a5-fa220fbdfe47" TYPE="xfs" [root@mon0 ceph]# mount /dev/rbd1 /mnt[root@mon0 ceph]# mount | grep rbd1/dev/rbd1 on /mnt type xfs (rw)
创建snap并回滚:
[root@mon0 ceph]# rbd snap ls myrbd/rbd1SNAPID NAME SIZE 2 snap1 1024 MB [root@mon0 ceph]# rbd snap rollback myrbd/rbd1@snap1Rolling back to snapshot: 100% complete...done.[root@mon0 ceph]# ls /mntv2[root@mon0 ceph]# umount /mnt[root@mon0 ceph]# mount /dev/rbd1 /mnt[root@mon0 ceph]# ls /mntv1
通过快照挂载:
[root@mon0 ceph]# rbd map myrbd/rbd1@snap1[root@mon0 ceph]# rbd showmappedid pool image snap device 0 test test.img - /dev/rbd0 1 myrbd rbd1 - /dev/rbd1 2 myrbd rbd1 snap1 /dev/rbd2 [root@mon0 ceph]# mount -t xfs -o ro,norecovery,nouuid /dev/rbd2 /tmp[root@mon0 ceph]# ls /tmpv1
感谢各位的阅读!关于“ceph中如何测试rbd snap”这篇文章就分享到这里了,希望以上内容可以对大家有一定的帮助,让大家可以学到更多知识,如果觉得文章不错,可以把它分享出去让更多的人看到吧!