VM increases centos6.5 Disk capacity

Source: Internet
Author: User

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

Edit settings, modify hard disk size

[[email protected] ~]# fdisk -l   #查看磁盘分区情况Disk  /DEV/SDA: 59.1 GB,  59055800320 bytes   #现有的磁盘容量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  # Allocation of existing disks/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 cylindersunits  = cylinders of 16065 * 512 = 8225280 bytesSector size  (logical/physical): 512 bytes / 512 bytesi/o size  (minimum/optimal):  512 bytes / 512 BYTESDISK IDENTIFIER: 0X00000000DISK /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

Turn off VMware's Linux system, set the original hard drive capacity, and boot.

#添加新分区, load new capacity on the raw capacity basis

[Email protected] ~]# fdisk/dev/sdawarning:dos-compatible mode is deprecated. It ' s strongly recommended to switch off the mode (command ' C ') and change display units to sectors (Comman d ' u '). Command (M for help):

Enter N, carriage return. Add a partition

Command (M for help): Ncommand action E Extended P primary partition (1-4)

Enter P, enter select Primary partition

Input 4, enter select Partition 4, because the above query to Sda1,sda2,sda3 has been used

Enter 8e, enter change to LVM

Enter W, return to save settings, and restart your computer

Format the new partition just after booting

[Email protected] ~]#

#实现扩容

[[email protected] ~]# LVM #进入lvm模式lvm > Pvcreate/dev/sda3 This is the partition that was initialized just now, must be lvm> vgextend Volgroup/dev/sda3              Add the initialized partition to the virtual volume Group Vg_dc01lvm>lvextend-l +29.9g/dev/vg_dc01/lv_root Expand the capacity of the existing volume (29.9G this number is explained later) Lvm>pvdisplay To view volume capacity, you will see a large volume lvm>quit exit

[Email protected] ~]# Resize2fs/dev/mapper/volgroup-lv_root

Re-enter Df-h to see the hard drive capacity

VM increases centos6.5 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.