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 ...
随机推荐
- jquery全选 反选
//全选 反选 $('#chkAll').on('click',function(){ $('input.chkbox').prop('checked',$(this).prop('checked') ...
- use tool wget for windows download
1.什么是wget Wget是一个在网络上进行下载的简单而强大的自由软件,其本身也是GNU计划的一部分.它的名字是"World Wide Web"和"Get"的 ...
- js实现限制上传文件大小
<html> <head> <script type="text/javascript"> var isIE = /msie/i.test(na ...
- ASP.NET Core AD 域登录 (转载)
在选择AD登录时,其实可以直接选择 Windows 授权,不过因为有些网站需要的是LDAP获取信息进行授权,而非直接依赖Web Server自带的Windows 授权功能. 当然如果使用的是Azure ...
- HDFS的Write过程
hadoop中重要的组成部分HDFS,它所发挥的重要作用是进行文件的后端存储.HDFS针对的是低端的服务器,场景为读操作多.写操作少的情况.在分布式存储情况下,比较容易出现的情况是数据的损害,为了保证 ...
- Kmalloc和Vmalloc的区别
kmalloc()和vmalloc()介绍kmalloc()用于申请较小的.连续的物理内存1. 以字节为单位进行分配,在<linux/slab.h>中2. void *kmalloc(si ...
- 理解Web应用程序的代码结构和运行原理(3)
1.理解Web应用程序的运行原理和机制 Web应用程序是基于浏览器/服务器模式(也称B/S架构)的应用程序,它开发完成后,需要部署到Web服务器上才能正常运行,与用户交互的客户端是网页浏览器. 浏览器 ...
- Oracle 执行计划的查看方式
访问数据的方法:一.访问表的方法:1.全表扫描,2.ROWID扫描 二.访问索引的方法:1.索引唯一性扫描,2.索引范围扫描,3.索引全扫 ...
- python 基础 切片 迭代 列表生成式
对list 进行切片 如列表 L = ['Adam', 'Lisa', 'Bart', 'Paul'] L[0:3] ['Adam', 'Lisa', 'Bart'] L[0:3]表示,从索引0开始取 ...
- 1001. 温度转换 (Standard IO)
1001. 温度转换 (Standard IO) 时间限制: 1000 ms 空间限制: 262144 KB 具体限制 题目描述 将输入的华氏温度转换为摄氏温度.由华氏温度F与摄氏温度C的转换 ...