博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
rbd块映射
阅读量:6692 次
发布时间:2019-06-25

本文共 4385 字,大约阅读时间需要 14 分钟。

rbd块映射:

1 root@u18:~# rbd create kvm/test002.img --size 20  2 root@u18:~# rbd info kvm/test002.img  3 rbd image 'test002.img':  4     size 20480 kB in 5 objects  5     order 22 (4096 kB objects)  6     block_name_prefix: rb.0.2f13.2ae8944a  7     format: 1  8 root@u18:~# rbd map kvm/test002.img  9 root@u18:~# lsblk 10 NAME   MAJ:MIN RM   SIZE RO TYPE MOUNTPOINT 11 sda      8:0    0 298.1G  0 disk  12 ├─sda1   8:1    0 296.2G  0 part / 13 ├─sda2   8:2    0     1K  0 part  14 └─sda5   8:5    0   1.9G  0 part [SWAP] 15 sdb      8:16   0 465.8G  0 disk  16 ├─sdb1   8:17   0   200G  0 part /ceph_node0 17 ├─sdb2   8:18   0     1K  0 part  18 ├─sdb5   8:21   0   100G  0 part  19 └─sdb6   8:22   0 165.8G  0 part /data2 20 rbd0   250:0    0    40G  0 disk  21 rbd1   250:16   0    20M  0 disk  22 zram0  251:0    0 936.4M  0 disk [SWAP] 23  24 root@u18:~# mkfs.ext4 /dev/rbd1 25 mke2fs 1.42 (29-Nov-2011) 26 Filesystem label= 27 OS type: Linux 28 Block size=1024 (log=0) 29 Fragment size=1024 (log=0) 30 Stride=4096 blocks, Stripe width=4096 blocks 31 5136 inodes, 20480 blocks 32 1024 blocks (5.00%) reserved for the super user 33 First data block=1 34 Maximum filesystem blocks=20971520 35 3 block groups 36 8192 blocks per group, 8192 fragments per group 37 1712 inodes per group 38 Superblock backups stored on blocks:  39     8193 40  41 Allocating group tables: done                             42 Writing inode tables: done                             43 Creating journal (1024 blocks): done 44 Writing superblocks and filesystem accounting information: done 45  46  47 root@u18:~# mount /dev/rbd1 /mnt 48 root@u18:~# echo test > /mnt/a.log 49 root@u18:~# vim a.log 50 root@u18:~# vim /mnt/a.log  51 root@u18:~# umount /mnt 52 root@u18:~# rbd unmap /dev/rbd1 53 root@u18:~# rbd resize --size 40960 kvm/test002.img 54 Resizing image: 100% complete...done. 55 root@u18:~# rbd info kvm/test002.img 56 rbd image 'test002.img': 57     size 40960 MB in 10240 objects 58     order 22 (4096 kB objects) 59     block_name_prefix: rb.0.2f13.2ae8944a 60     format: 1 61 root@u18:~# rbd info kvm/test002.img 62 rbd image 'test002.img': 63     size 40960 MB in 10240 objects 64     order 22 (4096 kB objects) 65     block_name_prefix: rb.0.2f13.2ae8944a 66     format: 1 67 root@u18:~# rbd map kvm/test002.img 68 root@u18:~# lsblk 69 NAME   MAJ:MIN RM   SIZE RO TYPE MOUNTPOINT 70 sda      8:0    0 298.1G  0 disk  71 ├─sda1   8:1    0 296.2G  0 part / 72 ├─sda2   8:2    0     1K  0 part  73 └─sda5   8:5    0   1.9G  0 part [SWAP] 74 sdb      8:16   0 465.8G  0 disk  75 ├─sdb1   8:17   0   200G  0 part /ceph_node0 76 ├─sdb2   8:18   0     1K  0 part  77 ├─sdb5   8:21   0   100G  0 part  78 └─sdb6   8:22   0 165.8G  0 part /data2 79 rbd0   250:0    0    40G  0 disk  80 rbd1   250:16   0    40G  0 disk  81 zram0  251:0    0 936.4M  0 disk [SWAP] 82 root@u18:~# rbd unmap /dev/rbd1 83 root@u18:~# lsblk 84 NAME   MAJ:MIN RM   SIZE RO TYPE MOUNTPOINT 85 sda      8:0    0 298.1G  0 disk  86 ├─sda1   8:1    0 296.2G  0 part / 87 ├─sda2   8:2    0     1K  0 part  88 └─sda5   8:5    0   1.9G  0 part [SWAP] 89 sdb      8:16   0 465.8G  0 disk  90 ├─sdb1   8:17   0   200G  0 part /ceph_node0 91 ├─sdb2   8:18   0     1K  0 part  92 ├─sdb5   8:21   0   100G  0 part  93 └─sdb6   8:22   0 165.8G  0 part /data2 94 rbd0   250:0    0    40G  0 disk  95 zram0  251:0    0 936.4M  0 disk [SWAP] 96 root@u18:~# rbd map kvm/test002.img 97 root@u18:~# lsblk 98 NAME   MAJ:MIN RM   SIZE RO TYPE MOUNTPOINT 99 sda      8:0    0 298.1G  0 disk 100 ├─sda1   8:1    0 296.2G  0 part /101 ├─sda2   8:2    0     1K  0 part 102 └─sda5   8:5    0   1.9G  0 part [SWAP]103 sdb      8:16   0 465.8G  0 disk 104 ├─sdb1   8:17   0   200G  0 part /ceph_node0105 ├─sdb2   8:18   0     1K  0 part 106 ├─sdb5   8:21   0   100G  0 part 107 └─sdb6   8:22   0 165.8G  0 part /data2108 rbd0   250:0    0    40G  0 disk 109 rbd1   250:16   0    40G  0 disk 110 zram0  251:0    0 936.4M  0 disk [SWAP]111 root@u18:~# mount /dev/rbd1 /mnt112 root@u18:~# parted /dev/rbd1  print free113 root@u18:~# parted /dev/rbd1  print free114 Model: Unknown (unknown)115 Disk /dev/rbd1: 42.9GB116 Sector size (logical/physical): 512B/512B117 Partition Table: loop118 119 Number  Start  End     Size    File system  Flags120  1      0.00B  42.9GB  42.9GB  ext4121 122 root@u18:~# vim /mnt/a.log 123 root@u18:~# cat /mnt/a.log124 test

 

转载地址:http://fajoo.baihongyu.com/

你可能感兴趣的文章
[转载]手机软件开发之我见
查看>>
UNITY实现FLASH中的setTimeout
查看>>
C#文件和文件文件夹按时间、名称排序-顺序与倒序
查看>>
表达式的计算结果必须为节点集。
查看>>
Python黑帽编程 3.5 DTP攻击
查看>>
再见乱码:5分钟读懂MySQL字符集设置
查看>>
多线程系列一
查看>>
[CareerCup] 1.5 Compress String 压缩字符串
查看>>
Windows 2008 R2 64位上安装wamp失败的原因
查看>>
法外之徒第一季/全集Braquo迅雷下载
查看>>
在阿里云环境下搭建基于SonarQube的自动化安全代码检测平台
查看>>
PHP实现四种基本排序算法 得多消化消化
查看>>
MongoDB概念解析
查看>>
Windows系统下IE单双多进程分析
查看>>
SmartNavigation在Fx2.0中下岗了...
查看>>
浅谈国内域名注册商与国外域名注册商的区别与优势
查看>>
嵌入式ROM和RAM的区别
查看>>
算法导论第十五章 动态规划
查看>>
Oracle:使用SQL SELECT语句检索数据
查看>>
让Mac OS 10.x.x安装在Vmware虚拟机上!
查看>>