-
VMware服务器磁盘空间扩容
2020-07-20 13:37:52winserve 12服务器磁盘空间扩容 登录vsphere client 虚拟机选择(将被扩展虚拟机关机进行设置) 编辑设置 3. 修改想要扩大的空间 点击确定 远程到对应虚拟机 右键扩展卷 确定(开机即可) ...winserve 12服务器磁盘空间扩容
-
登录vsphere client 虚拟机选择(将被扩展虚拟机关机进行设置)
-
编辑设置
3.
修改想要扩大的空间 -
点击确定
-
远程到对应虚拟机 -
右键扩展卷
确定(开机即可)
-
-
VMware CentOS Linux磁盘空间扩容过程详解
2020-12-05 21:01:16VMWare CentOS Linux磁盘空间扩容过程详解环境信息
- 虚拟化软件:VMware Workstation 16
- 虚拟机:CentOS 7.7 64bit
在VMware 中给Linux虚拟机公共分片了20GB单磁盘,已经不够用。需要扩充,因为Linux是使用LVM(Logical Volume Manager)所以扩充磁盘非常方便。步骤如下
扩容前
扩容前,磁盘(既LV)空间使用率已经达到94%,严重不够用了,需要扩空间:
[root@centosa ~]# df -T (这里加-T选项,可显示文件系统类型) Filesystem Type 1K-blocks Used Available Use% Mounted on devtmpfs devtmpfs 1996088 0 1996088 0% /dev tmpfs tmpfs 2013112 44 2013068 1% /dev/shm tmpfs tmpfs 2013112 12208 2000904 1% /run tmpfs tmpfs 2013112 0 2013112 0% /sys/fs/cgroup /dev/mapper/centos-root xfs 17811456 16695572 1115884 94% / /dev/sda1 xfs 1038336 164512 873824 16% /boot tmpfs tmpfs 402624 0 402624 0% /run/user/1000 [root@centosa ~]# fdisk -l Disk /dev/sda: 21.5 GB, 21474836480 bytes, 41943040 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 label type: dos Disk identifier: 0x000cf932 Device Boot Start End Blocks Id System /dev/sda1 * 2048 2099199 1048576 83 Linux /dev/sda2 2099200 41943039 19921920 8e Linux LVM Disk /dev/mapper/centos-root: 18.2 GB, 18249416704 bytes, 35643392 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 /dev/mapper/centos-swap: 2147 MB, 2147483648 bytes, 4194304 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
扩容步骤
1、VMware虚拟机扩容
关闭虚拟机后,由于虚拟机存在快照无法直接扩展原磁盘,只能在VMware中新增一块盘。
2、磁盘创建partition
启动虚拟机后,通过df命令查看磁盘空间未变。通过fdisk -l 命令可以看到多了一块 /dev/sdb 的Disk
通过以下fdisk /dev/sdb 将磁盘创建partition
新增的partition为:/dev/sdb1
3、创建PV并纳入VG
这时候通过pvdisplay 或 vgdisplay 命令还看不到刚才新增的Partition。
通过以下pvcreate 和 vgextend,创建PV后,并将新装机的PV加入到VG中(我们的VG名为"centos")
然后,再次通过pvdisplay 或 vgdisplay 命令,就能看到了,并且VG的总容量也增加了,新增的空间是Free空闲的。
4、对原LV扩展容量
在扩LV之前,可以通过命令lvdisplay查看当前的LV情况。可以看到:
- 系统已存在两个LV,都是基于名为“centos”的VG上分配的空间。
- 结合前面,我们正是名为“ /dev/centos/root” 的LV空闲空间不足。
因此,我们将新增的10GB空闲空间,全部分配给名为“ /dev/centos/root” 的LV。 命令格式为:
- lvextend -L +10240m LV名称 (-L指向需要增加的空间大小,单位可以为G、M、T等)
由于直接指定扩大10240MB,会报“ Insufficient free space: 2560 extents needed, but only 2559 available”。既VG中free空闲空间不是严格的10GB,而是少一个PE(VG的一个PE为为4MB)。
所以扩展的空间大小不是10240m,而是10236m。
[root@centosa ~]# lvextend -L +10236m /dev/centos/root Logical volume centos/root successfully resized. [root@centosa ~]# [root@centosa ~]# [root@centosa ~]# vgdisplay --- Volume group --- VG Name centos System ID Format lvm2 Metadata Areas 2 Metadata Sequence No 6 VG Access read/write VG Status resizable MAX LV 0 Cur LV 2 Open LV 2 Max PV 0 Cur PV 2 Act PV 2 VG Size 28.99 GiB PE Size 4.00 MiB Total PE 7422 Alloc PE / Size 7422 / 28.99 GiB Free PE / Size 0 / 0 VG UUID Ngcx2z-PxqT-W9Dl-jg7b-YcQd-2OD3-x4vmDo
4、扩大文件系统
这是通过df查看当前文件系统,仍为变化。这是因为尽管LV容量扩大了,但文件系统还未扩大。
如果是ext4等文件系统可以通过命令resize2fs扩大。 因为我们是xfs文件系统,所以需要使用命令xfs_growfs来完成文件系统扩大。
然后再次通过df查看空间情况,可以看到空间已经扩大。
-
CentOS 磁盘空间扩容操作方法
2020-05-26 10:14:29CentOS 磁盘空间扩容操作方法 1、使用命令查看磁盘信息,标红的为新增的磁盘空间 2、使用fdisk命令,创建新分区 参考:https://blog.51cto.com/12185273/2048111 root@localhost# fdisk /dev/sdb 命令(输入 m 获取...CentOS 磁盘空间扩容操作方法
1、使用命令查看磁盘信息,标红的为新增的磁盘空间
2、使用fdisk命令,创建新分区
参考:https://blog.51cto.com/12185273/2048111
root@localhost# fdisk /dev/sdb命令(输入 m 获取帮助): m 命令操作 a toggle a bootable flag b edit bsd disklabel c toggle the dos compatibility flag d delete a partition l list known partition types m print this menu n add a new partition o create a new empty DOS partition table p print the partition table q quit without saving changes s create a new empty Sun disklabel t change a partition's system id u change display/entry units v verify the partition table w write table to disk and exit x extra functionality (experts only) 命令(输入 m 获取帮助): n #new 新分区 Partition type: p primary (1 primary, 1 extended, 2 free) l logical (numbered from 5) Select (default p): p #选择主分区 分区号 (1-4,默认为 3): 1 #分区序号 起始 sector (499712-314572799,默认为 499712): #分区开始回车默认 将使用默认值 499712 Last sector, +扇区 or +size{K,M,G} (499712-501757,默认为 501757): +150G #分配分区空间大小 命令(输入 m 获取帮助): t #修改分区格式 分区号 (1-5): 4 #修改分区号 Hex code (type L to list codes): 8e #格式选择8e linux LVM Changed system type of partition 4 to 8e (Linux LVM) 命令(输入 m 获取帮助): p #显示分区信息 Disk /dev/sdb: 161.1 GB, 161061273600 bytes 16 heads, 63 sectors/track, 312076 cylinders, total 314572800 sectors Units = 扇区 of 1 * 512 = 512 bytes Sector size (logical/physical): 512 bytes / 512 bytes I/O size (minimum/optimal): 512 bytes / 512 bytes Disk identifier: 0x0001a023 设备 启动 起点 终点 块数 Id 系统 /dev/vda1 * 2048 499711 248832 83 Linux /dev/vda2 501758 62912511 31205377 5 扩展 /dev/vda3 499712 501757 1023 83 Linux /dev/vda4 62912512 314572799 125830144 8e Linux LVM /dev/vda5 501760 62912511 31205376 8e Linux LVM Partition table entries are not in disk order 命令(输入 m 获取帮助): w #保存信息 The partition table has been altered! Calling ioctl() to re-read partition table. WARNING: Re-reading the partition table failed with error 16: 设备或资源忙. The kernel still uses the old table. The new table will be used at the next reboot or after you run partprobe(8) or kpartx(8) Syncing disks.
3、对/dev/sdb1 进行格式化
注意:这里是sdb1,不是sdb
mkfs.ext4 /dev/sdb1看到done表示格式化完成
4、创建物理卷,使用pvcreate /dev/sdb1命令。
并用命令pvdisplay 查看新建的物理卷信息和大小
5、将添加新的物理卷,加载到卷组 centos 中 (114上卷组名 cl)
使用命令:vgextend centos /dev/sdb1
6、增加逻辑卷 /dev/mappercentos-root 大小,增加500M。(114的逻辑卷名/dev/mapper/cl-root,增加150G)
使用lvresize -L +500M /dev/mapper/dev/mapper/centos-root 命令(114上使用命令:lvresize -L +150G /dev/mapper/cl-root)
7、重新识别 /dev/mappercentos-root 大小
使用xfs_growfs /dev/mappercentos-root命令 (114上命令为:xfs_growfs /dev/mapper/cl-root)
并查看扩容后的大小 ,使用df -h命令
当看到/dev/mappercentos-root 已经更新到新的大小时,则表示增加成功 -
KVM虚拟机磁盘空间扩容
2018-08-06 14:24:17二,在宿主机上操作对虚拟机磁盘空间扩容 # virsh blockresize --domain template --path /iptv/src/add_disk.img --size 4G Block device '/iptv/src/add_disk.img' is resized # qemu-img...一,环境说明:
add_disk.img磁盘映像文件原本是2G大小。
二,在宿主机上操作对虚拟机磁盘空间扩容
# virsh blockresize --domain template --path /iptv/src/add_disk.img --size 4G
Block device '/iptv/src/add_disk.img' is resized
# qemu-img info ./add_disk.img
image: ./add_disk.img
file format: qcow2
virtual size: 4.0G (4294967296 bytes)-----------注意,已经增大了,原来是2G的;
disk size: 200K
cluster_size: 65536
Format specific information:
compat: 1.1
lazy refcounts: false
参数说明:
--path:必须跟的是img文件的绝对路径。
在虚拟机中查看,确实已经增大了:
# fdisk -l
磁盘 /dev/vdb:4294 MB, 4294967296 字节,8388608 个扇区
Units = 扇区 of 1 * 512 = 512 bytes
扇区大小(逻辑/物理):512 字节 / 512 字节
I/O 大小(最小/最佳):512 字节 / 512 字节
附录:virsh blockresize子命令使用方法介绍
# virsh help blockresize
NAME
blockresize - Resize block device of domain.
SYNOPSIS
blockresize <domain> <path> <size>
DESCRIPTION
Resize block device of domain.
OPTIONS
[--domain] <string> domain name, id or uuid
[--path] <string> Fully-qualified path of block device
[--size] <number> New size of the block device, as scaled integer (default KiB)
# man virsh
blockresize domain path size
Resize a block device of domain while the domain is running.
path specifies the absolute path of the block device;(path指定虚拟机的块设备文件的绝对路径,也就是说,比如你的虚拟机的磁盘映像文件为/tm/test.img,则这里path的值就是/tmp/test.img) it corresponds to a unique target name (<target dev='name'/>) or source file (<source file='name'/>) for one of the disk devices attached to domain (see also domblklist for listing these names).(这个path指定的块设备对要与附属于域的所有磁盘设备中的一个独一无二的target名称(在xml文件中,由<target dev='name'/>)或源文件(在xml文件中,由<source file='name'/>指定的)指定的块设备一致);
size is a scaled integer (see NOTES above) which defaults to KiB (blocks of 1024 bytes) if there is no suffix.(默认是KB,如果不指定size的单位,则使用KB,但也可以使用M,G,T等单位) You must use a suffix of "B" to get bytes (note that for historical reasons, this differs from vol-resize which defaults to bytes without a suffix).
-
ubuntu 16.04根目录磁盘空间扩容
2021-04-07 16:56:16[csdn文章:Ubuntu18.04根目录磁盘空间扩容——亲测有效] 原文是Ubuntu18.04,我应用在16.04完全没问题的。 其中本人一直卡在了进不去U盘系统那步,预开机时按ESC,再选F9之后的界面中一直没有USB选项 -
AWS EC2 实例磁盘空间扩容
2019-01-02 00:19:30AWS Linux 实例磁盘空间扩容 大致步骤: 调整卷大小 调整分区大小 调整文件系统大小 参考文章:通过给EBS类型的根设备扩容解决AWS磁盘容量已满 1. 调整EBS存储卷大小 进入控制台,选择 EBS - Volumes -Action - ... -
Linux磁盘空间扩容(LVM)
2017-12-01 17:24:00Linux磁盘空间扩容(lvm) 随着系统的运行时间增长,业务数据的增长,原有磁盘的空间会存在空间不足情况,导致系统不能正常运行,或者系统管理员磁盘没有完全划完,根据使用者的需求自行划分。那么怎么才能扩展原有... -
QQ空间迁移_【VM_磁盘空间扩容引起的一些问题】
2021-02-06 15:43:39VM 磁盘空间扩容引起的一些问题 2015-03-01 18:43:39 TOP 如下 存储分区如下 ESX1下挂载情况如下图ESX2下挂载情况如下图 现在有个需求,lun60的空间偏大,缩小为1T ,LUN80的空间偏小,扩大为1.5T先把LUN60和... -
CentOS 7磁盘空间扩容
2020-04-01 22:55:06在VMware虚拟机中进行扩容。 查看容量 发现没有什么容量可以使用了,需要进行扩容 该操作需要先关闭虚拟机,扩容10G -
virtualbox虚拟机磁盘空间扩容
2020-12-16 17:01:33这就悲剧了,才用了一下子就占了96%的磁盘空间了,因此只能进行虚拟硬盘容量的扩容操作。 二、扩展虚拟硬盘容量 第1步、查看硬盘镜像文件 1、虚拟机关机,关机后如下所示,显示硬盘大小上限为8G。 2、启动CMD... -
ubuntu 16.04根目录磁盘空间扩容(亲测!!)
2018-09-10 17:49:59本人ubuntu系统安了cuda一些乱七八糟的东西后,发现根目录空间不够了(15G,之前安装双系统设置的),痛下决心把根目录给扩容一下(主要是怕系统崩了),下边介绍一下使用gparted分区软件对linux系统进行磁盘分区。... -
Linux LVM磁盘空间扩容的新方法
2018-08-07 10:31:51当服务器是虚拟机,或者使用SAN/NAS存储的物理机时,由于分配给服务器磁盘空间可以直接扩容,只需增加原本正在使用中的PV磁盘空间即可完成扩容,这样分配给服务器的磁盘数量较少,磁盘布局结构... -
Hyper 磁盘空间扩容--扩容卷组空间 (完整实操精华版)
2019-11-27 17:50:372.操作→编辑磁盘 下一步填写要扩容大小 确认,到此磁盘扩容已完成。 1.查看现在使用的磁盘分区信息,根分区是240G 1 2 3 4 5 6 7 8 9 10 11 [root@... -
mysql磁盘空间扩容_mysql磁盘空间暴增
2021-01-19 18:03:29今天上班后,忽然发现mysql从库的磁盘空间忽然爆满,经过一番查看后,发现ibtmp1占的空间很大,已经快300G了。经过查询得知,ibtmp1文件是 MySQL5.7的新特性,MySQL5.7使用了独立的临时表空间来存储临时表数据,但不能... -
windows 2012 r2基本磁盘空间扩容
2019-11-14 15:05:51windows 2003 分区调整大小(diskpart已验证,详情见最后部分) ...虚拟机属性-磁盘置备-修改要扩容的空间150G修改为600G 进入虚机 服务器管理器-计算机管理-磁盘管理-重新扫描磁盘 选择最后一个盘扩容 ... -
linux 磁盘空间扩容 vg(+pv) lv(+空间) lv(缩减磁盘空间)
2014-12-11 20:20:00linux 磁盘空间扩容 vg(+pv) lv(+空间) lv(缩减磁盘空间) preFace APP scenario description: 当你未能合理的规划存储时,在后期的维护工作中可能会涉及的存储的 再规划(eg,某一个 or 数个App 对某... -
虚拟机Linux磁盘空间扩容
2018-12-14 16:55:361. 虚拟机磁盘扩展 ...2. 开启虚拟机,查看磁盘空间以及磁盘已有编号 fdisk -l 确认磁盘是 /dev/sda 3. 添加磁盘分区 fdisk /dev/sda 输入 n ,然后输入 p ,使用默认值 敲击两下回车键 输入 t ... -
vbox磁盘空间扩容
2015-07-22 20:15:00前提:将虚拟机真正关机,不能在仅状态保存的场合做磁盘扩容。 步骤1.获取需要增加容量的映像的uuid 在vbox的安装目录下使用命令行:VBoxManage list hdds 得到结果如下: UUID: cf045eff-481a-44f8-ad45-4... -
linux服务器磁盘空间扩容
2019-12-12 19:09:27使用的网盘服务器(存放图片,pdf文件),用户上传资料过多,导致磁盘满。 默认linux只允许有4个主分区。 [root@localhost ~]# df -h Filesystem Size Used Avail Use% Mounted on /dev/mapper/centos-root 66G ... -
VMware 虚拟机中 Linux 系统磁盘空间扩容
2020-01-15 11:36:16在虚拟机中使用 Linux 系统时,常常发现前期规划的磁盘空间不够用,本以为直接修改机器配置,修改磁盘大小可以解决问题,但实操发现不是这么回事,还需要一堆操作才能扩容成功,这篇就来详细说说如何扩容的操作。... -
虚拟机里的linux磁盘空间扩容
2019-09-05 12:15:44之前给虚拟机里装了linux系统,但是安装的时候没有想太多,只分了20G,后来安装的东西越来越多,导致linux的磁盘空间不足了,所以就在网上找各种解决办法怎么扩容。如果只是重新再分一个区的话,比较简单的,但是我... -
raw,img格式虚拟机磁盘空间扩容
2020-04-21 17:03:48因为扩容的区域在未知空间里,需要重新格式化才能使用。显然,这背离了扩容的最初目的了 安装libguest 组建后 1、查看你想要扩展镜像中哪个盘,比如/dev/sda1 virt-filesystems --long -h --all -a /absolute/path/.... -
VMware虚拟机中Centos 6.x系统磁盘空间扩容实战
2020-12-23 16:48:37平常在VMware上创建Linux系统虚拟机的时候,往往当时不会给太多的磁盘空间,在后期的使用过程中经常会遇到磁盘空间不足的情况,所以需要对Linux系统扩展磁盘空间。 扩展磁盘步骤: 1.磁盘扩展 注意:只能在... -
VirtualBox虚拟磁盘空间扩容问题
2015-08-20 14:47:42VirtualBox虚拟磁盘空间不够了,默认10G。想扩大,图形界面下没有找到可操作菜单。Google了一下用 Vbox自带的命令工具VBoxManage即可解决。为虚拟机硬盘扩容(OracleVM VirtualBox)VBoxManage modifyhd <uuid>... -
Ubuntu18.04分区目录磁盘空间扩容
2020-03-11 18:08:44即sda6与sda7之间 New Size表示当前分区的容量,若要压缩该分区,该值需要减去压缩值 Free Space following代表从sda7压缩 N MB,在sda7的下方 需要不断的进行压缩和扩充,直至将磁盘空间移动到想要扩充的分区下面。