sudo ceph osd pool ls
sudo ceph osd pool create rbd

sudo rados df

sudo rbd ls
sudo rbd create --size 1024 rbd/r1


#sudo rbd map r1
#rbd: sysfs write failed
#RBD image feature set mismatch. You can disable features unsupported by the kernel with "rbd feature disable r1 object-map fast-diff deep-flatten".
#In some cases useful info is found in syslog - try "dmesg | tail".
#rbd: map failed: (6) No such device or address

sudo rbd feature disable r1 object-map fast-diff deep-flatten
sudo rbd map r1

sudo rbd showmapped
id pool image snap device
0  rbd  r1    -    /dev/rbd0


sudo fdisk -l /dev/rbd0

sudo mkfs.ext4 -m0 /dev/rbd0

sudo mkdir -p /mnt/rbd/r1
sudo mount -t ext4 /dev/rbd0 /mnt/rbd/r1


sudo ls /mnt/rbd/r1

sudo vi /mnt/rbd/r1/hi.txt

sudo cat /mnt/rbd/r1/hi.txt
hello rbd

Leave a Reply

Your email address will not be published. Required fields are marked *