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 ...
随机推荐
- virtualbox+vagrant学习-4-Vagrantfile-7-WinRM Settings
WinRM Settings 配置命名空间config.winrm config.winrm配置与如何通过winrm配置vagrant访问你的Windows客户相关.与大多数vagrant设置一样,默 ...
- 【转】Maven项目模板
http://www.yiibai.com/maven/maven_project_templates.html maven 使用 Archetype 概念为用户提供不同类型的项目模板,它是一个非常大 ...
- yii2视频教材
http://www.weixistyle.com/ http://www.imooc.com/learn/743
- 数据包式套接字:基于UDP协议的Socket网络编程
步骤: 1.利用DatagramPacket封装数据包: 2.利用DatagramSocket发送数据包: 3.利用DatagramSocket接收数据包: 4.利用DatagramPacket处理数 ...
- Gradle Goodness: Parse Files with SimpleTemplateEngine in Copy Task
With the copy task of Gradle we can copy files that are parsed by Groovy's SimpleTemplateEngine. Thi ...
- EF Core 中多次从数据库查询实体数据,DbContext跟踪实体的情况
使用EF Core时,如果多次从数据库中查询一个表的同一行数据,DbContext中跟踪(track)的实体到底有几个呢?我们下面就分情况讨论下. 数据库 首先我们的数据库中有一个Person表,其建 ...
- 基于 Axis2的webService接口的基本开发步骤
Axis2webServicejavaWeb 前言: 今天给大家分享一下前段时间在做项目的时候做webservice接口的一些心得. 在web工程lib目录下导入 Axis2相关jar包 enter ...
- centos7字体中英文转化
[root@localhost oracle]#vi /etc/locate.conf,把里面的内容改为: 转化为英文: LANG="en_US.UTF-8"LANGUAGE=&q ...
- nodejs( koa2 )配置 browserHistory
前言 既然能搜到并且还点进来看这篇文章, 那么肯定是知道后台为什么要配置 browserHistory, 也肯定知道为什么非要去用相对来说更麻烦的吧browserHistory, 而不用更简单点的不需 ...
- 蓝桥杯第七届决赛(国赛)C++B组 第四题 机器人塔
机器人塔 X星球的机器人表演拉拉队有两种服装,A和B.他们这次表演的是搭机器人塔. 类似: A B B A B A A A B B B B B A BA B A B B A 队内的组塔规则 ...