How to extend an LVM disk on a RHEL guest machine running on VMware host?
来源:互联网 发布:儿童学编程网 编辑:程序博客网 时间:2024/06/04 17:57
How to extend an LVM disk on a RHEL guest machine running on VMware host?
Environment
- Red Hat Enterprise Linux Guest
- Virtual Host
Issue
- How to extend an LVM disk on a Red Hat Enterprise Linux guest running on a virtual host?
- How do I to extend lvm in a virtual environment?
- Can I extend my virtual disk to increase lvm size
Resolution
1. Modify the underlying guest disk for the virtual machine based on instructions from the virtual host vendor.
2. Either reboot the system or initiate a rescan of the SCSI device, (RHEL5), (RHEL6), (RHEL7).
3. Check to see if the underlying device has changed after the modifications to the guest disk have been made, for example, investigating the size of/dev/sda
:
# fdisk -l /dev/sdaDisk /dev/sda: 160.0 GB, 160000000000 bytes:
4. Create a new partition using fdisk /dev/sda
. For more information refer to the following knowledge base article:
How do you use fdisk to add a primary partition?
or Use parted to add a primary partition, in virtual environments such as RHEV this has proven more reliable.
NOTE: Red Hat recommends that all critical data be backed up and verified before making any changes to the underlying storage, or filesystem as an unforeseen problem might occur.
5. Read disk and try to add all partitions to the system.
# partx -v -a /dev/sda
6. Check the device nodes for /dev/sda itself and the partitions on it
# ls /dev/sda*
7. Once a new partition has been created, create a new physical volume and add it to the existing volume group:
# pvcreate /dev/sda3# vgextend VolGroup00 /dev/sda3
8. Verify how many free space are available to the Volume Group:
# vgdisplay VolGroup00 | grep Free
9. Extend the logical volume by the amount of free space.
# lvextend -l +<Free number of PE> /dev/VolGroup00/LogVol00or # lvextend -L +<Size> /dev/VolGroup00/LogVol00
The -l
flag will extend or set the logical volume size in units of logical extents. The-L
flag will extend or set the logical volume size in units of megabytes. A size suffix of M for megabytes, G for gigabytes, T for terabytes, P for petabytes or E for exabytes is optional. With the ’+’ sign the value is added to the actual size of the logical volume and without it, the value is taken as an absolute one.
[See the lvextend(8) man page for more information on options]
10. Issue the resize2fs
command to resize the filesystem:
# resize2fs /dev/VolGroup00/LogVol00
If using Rhel 7, then the command differs, as Red Hat Enterprise Linux 7 uses xfs as the default filesystem
# xfs_growfs /dev/VolGroup00/LogVol00
11. Verify that the additional space has been added to the logical volume
# df -h
- How to extend an LVM disk on a RHEL guest machine running on VMware host?
- How to dd a remote disk using SSH on local machine and save to a local disk
- How To Add a New Disk(s) to An Existing Diskgroup on RAC (Best Practices).
- How to configure Red Hat Cluster using KVM fencing with two guest VM's running on a IBM PowerKVM
- How to Configure Hard Disk Drives on a CEPC
- How to fix Metric Collection Errors in OEM 11g running on OEL-5/RHEL-5
- attack lab running on a illegal host
- How to visualize disk usage on Linux
- How to search an 3A+ movie on internet?
- How To Resize An ASM Disk On Release 10.2.0.X
- How to determine if running on Emulator?
- How to running hadoop mapreduce on tachyon
- How to resolve: The PsExec service running on ?????????????? is an incompatible version.
- How To Install Speedtest-cli On a CentOS / RHEL / Scientific / Fedora Linux To Check Internet Speed
- How to Install and Configure a VNC Server on RedHat Enterprise Linux (RHEL) 6
- Resizing the disk space on Ubuntu Server VMs running on VMware ESXi 5
- How to grant access to SQL logins on a standby database when the guest user is disabled in SQL Serve
- How to create a VM on a specified host with openstack
- 1033. To Fill or Not to Fill (25)(加深对贪心的理解!!!)
- 兼容所有浏览器的JQuery zClip插件实现复制到剪贴板功能
- elasticsearch-head插件
- CS231n课程笔记翻译:神经网络笔记2
- log4j
- How to extend an LVM disk on a RHEL guest machine running on VMware host?
- 架构设计:系统间通信(32)——其他消息中间件及场景应用(下2)
- 变焦与对焦
- 【设计模式小结】—-创建型模式
- 限制拖放UEditor的宽度不超过它的父容器大小
- python--一些mark
- TextView的drawableLeft使用选择器不起作用的解决办法
- 使用pydicom读取dicom文件,并对文件做一些简单操作
- Android 自制短信发送器