VM增加centos6.5磁盘容量
2015-07-29 17:40
711 查看
参考博文:http://www.cnblogs.com/sixiweb/p/3360008.html
编辑设置,修改硬盘大小
#添加新分区,在原容量基础上加载新容量
输入4,回车 选择分区4,因为上面查询到sda1,sda2,sda3都已经被使用
输入8e,回车 更改为lvm
输入w,回车 保存设置,然后重启电脑
开机后格式化刚才的新分区
编辑设置,修改硬盘大小
[root@localhost ~]# fdisk -l #查看磁盘分区情况 Disk /dev/sda: 59.1 GB, 59055800320 bytes #现有的磁盘容量 255 heads, 63 sectors/track, 7179 cylinders Units = cylinders of 16065 * 512 = 8225280 bytes Sector size (logical/physical): 512 bytes / 512 bytes I/O size (minimum/optimal): 512 bytes / 512 bytes Disk identifier: 0x000efc13 Device Boot Start End Blocks Id System #现有磁盘的分配情况 /dev/sda1 * 1 64 512000 83 Linux #主分区 Partition 1 does not end on cylinder boundary. /dev/sda2 64 1045 7875584 8e Linux LVM #扩展分区 /dev/sda3 1045 6527 44039519+ 8e Linux LVM #扩展分区 Disk /dev/mapper/VolGroup-lv_root: 51.2 GB, 51229229056 bytes 255 heads, 63 sectors/track, 6228 cylinders Units = cylinders of 16065 * 512 = 8225280 bytes Sector size (logical/physical): 512 bytes / 512 bytes I/O size (minimum/optimal): 512 bytes / 512 bytes Disk identifier: 0x00000000 Disk /dev/mapper/VolGroup-lv_swap: 855 MB, 855638016 bytes 255 heads, 63 sectors/track, 104 cylinders Units = cylinders of 16065 * 512 = 8225280 bytes Sector size (logical/physical): 512 bytes / 512 bytes I/O size (minimum/optimal): 512 bytes / 512 bytes Disk identifier: 0x00000000关闭VMWARE的linux系统,设置原有硬盘容量后开机。
#添加新分区,在原容量基础上加载新容量
[root@localhost ~]# fdisk /dev/sda WARNING: DOS-compatible mode is deprecated. It's strongly recommended to switch off the mode (command 'c') and change display units to sectors (command 'u'). Command (m for help):输入n,回车。新增一个分区
Command (m for help): n Command action e extended p primary partition (1-4)输入P,回车 选择主分区
输入4,回车 选择分区4,因为上面查询到sda1,sda2,sda3都已经被使用
输入8e,回车 更改为lvm
输入w,回车 保存设置,然后重启电脑
开机后格式化刚才的新分区
[root@localhost ~]##实现扩容
[root@localhost ~]# lvm #进入lvm模式 lvm> pvcreate /dev/sda3 这是初始化刚才的分区,必须的 lvm> vgextend VolGroup /dev/sda3 将初始化过的分区加入到虚拟卷组vg_dc01 lvm>lvextend -L +29.9G /dev/vg_dc01/lv_root 扩展已有卷的容量(29.9G这个数字在后面解释) lvm>pvdisplay 查看卷容量,这时你会看到一个很大的卷了 lvm>quit 退出
[root@localhost ~]# resize2fs /dev/mapper/VolGroup-lv_root再输入df -h 查看一下硬盘容量
相关文章推荐
- Linux基本命令
- Linux常用命令大全2
- Linux C/C++ 内存泄漏检测工具:Valgrind
- Linux系统调用--mmap/munmap函数详解
- kickstart+pxe无人值守安装linux
- kickstart+pxe无人值守安装linux
- tar.xz如何解压:linux和windows下tar.xz解压命令介绍
- 『归档』 初始化Linux一些主要应用的常用配置
- Linux下加强BGP路由协议安全的措施
- centos中文乱码问题
- Linux下的内核测试工具——perf使用简介
- linux C++ 面向对象线程类封装
- linux 文件转码
- linux下编译支持librtmp、libx264、libfaac的ffmpeg
- Linux常用命令大全
- 转载_Linux下Bluetooth编程
- 关于在redhat的linux系统下安装sunjdk问题
- 在Linux系统中使用Gitblit工具创建Git仓库的方法
- Perf -- Linux下的系统性能调优工具,第 2 部分
- Linux磁盘分区简介及分区