当我们使用krbd 的时候,第一件事就是rbd map,这个命令的目的是将一个rbd image 挂载到linux 成为一个block 设备。
比如:
[root@atest-guest build]# rbd ls
test
[root@atest-guest build]# rbd info test
rbd image 'test':
size 1 GiB in 256 objects
order 22 (4 MiB objects)
snapshot_count: 0
id: 1726c754beda9
block_name_prefix: rbd_data.1726c754beda9
format: 2
features: layering, exclusive-lock, object-map, fast-diff, deep-flatten, journaling
op_features:
flags:
create_timestamp: Thu Jul 25 10:15:15 2019
access_timestamp: Thu Jul 25 10:15:15 2019
modify_timestamp: Thu Jul 25 10:15:15 2019
journal: 1726c754beda9
mirroring state: disabled
[root@atest-guest build]# rbd map test
/dev/rbd0
[root@atest-guest build]# lsblk /dev/rbd0
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
rbd0 250:0 0 1G 0 disk
[root@atest-guest build]# mkfs.xfs -f /dev/rbd0
meta-data=/dev/rbd0