Increase centos6.5 disk capacity under VM

Source: Internet
Author: User

Increase centos6.5 disk capacity under VM

Reference blog: http://www.cnblogs.com/sixiweb/p/3360008.html

Edit settings and modify hard disk size

[Root @ localhost ~] # Fdisk-l # view Disk partitions Disk/dev/sda: 59.1 GB, 59055800320 bytes # existing Disk capacity: 255 heads, 63 sectors/track, 7179 cylindersUnits = cylindersof16065 * 512 = 8225280 bytesSectorsize (logical/physical): 512 bytes/512 bytesI/Osize (minimum/optimal): 512 bytes/512 bytesDiskidentifier: 0x000efc13DeviceBootStartEndBlocksIdSystem # current disk allocation/dev/sda1 * 16451200083 Linux # primary partition Partition1doesnotendoncylinderboundary. /dev/sda1_104578755848elinuxlvm # extended partition/dev/sda31_565271_39519 + 8 eLinuxLVM # extended partition Disk/dev/mapper/VolGroup-lv_root: 51.2 GB, clerk, 63 sectors/track, 6228 cylindersUnits = cylindersof16065 * 512 = 8225280 bytesSectorsize (logical/physical): 512 bytes/512 bytesI/Osize (minimum/optimal): 512 bytes/512 bytesDiskidentifier: 0x00000000Disk/dev/mapper/VolGroup-lv_swap: 855 MB, 855645016bytes255heads, 63 sectors/track, 104 cylindersUnits = cylindersof16065 * 512 = 8225280 bytesSectorsize (logical/physical ): 512 bytes/512 bytesI/Osize (minimum/optimal): 512 bytes/512 bytesDiskidentifier: 0x00000000

Shut down the VMWARE linux system, set the original hard disk capacity, and then start the system.

# Add a new partition and load the new partition based on the original capacity

[Root @ localhost ~] # Fdisk/dev/sdaWARNING: DOS-compatiblemodeisdeprecated.It 'sstronglyrecommendedtoswitchoffthemode (command 'C') andchangedisplayunitstosectors (command 'U'). Command (mforhelp ):

Enter n and press Enter. Add a partition

Command (mforhelp): nCommandactioneextendedpprimarypartition (1-4)

Enter P and press enter to select the primary partition.

Enter 4 and press enter to select partition 4, because sda1, sda2, and sda3 have all been used.

Enter 8e and press enter to change to lvm.

Enter w, press enter to save the settings, and then restart the computer.

Format the new partition after it is started.

[Root @ localhost ~] #

# Resizing

[Root @ localhost ~] # Lvm # Enter lvm mode lvm> pvcreate/dev/sda3. This is the partition just initialized, required lvm> vgextendVolGroup/dev/sda3 add initialized partitions to the virtual volume group vg_dc01lvm> lvextend-L + 29.9G/dev/vg_dc01/lv_root to expand the capacity of existing volumes (29.9G this number is explained later) lvm> pvdisplay to view the volume capacity, then you will see a large volume of lvm> quit to exit

[Root @ localhost ~] # Resize2fs/dev/mapper/VolGroup-lv_root

Enter df-h to check the disk capacity.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.