vbox虚拟机扩容(CentOS 7.2)
... //Omitted.
Error Summary
-------------
Disk Requirements:
At least 1988MB more space needed on the / filesystem. [root@zlm2 :: ~]
#df -h
Filesystem Size Used Avail Use% Mounted on
/dev/mapper/centos-root .3G .1G .2G % / //Only 1.2G free space left.
devtmpfs 911M 911M % /dev
tmpfs 921M 921M % /dev/shm
tmpfs 921M 8.3M 912M % /run
tmpfs 921M 921M % /sys/fs/cgroup
/dev/sda1 497M 164M 334M % /boot
none 80G 27G 53G % /vagrant
tmpfs 185M 185M % /run/user/
- Halt the virtual machine first,and then add a vdi disk from the original disk(vmdk) in windows cmd cli.
C:\Users\Administrator>cd F:\Program Files\Oracle\VirtualBox C:\Users\Administrator>F: F:\Program Files\Oracle\VirtualBox>VBoxManage clonehd "G:\VirtualBox VMs\zlm2\centos-vm-disk1.vmdk" "G:\VirtualBox VMs\zlm2\centos-vm-disk1.vdi" --format vdi
%...%...%...%...%...%...%...%...%...%...%
Clone medium created in format 'vdi'. UUID: 63be4ac1-48a1-4b52-848f-71933c6c4adc F:\Program Files\Oracle\VirtualBox>VBoxManage modifyhd "G:\VirtualBox VMs\zlm2\centos-vm-disk1.vdi" --resize (default "M")
%...%...%...%...%...%...%...%...%...%...% F:\Program Files\Oracle\VirtualBox>exit
- Restart the virtual machine and then add a new partition.
[root@zlm2 :: ~]
#fdisk -l Disk /dev/sda: 31.5 GB, bytes, sectors
Units = sectors of * = bytes
Sector size (logical/physical): bytes / bytes
I/O size (minimum/optimal): bytes / bytes
Disk label type: dos
Disk identifier: 0x0000ca5e Device Boot Start End Blocks Id System
/dev/sda1 * Linux
/dev/sda2 8e Linux LVM Disk /dev/mapper/centos-root: MB, bytes, sectors
Units = sectors of * = bytes
Sector size (logical/physical): bytes / bytes
I/O size (minimum/optimal): bytes / bytes Disk /dev/mapper/centos-swap: MB, bytes, sectors
Units = sectors of * = bytes
Sector size (logical/physical): bytes / bytes
I/O size (minimum/optimal): bytes / bytes [root@zlm2 :: ~]
#fdisk /dev/sda
Welcome to fdisk (util-linux 2.23.). Changes will remain in memory only, until you decide to write them.
Be careful before using the write command. Command (m for help): p Disk /dev/sda: 31.5 GB, bytes, sectors
Units = sectors of * = bytes
Sector size (logical/physical): bytes / bytes
I/O size (minimum/optimal): bytes / bytes
Disk label type: dos
Disk identifier: 0x0000ca5e Device Boot Start End Blocks Id System
/dev/sda1 * Linux
/dev/sda2 8e Linux LVM Command (m for help): n
Partition type:
p primary ( primary, extended, free)
e extended
Select (default p): p
Partition number (,, default ):
First sector (-, default ):
Using default value
Last sector, +sectors or +size{K,M,G} (-, default ):
Using default value
Partition of type Linux and of size 19.5 GiB is set Command (m for help): t
Partition number (-, default ):
Hex code (type L to list all codes): L Empty NEC DOS Minix / old Lin bf Solaris
FAT12 Hidden NTFS Win Linux swap / So c1 DRDOS/sec (FAT-
XENIX root Plan Linux c4 DRDOS/sec (FAT-
XENIX usr 3c PartitionMagic OS/ hidden C: c6 DRDOS/sec (FAT-
FAT16 <32M Venix Linux extended c7 Syrinx
Extended PPC PReP Boot NTFS volume set da Non-FS data
FAT16 SFS NTFS volume set db CP/M / CTOS / .
HPFS/NTFS/exFAT 4d QNX4.x Linux plaintext de Dell Utility
AIX 4e QNX4.x 2nd part 8e Linux LVM df BootIt
AIX bootable 4f QNX4.x 3rd part Amoeba e1 DOS access
a OS/ Boot Manag OnTrack DM Amoeba BBT e3 DOS R/O
b W95 FAT32 OnTrack DM6 Aux 9f BSD/OS e4 SpeedStor
c W95 FAT32 (LBA) CP/M a0 IBM Thinkpad hi eb BeOS fs
e W95 FAT16 (LBA) OnTrack DM6 Aux a5 FreeBSD ee GPT
f W95 Ext'd (LBA) 54 OnTrackDM6 a6 OpenBSD ef EFI (FAT-12/16/
OPUS EZ-Drive a7 NeXTSTEP f0 Linux/PA-RISC b
Hidden FAT12 Golden Bow a8 Darwin UFS f1 SpeedStor
Compaq diagnost 5c Priam Edisk a9 NetBSD f4 SpeedStor
Hidden FAT16 < SpeedStor ab Darwin boot f2 DOS secondary
Hidden FAT16 GNU HURD or Sys af HFS / HFS+ fb VMware VMFS
Hidden HPFS/NTF Novell Netware b7 BSDI fs fc VMware VMKCORE
AST SmartSleep Novell Netware b8 BSDI swap fd Linux raid auto
1b Hidden W95 FAT3 DiskSecure Mult bb Boot Wizard hid fe LANstep
1c Hidden W95 FAT3 PC/IX be Solaris boot ff BBT
1e Hidden W95 FAT1 Old Minix
Hex code (type L to list all codes): 8e
Changed type of partition 'Linux' to 'Linux LVM' Command (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 : Device or resource busy.
The kernel still uses the old table. The new table will be used at
the next reboot or after you run partprobe() or kpartx()
Syncing disks. [root@zlm2 :: ~]
#partprobe [root@zlm2 :: ~]
#fdisk -l Disk /dev/sda: 31.5 GB, bytes, sectors
Units = sectors of * = bytes
Sector size (logical/physical): bytes / bytes
I/O size (minimum/optimal): bytes / bytes
Disk label type: dos
Disk identifier: 0x0000ca5e Device Boot Start End Blocks Id System
/dev/sda1 * Linux
/dev/sda2 8e Linux LVM
/dev/sda3 8e Linux LVM Disk /dev/mapper/centos-root: MB, bytes, sectors
Units = sectors of * = bytes
Sector size (logical/physical): bytes / bytes
I/O size (minimum/optimal): bytes / bytes Disk /dev/mapper/centos-swap: MB, bytes, sectors
Units = sectors of * = bytes
Sector size (logical/physical): bytes / bytes
I/O size (minimum/optimal): bytes / bytes
- Create a new PV,add to the original VG and then extend the VG.
[root@zlm2 :: ~]
#pvdisplay | grep "VG Name"
VG Name centos [root@zlm2 :: ~]
#pvcreate /dev/sda3
Physical volume "/dev/sda3" successfully created [root@zlm2 :: ~]
#pvdisplay | grep "VG Name"
VG Name centos
VG Name [root@zlm2 :: ~]
#vgextend centos /dev/sda3
Volume group "centos" successfully extended
- Check the information logical partition.
[root@zlm2 :: ~]
#cat /etc/fstab #
# /etc/fstab
# Created by anaconda on Wed Jan ::
#
# Accessible filesystems, by reference, are maintained under '/dev/disk'
# See man pages fstab(), findfs(), mount() and/or blkid() for more info
#
/dev/mapper/centos-root / xfs defaults
UUID=461cd9c0-513e-48db-bb08-d07a8f6ef260 /boot xfs defaults
/dev/mapper/centos-swap swap swap defaults
- Extend the new PV into the original logical partition and expand it.
[root@zlm2 :: ~]
#lvextend /dev/mapper/centos-root /dev/sda3
Size of logical volume centos/root changed from 8.26 GiB ( extents) to 27.79 GiB ( extents).
Logical volume root successfully resized. [root@zlm2 :: ~]
#resize2fs /dev/mapper/centos-root //Resizes only for ext2/ext3/ext4 filesystem.
resize2fs 1.42. (-Dec-)
resize2fs: Bad magic number in super-block while trying to open /dev/mapper/centos-root
Couldn't find valid filesystem superblock. [root@zlm2 :: ~]
#xfs_growfs /dev/mapper/centos-root //Expands an existing XFS filesystem.
meta-data=/dev/mapper/centos-root isize= agcount=, agsize= blks
= sectsz= attr=, projid32bit=
= crc= finobt=
data = bsize= blocks=, imaxpct=
= sunit= swidth= blks
naming =version bsize= ascii-ci= ftype=
log =internal bsize= blocks=, version=
= sectsz= sunit= blks, lazy-count=
realtime =none extsz= blocks=, rtextents=
data blocks changed from to
- Check the diskspace again with "df -h" again.
[root@zlm2 :: ~]
#df -h
Filesystem Size Used Avail Use% Mounted on
/dev/mapper/centos-root 28G .5G 21G % /
devtmpfs 911M 911M % /dev
tmpfs 921M 921M % /dev/shm
tmpfs 921M 8.4M 912M % /run
tmpfs 921M 921M % /sys/fs/cgroup
/dev/sda1 497M 164M 334M % /boot
none 80G 29G 51G % /vagrant
tmpfs 185M 185M % /run/user/
vbox虚拟机扩容(CentOS 7.2)的更多相关文章
- Linux Centos虚拟机扩容
Linux Centos虚拟机扩容(/dev/mapper/centos-root) 1:.首先查看我们的根分区大小是多少 df -h 文件系统 类型 容量 已用 可用 已用% 挂载点``/dev/m ...
- 主机通过host-only虚拟网卡连接VBOX虚拟机
主机通过host-only虚拟网卡连接VBOX虚拟机 How to set up host-only virtual machines that host can access it... 问题 因为 ...
- vbox 虚拟机共享文件夹 debian
主机64位windows7 虚拟机Debian 8 64位 注意:在网络更新时,可能需要修改 etc/apt/sources.list 文件,把前几条从CD更新删除掉,这样就会从网络更新 1.vbox ...
- Mac系统下使用VirtualBox虚拟机安装win7--第一步 安装vbox虚拟机
Mac系统下使用VirtualBox虚拟机安装win7操作步骤: 第一步 安装vbox虚拟机 1.先下载vbox,下载地址:: https://www.virtualbox.org/wiki/Down ...
- VMware虚拟机的CentOS无法上网的解决方法
前言:由于Linux下很多软件安装必须网络环境下进行,因此,对于如何在VMware下进行上网,我折腾了至少三天,今天上午,也即五一劳动节,终于搜到一遍技术文章,经过自己实践,VMware下Linux的 ...
- VMware虚拟机扩容
作者:金良(golden1314521@gmail.com) csdn博客:http://blog.csdn.net/u012176591 用了一段Linux虚拟机.发现安装虚拟机时分配的空间不够用, ...
- 虚拟机环境Centos如何上网
虚拟机环境Centos如何上网----------by ruffianfish.痞子鱼 因为我是用的虚拟机的环境,所以一切操作角度从虚拟机出发. 虚拟机环境的优点: 适合新手学习linux 永远不要怕 ...
- VM虚拟机安装centos,同网段,局域网能访问
VM虚拟机安装centos,同网段,局域网能访问. 首先下载虚拟机镜像文件,自行下载 安装,网络模式为桥接,设置dhcp为主机同网段 保持VM服务开启 开机就是同网段了
- 虚拟机搭建CentOS主机win10通过xshell连接
目标:主机是win10系统,虚拟机搭建CentOS,在主机上通过XShell连接操作. 第一步 主机上安装虚拟机 第二步 下载CentOS 下载地址http://101.110.118.69/isor ...
随机推荐
- Python--BeautifulSoup库安装
1.BeautifulSoup简介 BeautifulSoup库通过解析文档可以获取网页文档中所需的数据,方便用户从HTML或XHTML文档中提取数据,作为python的一个辅助工作,也是爬虫实践中的 ...
- OpenGL之位图的绘制和gluOrtho2D等函数详解
位图绘制 先来段代码吧: #include <iostream> #include <gl/glut.h> using namespace std; #pragma comme ...
- Infiniband基本知识
InfiniBand架构是一种支持多并发链接的“转换线缆”技术,在这种技术中,每种链接都可以达到2.5 Gbps的运行速度.这种架构在一个链接的时候速度是500 MB/秒,四个链接的时候速度是2 GB ...
- SSIS Debug
プロジェクト=>最后一项[DEPJ1200プロパテイページ] 1.配置...=>CreaeDeploymentUtility=True2.デパッグ=>Run64BiRuntime=f ...
- 【题解】洛谷P1080 [NOIP2012TG] 国王游戏(贪心+高精度)
次元传送门::洛谷P1080 思路 我们模拟一下只有两个大臣的时候发现 当a1∗b1<a2∗b2是ans1<ans2 所以我们对所有大臣关于左右手之积进行排序 得到最多钱的大臣就是 ...
- linux--yum源,源码包
一.企业版 搜狐:http://mirrors.sohu.com/ 网易:http://mirrors.163.com/ 阿里云:http://mirrors.aliyun.com/ 腾讯:http: ...
- .net core 实践笔记(一)--开篇
** 温馨提示:如需转载本文,请注明内容出处.** 本文链接:https://www.cnblogs.com/grom/p/9902000.html 最近无聊自己设计了一个小项目,基本都使用想用没用 ...
- (Les16 执行数据库恢复)-重做日志文件恢复
丢失重做日志文件 丢失了重做日志文件组中的某个成员,并且组中至少还有一个成员: -不会影响实例的正常操作. -预警日志中会收到一条信息, ...
- android学习:Android上面部署Apache FTPServer
经过了几天的研究,终于Apache FTPServer在Android的配置和使用上有了一些心得,现在分享出来,提供给大家参考,说到这儿又不得不吐槽一下这要命的转载了,找Apache FTPServe ...
- Spring boot 零配置开发微服务
2018年12月29日星期六 体验Spring boot 零配置开发微服务 1.为什么要用Spring boot? 1.1 简单方便.配置少.整合了大多数框架 1.2 适用于微服务搭建,搭建的微服务 ...