怎样调整XenServer下面Linux虚拟机的磁盘大小
- 登录到XenServer。
- 修改虚拟机磁盘大小
修改storage 磁盘大小 - 启动虚拟机
- 修改分区大小
fdisk /dev/xvdaThe number of cylinders for this disk is set to 5221.
There is nothing wrong with that, but this is larger than 1024,
and could in certain setups cause problems with:
1) software that runs at boot time (e.g., old versions of LILO)
2) booting and partitioning software from other OSs
(e.g., DOS FDISK, OS/2 FDISK)Command (m for help): p
Disk /dev/xvda: 42.9 GB, 42949672960 bytes
255 heads, 63 sectors/track, 5221 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytesDevice Boot Start End Blocks Id System
/dev/xvda1 * 1 13 104391 83 Linux
/dev/xvda2 14 2610 20860402+ 8e Linux LVMCommand (m for help): Command (m for help): p
DOS Compatibility flag is not setCommand (m for help): d
Partition number (1-4): 2Command (m for help): n
Command action
e extended
p primary partition (1-4)
p
Partition number (1-4): 2
First cylinder (14-5221, default 14):
Using default value 14
Last cylinder or +size or +sizeM or +sizeK (14-5221, default 5221):
Using default value 5221Command (m for help): t
Partition number (1-4): 2
Hex code (type L to list codes): 8e
Changed system type of partition 2 to 8e (Linux LVM)Command (m for help): p
Disk /dev/xvda: 42.9 GB, 42949672960 bytes
255 heads, 63 sectors/track, 5221 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytesDevice Boot Start End Blocks Id System
/dev/xvda1 * 1 13 104391 83 Linux
/dev/xvda2 14 5221 41833260 8e Linux LVMCommand (m for help): w
The partition table has been altered!Calling ioctl() to re-read partition table.
WARNING: Re-reading the partition table failed with error 16: Device or resource busy.
The kernel still uses the old table.
The new table will be used at the next reboot.
Syncing disks. - 重启虚拟机:reboot
- 调整PV大小
pvs
PV VG Fmt Attr PSize PFree
/dev/xvda2 VolGroup00 lvm2 a- 19.88G 0pvresize -v /dev/xvda2
Using physical volume(s) on command line
Archiving volume group "VolGroup00" metadata (seqno 3).
Resizing physical volume /dev/xvda2 from 636 to 1276 extents.
Resizing volume "/dev/xvda2" to 83666136 sectors.
Updating physical volume "/dev/xvda2"
Creating volume group backup "/etc/lvm/backup/VolGroup00" (seqno 4).
Physical volume "/dev/xvda2" changed
1 physical volume(s) resized / 0 physical volume(s) not resizedpvs
PV VG Fmt Attr PSize PFree
/dev/xvda2 VolGroup00 lvm2 a- 39.88G 20.00G - 调整LV大小
lvs
LV VG Attr LSize Origin Snap% Move Log Copy% Convert
LogVol00 VolGroup00 -wi-ao 17.84G
LogVol01 VolGroup00 -wi-ao 2.03Glvextend -l +100%FREE /dev/VolGroup00/LogVol00
- 或者 lvextend -l +100%FREE /dev/cl/root
- Extending logical volume LogVol00 to 37.84 GB
Logical volume LogVol00 successfully resizedlvs
LV VG Attr LSize Origin Snap% Move Log Copy% Convert
LogVol00 VolGroup00 -wi-ao 37.84G
LogVol01 VolGroup00 -wi-ao 2.03G - 调整分区大小
df -h
Filesystem Size Used Avail Use% Mounted on
/dev/mapper/VolGroup00-LogVol00
5.7G 4.5G 950M 83% /
/dev/xvda1 99M 22M 73M 24% /boot
tmpfs 2.0G 0 2.0G 0% /dev/shmresize2fs /dev/mapper/VolGroup00-LogVol00
- 或者 xfs_growfs /dev/mapper/cl-root
resize2fs 1.39 (29-May-2006)
Filesystem at /dev/mapper/VolGroup00-LogVol00 is mounted on /; on-line resizing required
Performing an on-line resize of /dev/mapper/VolGroup00-LogVol00 to 9920512 (4k) blocks.
The filesystem on /dev/mapper/VolGroup00-LogVol00 is now 9920512 blocks long.df -h
Filesystem Size Used Avail Use% Mounted on
/dev/mapper/VolGroup00-LogVol00
37G 4.5G 31G 13% /
/dev/xvda1 99M 22M 73M 24% /boot
tmpfs 2.0G 0 2.0G 0% /dev/shm
任务完成 遇到的问题
linux系统为centos7 时, 用 resize2fs 命令出现报错 resize2fs: Bad magic number in super-block while trying to open
xfs_growfs /dev/root_vg/root 用 xfs_growfs 代替命令 resize2fs
转载于:https://www.cnblogs.com/weifeng1463/p/8421773.html
怎样调整XenServer下面Linux虚拟机的磁盘大小相关推荐
- virtualbox主机网络管理 未能创建_如何在 VirtualBox 中增加现有虚拟机的磁盘大小 | Linux 中国...
导读:你可以在 VirtualBox 中扩大虚拟硬盘,即使在创建之后也可以. 本文字数:1434,阅读时长大约:2分钟https://linux.cn/article-12869-1.html作者:D ...
- linux虚拟机扩展磁盘
记一次linux虚拟机扩展磁盘 cmd diskpart DISKPART> help Microsoft DiskPart 版本 10.0.17134.1ACTIVE - 将选中的分区标记为活 ...
- [转]调整 VirtualBox 虚拟机的磁盘大小
本文转自:https://cnzhx.net/blog/resizing-lvm-centos-virtualbox-guest/ 发表于 2013-08-20 作者 H Zeng 更新于 2016 ...
- windows azure mysql data disk_调整Azure中虚拟机数据磁盘大小实践
首先,在Azure中关于数据存储的付费规则中规定,只要你使用的不是Azure的XIO高级存储提供的I/O密集型的高吞吐低延迟的服务,那么得益于Azure存储设计中采用的稀疏文件方式存储,存储虚拟机VH ...
- Linux虚拟机新增磁盘分区格式化和挂载
Virtualbox虚拟机增加额外磁盘 Author:onceday date:2022年8月8日 一套简单解决Linux虚拟机磁盘不够的方案. 安装虚拟机和Ubuntu 以下参阅其他文档: 使用vi ...
- Linux虚拟机添加磁盘
1.虚拟机添加磁盘 2.查看添加完成磁盘 3.创建分区 4.对分区进行格式化 5.挂载 创建挂载目录 mkdir /mnt/sdb1 (目录自定义) mount -t auto /dev/sdb1 / ...
- linux 虚拟机新增磁盘,linux(虚拟机)下新增磁盘配置
Linux的硬盘识别: (1)"fdisk -l"命令可以列出系统中当前连接的硬盘设备和分区信息.新硬盘没有分区信息,则只显示硬盘大小信息. (2)创建新硬盘分区命令参数: fdi ...
- 重启linux虚拟机遇到磁盘损坏后,如何修复?
linux虚拟机长时间不关,重启的时候可能会报一个磁盘损坏的错误: 这是由于磁盘有损坏造成的.在后面直接输入root密码,然后再输入fsck /dev/sda2(报错的设备名称): 在Fix<y ...
- linux lvm 大小与硬盘大小关系,linux lvm扩容磁盘大小
关闭需要扩容的虚拟机,并通过管理虚拟机界面添加磁盘空间,本次调整50G 注意,本次写入为增加容量的大小,并非增加完硬盘的大小 硬盘添加后可以用fdisk -l 查看磁盘容量大小,可以看到硬盘增加了50 ...
最新文章
- 电容触摸屏GT911、GT928、GT9147的使用
- view.ondraw
- NET问答: 如何在 dynamic 集合上使用 Linq ?
- linux 制作box文件夹,用busybox制作自己简易的根文件系统
- Spring 之autowired
- Python编码格式导致的csv读取错误
- Python POST登陆linkedin分析(完),完整实现过程
- multitask_note
- 企业微信oauth认证_企业微信登陆
- python 随机森林分类 代码
- python基础教程_python基础教程百度网盘
- 51单片机延时程序(以延时30ms为例)
- 实时可视化大数据项目05 -- UI界面
- Android事件总线——EventBus的使用
- android和artset区别,artset安卓版
- maya渲染序列文件存在检测工具
- 新颖的基于BS结构的毕业设计题目50例
- 凭期权定价捧得诺奖的斯科尔斯败走麦城,理论好对于交易有帮助吗?
- Bootstrap系列之导航
- CentOS 7 在vmware中的网络设置详细介绍