当前位置: 首页 > news >正文

网站开发和推广的不同/网站分析报告

网站开发和推广的不同,网站分析报告,wordpress页面的评论功能,用阿里巴巴店铺做公司网站怎么样当我们需要扩展模板镜像的虚拟磁盘大小时,比如原来的虚拟磁盘大小为20G,现在我们想将其扩展到30G,那么我们可以根据如下步骤来操作。 整个流程可以分为三个阶段: 1、扩展KVM镜像磁盘文件大小到30G。 2、扩展磁盘分区大小为30G。 3…

当我们需要扩展模板镜像的虚拟磁盘大小时,比如原来的虚拟磁盘大小为20G,现在我们想将其扩展到30G,那么我们可以根据如下步骤来操作。

整个流程可以分为三个阶段:

1、扩展KVM镜像磁盘文件大小到30G。

2、扩展磁盘分区大小为30G。

3、扩展文件系统大小为30G。

假若当前有一个名为 test_extend.img 的模板镜像,其格式为 qcow2, virtual_size为 20G

1、首先可以使用qemu-img来查看该模板镜像的元信息:

root@cason:~/image# qemu-img info test_extend.img 
image: test_extend.img
file format: qcow2
virtual size: 20G (21474836480 bytes)
disk size: 309M
cluster_size: 65536
Format specific information:compat: 1.1lazy refcounts: false
root@cason:~/image# 

2、由于需要使用到qemu-nbd,因此我们需要先确认nbd模板已经被load:

root@cason:~/image# lsmod | grep nbd
root@cason:~/image#

     执行如上命令发现没有任何输出,则表示当前系统并没有加载nbd模块

3、加载nbd模板,并再次确认(若没有nbd模块,则可以参考这里进行编译安装):

root@cason:~/image# modprobe nbd max_part=8
root@cason:~/image# lsmod | grep nbd
nbd                    17603  0 
root@cason:~/image# 

     此时nbd模板已经正常加载了

4、通过qemu-img命令来扩展虚拟磁盘的virtual_size为 30G:

root@cason:~/image# qemu-img resize test_extend.img 32212254720
Image resized.
root@cason:~/image# qemu-img info test_extend.img 
image: test_extend.img
file format: qcow2
virtual size: 30G (32212254720 bytes)
disk size: 309M
cluster_size: 65536
Format specific information:compat: 1.1lazy refcounts: false
root@cason:~/image# 

5、下面通过qemu-nbd挂载test_extend.img到/dev/nbd0设备上:

root@cason:~/image# qemu-nbd -c /dev/nbd0 ./test_extend.img 
root@cason:~/image# ll /dev/nbd* | grep nbd0
brw-rw---- 1 root disk 43,   0 11月 20 18:09 /dev/nbd0
brw-rw---- 1 root disk 43,   1 11月 20 18:09 /dev/nbd0p1
root@cason:~/image# 

     挂载成功后,在/dev/下会看到如上信息,其中/dev/nbd0p1表示该虚拟磁盘仅有一个分区

6、下面开始通过fdisk来扩展虚拟磁盘分区大小:

root@cason:~/image# fdisk /dev/nbd0Command (m for help): pDisk /dev/nbd0: 32.2 GB, 32212254720 bytes
255 heads, 63 sectors/track, 3916 cylinders, total 62914560 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x000e8e8dDevice Boot      Start         End      Blocks   Id  System
/dev/nbd0p1   *        2048    41943039    20970496   83  LinuxCommand (m for help): d
Selected partition 1Command (m for help): pDisk /dev/nbd0: 32.2 GB, 32212254720 bytes
255 heads, 63 sectors/track, 3916 cylinders, total 62914560 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x000e8e8dDevice Boot      Start         End      Blocks   Id  SystemCommand (m for help): n
Partition type:p   primary (0 primary, 0 extended, 4 free)e   extended
Select (default p): p
Partition number (1-4, default 1): 
Using default value 1
First sector (2048-62914559, default 2048): 
Using default value 2048
Last sector, +sectors or +size{K,M,G} (2048-62914559, default 62914559): 
Using default value 62914559Command (m for help): pDisk /dev/nbd0: 32.2 GB, 32212254720 bytes
255 heads, 63 sectors/track, 3916 cylinders, total 62914560 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x000e8e8dDevice Boot      Start         End      Blocks   Id  System
/dev/nbd0p1            2048    62914559    31456256   83  LinuxCommand (m for help): a
Partition number (1-4): 1Command (m for help): pDisk /dev/nbd0: 32.2 GB, 32212254720 bytes
255 heads, 63 sectors/track, 3916 cylinders, total 62914560 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x000e8e8dDevice Boot      Start         End      Blocks   Id  System
/dev/nbd0p1   *        2048    62914559    31456256   83  LinuxCommand (m for help): w
The partition table has been altered!Calling ioctl() to re-read partition table.
Syncing disks.
root@cason:~/image# 

     如此以来,我们已经将该虚拟磁盘的分区大小扩展到了30G

7、至此,我们还需要将文件系统扩展到30G:

root@cason:~/image# e2fsck -fp /dev/nbd0p1 
/dev/nbd0p1: Deleted inode 131076 has zero dtime.  FIXED.
/dev/nbd0p1: 18489/1310720 files (0.2% non-contiguous), 281286/5242624 blocksroot@cason:~/image# resize2fs /dev/nbd0p1 
resize2fs 1.42.9 (4-Feb-2014)
Resizing the filesystem on /dev/nbd0p1 to 7864064 (4k) blocks.
The filesystem on /dev/nbd0p1 is now 7864064 blocks long.root@cason:~/image# qemu-nbd -d /dev/nbd0
/dev/nbd0 disconnected

至此,我们就完成了扩展虚拟磁盘大小的操作。

 

转载于:https://www.cnblogs.com/CasonChan/p/4110770.html

http://www.lbrq.cn/news/1283689.html

相关文章:

  • 做外贸公司网站/近期国际新闻热点大事件
  • 合肥seo关键词排名/seo查询5118
  • 个人网站建设方法/郴州网站建设
  • 地勘网站建设方案/深圳网络推广最新招聘
  • 网站开发设计培训价格/产品质量推广营销语
  • 网站攻击方式/宁波seo外包平台
  • 云南城乡建设网站/简单制作html静态网页
  • 如何做网站网页表白/东莞今日头条新闻
  • 国际交友网站做英文客服/长沙seo排名扣费
  • 公司网站建设申请/成都网络优化公司有哪些
  • 外包公司做网站价格/免费发广告帖子的网站
  • 电梯行业网站怎么做/快速网站排名提升
  • html教程菜鸟教程w3school/济南网站推广优化
  • seo网站外链专发/百度搜索关键词热度
  • 制作公众号网站开发/怎样优化网站排名
  • 乌鲁木齐网站建设报价/如何优化关键词
  • 猪八戒网站找做微信小程序的/seo关键词排名价格
  • 外贸网站推广平台哪个好/千锋教育郑州校区
  • 网站制作的重要性/河南网站seo费用
  • 委托网站建设注意什么/百度公司是国企还是私企
  • 临沂网站建设服务/自动发帖软件
  • 深圳网站建设开发/电商平台怎么运营的
  • 网站网站开发的公司/百度快照在哪里
  • 宁波做网站nbyckj/安卓神级系统优化工具
  • wordpress更改首页代码/青山seo排名公司
  • 辽宁做网站找谁/百度客服人工
  • 网站可以做库存吗/信息流优化师培训机构
  • 彩票网站建设哪家公司好/今日新闻内容摘抄
  • 菜鸟教程网站/做教育培训应该注册什么公司
  • 临淄哪里做网站/怎样做品牌推广
  • Linux内核设计与实现 - 课程大纲
  • Linux 如何统计系统上各个用户登录(或者登出)记录出现的次数?
  • Flowable 实战落地核心:选型决策与坑点破解
  • 伟淼科技李志伟:破解二代接班传承困局,系统性方案破除三代魔咒
  • 如何实现打印功能
  • 疯狂星期四第19天运营日记