{"id":451,"date":"2014-03-04T05:30:40","date_gmt":"2014-03-04T05:30:40","guid":{"rendered":"http:\/\/www.selinuxplus.com\/?p=451"},"modified":"2014-03-04T05:31:23","modified_gmt":"2014-03-04T05:31:23","slug":"rbd%e5%9d%97%e8%ae%be%e5%a4%87%ef%bc%8c%e9%95%9c%e5%83%8f%e5%a4%a7%e5%b0%8fresize","status":"publish","type":"post","link":"http:\/\/www.selinuxplus.com\/?p=451","title":{"rendered":"rbd\u5757\u8bbe\u5907\uff0c\u955c\u50cf\u5927\u5c0fresize"},"content":{"rendered":"<p>\u865a\u62df\u955c\u50cf\u7684\u6269\u5c55\u5de5\u4f5c\u5728rbd\u5757\u8bbe\u5907\u4e0a\u8fdb\u884c\u7684\u64cd\u4f5c<\/p>\n<p>1 rbd\u64cd\u4f5c<br \/>\n===================================================== <\/p>\n<pre class=\"lang:default decode:true \" >\r\nos.system(\"ssh -o StrictHostKeyChecking=no \" + serviceIp + \" rbd resize \" + image + \" --size \" + str(size*1024));\r\n2 [root@localhost ~]# df -h\r\nFilesystem            Size  Used Avail Use% Mounted on\r\n\/dev\/mapper\/VolGroup-lv_root\r\n                       13G  1.6G   11G  14% \/\r\ntmpfs                 246M     0  246M   0% \/dev\/shm\r\n\/dev\/sda1             485M   33M  428M   8% \/boot\r\n[root@localhost ~]#\r\n\r\n[root@localhost ~]# fdisk -l\r\n\r\nDisk \/dev\/sda: 21.5 GB, 21474836480 bytes\r\n255 heads, 63 sectors\/track, 2610 cylinders\r\nUnits = cylinders of 16065 * 512 = 8225280 bytes\r\nSector size (logical\/physical): 512 bytes \/ 512 bytes\r\nI\/O size (minimum\/optimal): 512 bytes \/ 512 bytes\r\nDisk identifier: 0x00053901\r\n\r\n   Device Boot      Start         End      Blocks   Id  System\r\n\/dev\/sda1   *           1          64      512000   83  Linux\r\nPartition 1 does not end on cylinder boundary.\r\n\/dev\/sda2              64        1959    15215616   8e  Linux LVM\r\n\r\nDisk \/dev\/mapper\/VolGroup-lv_root: 13.5 GB, 13463715840 bytes\r\n255 heads, 63 sectors\/track, 1636 cylinders\r\nUnits = cylinders of 16065 * 512 = 8225280 bytes\r\nSector size (logical\/physical): 512 bytes \/ 512 bytes\r\nI\/O size (minimum\/optimal): 512 bytes \/ 512 bytes\r\nDisk identifier: 0x00000000\r\n\r\n\r\nDisk \/dev\/mapper\/VolGroup-lv_swap: 2113 MB, 2113929216 bytes\r\n255 heads, 63 sectors\/track, 257 cylinders\r\nUnits = cylinders of 16065 * 512 = 8225280 bytes\r\nSector size (logical\/physical): 512 bytes \/ 512 bytes\r\nI\/O size (minimum\/optimal): 512 bytes \/ 512 bytes\r\nDisk identifier: 0x00000000<\/pre>\n<p>\u5206\u533a\u5df2\u7ecf\u6269\u5c55\uff0c\u5982\u679c\u4f7f\u7528\u9700\u8981\u5bf9\u78c1\u76d8\u8fdb\u884c\u5206\u533a\u6269\u5c55\u64cd\u4f5c<br \/>\n+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++<br \/>\n2 qemu-img \u64cd\u4f5c<\/p>\n<pre class=\"lang:default decode:true \" >os.system(\"ssh -o StrictHostKeyChecking=no \" + serviceIp + \"qemu-img resize rbd:\" + image  + str(size*1024));\r\n\r\n\r\n\r\n[root@kvm9100 ~]# df -h\r\nFilesystem            Size  Used Avail Use% Mounted on\r\n\/dev\/mapper\/VolGroup-lv_root\r\n                       13G  1.6G   11G  14% \/\r\ntmpfs                 246M     0  246M   0% \/dev\/shm\r\n\/dev\/sda1             485M   33M  428M   8% \/boot\r\n\/dev\/sda3             6.9G  144M  6.4G   3% \/mnt\r\n[root@kvm9100 ~]# fdisk -l\r\n\r\nDisk \/dev\/sda: 23.6 GB, 23622320128 bytes\r\n255 heads, 63 sectors\/track, 2871 cylinders\r\nUnits = cylinders of 16065 * 512 = 8225280 bytes\r\nSector size (logical\/physical): 512 bytes \/ 512 bytes\r\nI\/O size (minimum\/optimal): 512 bytes \/ 512 bytes\r\nDisk identifier: 0x00053901\r\n\r\n   Device Boot      Start         End      Blocks   Id  System\r\n\/dev\/sda1   *           1          64      512000   83  Linux\r\nPartition 1 does not end on cylinder boundary.\r\n\/dev\/sda2              64        1959    15215616   8e  Linux LVM\r\n\/dev\/sda3            1959        2871     7332667+  83  Linux\r\n\r\nDisk \/dev\/mapper\/VolGroup-lv_root: 13.5 GB, 13463715840 bytes\r\n255 heads, 63 sectors\/track, 1636 cylinders\r\nUnits = cylinders of 16065 * 512 = 8225280 bytes\r\nSector size (logical\/physical): 512 bytes \/ 512 bytes\r\nI\/O size (minimum\/optimal): 512 bytes \/ 512 bytes\r\nDisk identifier: 0x00000000\r\n\r\n\r\nDisk \/dev\/mapper\/VolGroup-lv_swap: 2113 MB, 2113929216 bytes\r\n255 heads, 63 sectors\/track, 257 cylinders\r\nUnits = cylinders of 16065 * 512 = 8225280 bytes\r\nSector size (logical\/physical): 512 bytes \/ 512 bytes\r\nI\/O size (minimum\/optimal): 512 bytes \/ 512 bytes\r\nDisk identifier: 0x00000000\r\n\r\n\u5206\u533a\u6269\u5c55\u64cd\u4f5c\u540e\uff1a\r\n[root@localhost mnt]# df\r\nFilesystem           1K-blocks      Used Available Use% Mounted on\r\n\/dev\/mapper\/VolGroup-lv_root\r\n                      12941636   1655468  10628760  14% \/\r\ntmpfs                   251308         0    251308   0% \/dev\/shm\r\n\/dev\/sda1               495844     32968    437276   8% \/boot\r\n\/dev\/sda3              5153880    141304   4750768   3% \/mnt\r\n<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>\u865a\u62df\u955c\u50cf\u7684\u6269\u5c55\u5de5\u4f5c\u5728rbd\u5757\u8bbe\u5907\u4e0a\u8fdb\u884c\u7684\u64cd\u4f5c 1 &hellip;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[84,83,74],"tags":[91,92],"_links":{"self":[{"href":"http:\/\/www.selinuxplus.com\/index.php?rest_route=\/wp\/v2\/posts\/451"}],"collection":[{"href":"http:\/\/www.selinuxplus.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/www.selinuxplus.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/www.selinuxplus.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/www.selinuxplus.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=451"}],"version-history":[{"count":2,"href":"http:\/\/www.selinuxplus.com\/index.php?rest_route=\/wp\/v2\/posts\/451\/revisions"}],"predecessor-version":[{"id":453,"href":"http:\/\/www.selinuxplus.com\/index.php?rest_route=\/wp\/v2\/posts\/451\/revisions\/453"}],"wp:attachment":[{"href":"http:\/\/www.selinuxplus.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=451"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.selinuxplus.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=451"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.selinuxplus.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=451"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}