Increase centos6.5 disk capacity under VM

Source: Internet
Author: User
Refer to the blog post: http://www.cnblogs.com/sixiweb/p/3360008.htmledit settings, modify the hard disk size, root@localhost.pdf] # Fdisk-l # View disk partitions

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 = cylinders of 16065*512 = 8225280 bytesSector size (logical/physical): 512 bytes/512 bytesI/O size (minimum/optimal): 512 bytes/512 bytesDisk identifier: 0x000efc13 Device Boot Start End Blocks Id System # Current disk allocation/dev/sda1 * 1 64 512000 83 Linux # primary Partition 1 does not end on cylinder boundary. /dev/sda2 64 1045 7875584 8e Linux LVM # Extended partition/dev/sda3 1045 6527 44039519 + 8e Linux LVM # Extended partition Disk/dev/mapper/VolGroup-lv_root: 51.2 GB, 51229229056 bytes 255 heads, 63 sectors/track, 6228 cylindersUnits = cylinders of 16065*512 = 8225280 bytesSector size (logical/physical ): 512 bytes/512 bytesI/O size (minimum/optimal): 512 bytes/512 bytesDisk identifier: 0x00000000 Disk/dev/mapper/VolGroup-lv_swap: 855 MB, 855638016 bytes255 heads, 63 sectors/track, 104 cylindersUnits = cylinders of 16065*512 = 8225280 bytesSector size (logical/physical): 512 bytes/512 bytesI/O size (minimum/optimal ): 512 bytes/512 bytesDisk identifier: 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-compatible mode is deprecated. it's stronugly recommended to switch off the mode (command 'C') and change display units to sectors (command 'u '). command (m for help ):

Enter n and press enter. Add a partition

Command (m for help): nCommand action e extended p primary partition (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> vgextend VolGroup/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) 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.

Related Article

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.