v2-95c02e39c88052dc31158af10ac91a4c.jpg
#创建一个大小为 1024M 的 ceph image

[root@node01 ~]# rbd create foo --size 1024
[root@node01 ~]# rbd list
foo

#临时关闭内核不支持的特性

[root@node01 ~]# rbd feature disable foo exclusive-lock, object-map, fast-diff, deep-flatten
2019-01-27 02:45:07.963903 7f8986011d80 -1 librbd: one or more requested features are already disabled
rbd: failed to update image features: (22) Invalid argument
[root@node01 ~]# rbd info foo
rbd image 'foo':
    size 1024 MB in 256 objects
    order 22 (4096 kB objects)
    block_name_prefix: rbd_data.373a6b8b4567
    format: 2
    features: layering
    flags:

#把 foo image 映射到内核

[root@node01 ~]# rbd map foo
/dev/rbd0
[root@node01 ~]# rbd showmapped
id pool image snap device
0  rbd  foo   -    /dev/rbd0

#将 foo image 格式化为 ext4 格式的文件系统

mkfs.ext4 -m0 /dev/rbd0

发表评论

您的电子邮箱地址不会被公开。 必填项已用*标注

Captcha Code