ceph中用sgdisk工具进行分区--------固定uuid

  • ceph中两种类型分区的type code:
typetype code
journal 45b0969e-9b03-4f30-b4c6-b4b80ceff106
osd

4fbd7e29-9d25-41b8-afd0-062c0ceff05d

  • 有人会好奇为啥要给分区设置固定的uuid呢,原因是ceph通过uuid来区分你是osd分区还是journal分区之后,再决定数据放在哪里
  • 参考文档有解释:http://www.cnblogs.com/gzxbkk/p/7737421.html
  • 总结:
    ceph中创建journal分区和data分区:
    sgdisk -n {part num}:0:+{part size}G {disk} -t {part num}:4fbd7e29-9d25-41b8-afd0-062c0ceff05d -c {part num}:”ceph data”
    sgdisk -n {part num}:0:+{part size}G {disk} -t {part num}:45b0969e-9b03-4f30-b4c6-b4b80ceff106 -c {part num}:”ceph journal”

  • 示例:

  • 使用sgdisk创建分区

root@host1:~# sgdisk -n 1:0:+20G /dev/nvme0n1 -t 1:45b0969e-9b03-4f30-b4c6-b4b80ceff106 -c 1:"ceph journal"
Creating new GPT entries.
The operation has completed successfully.

root@host1:~# sgdisk -n 2:0:+20G /dev/nvme0n1 -t 2:45b0969e-9b03-4f30-b4c6-b4b80ceff106 -c 2:"ceph journal"
The operation has completed successfully.

root@host1:~# sgdisk -n 3:0:+150G /dev/nvme0n1 -t 3:4fbd7e29-9d25-41b8-afd0-062c0ceff05d -c 3:"ceph data"
The operation has completed successfully.

root@host1:~# sgdisk -n 4:0:+150G /dev/nvme0n1 -t 4:4fbd7e29-9d25-41b8-afd0-062c0ceff05d -c 4:"ceph data"
The operation has completed successfully.

root@host1:~# ceph-disk list
/dev/nvme0n1 :
 /dev/nvme0n1p1 ceph journal
 /dev/nvme0n1p2 ceph journal
 /dev/nvme0n1p3 ceph data, unprepared
 /dev/nvme0n1p4 ceph data, unprepared
posted @ 2017-10-26 16:23  多看多学多记多实践  阅读(1683)  评论(0编辑  收藏  举报