VMware virtual Machine (Linux) increases root disk space transfer from

Source: Internet
Author: User
Tags hex code

Transfer from Http://wenku.baidu.com/link?url=WZDgESO0oXqYfhPYOWFalZsMglS0HKtLw7t6ICRs_sJ_ Sfpc85rpxsqkmwqsniis0qkpgcru5ooaxkhbgl4z-ehmeejjbx58lzhlgolyuzg

Today to check the school's monitoring and repair system, can not access the!!! The system is running slowly, using the top command to see the memory usage 90%, using "df-h" to View "/" Directory usage has reached 80%, causing the system to run very slowly. I expanded the root disk space in the following ways.

One, close your virtual machine system, find the following: select "Edit Virtual mache settings"-------hard disk--utility--extension--corresponding size

Second, use the Fdisk tool under Linux to partition.
Log in to your Linux system with the root user and view your system's partitions

#fdisk-L

The following information will appear

Device Boot Start End Blocks Id system/dev/sda1 * 1 64 512000 8 3 linux/dev/sda2 2611 20458496 8e Linux LVM
disk/dev/mapper/vg_zxw-lv_root:18.8 GB, 18832424960 bytes 255 heads, Sectors/track, 2289 cylinders Units = cylinders of 16065 * 8225280 = bytes Sector size (logical/physical): bytes/512 bytes I/o size (minimum/optimal): bytes /bytes Disk identifier:0x00000000

。。。。。。

According to the prompt information can be determined that the system's disk interface is SCSI, corresponding to "SDA" if the above red font is "HDA", then the system's disk interface for the IDE "HDA" so I do the operation

#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 (comm and ' U ').

command (M for help): m                    //"list fdisk help" Command action
   a    Toggle a bootable flag    b   edit BSD disklabel
   c   Toggle the DOS compatibility flag    d   Delete a partition
   l   list known parti tion types    m   Print this menu    n   add a new partition
    o   Create a new empty DOS partition table    p   Print the partition table  ;   q   quit without saving changes    s   create a new empty Sun disklabel

t change a partition ' s system ID u change display/entry units v Verify the partition Table W write table To disk and exit X extra functionality (experts only)
Command (M for help): N"Command n for adding a new Partition" command action E Extended
P primary partition (1-4)
P"Select Create Primary Partition" At this point,
Partition Number (1-4): 3FDISK will let you choose the number of the primary partition, if you already have the primary partition Sda1,sda2, then the number is 3, that is, the partition to be created is Sda3.
First cylinder (2611-3916, default 2611)://At this point, Fdisk will let you choose the starting value of the partition this is the start value of the partition (start cylinder); It is best to press ENTER directly, Using the default value 2611
Last cylinder, +cylinders or +size{k,m,g} (2611-3916, default 3916)://At this point, Fdisk will let you choose the start value of the partition this is the end of the partition The value here is best to press ENTER directly, Using the default value 3916

Command (M for help): W //w "Save all and exit, Partition complete"
The partition table has been altered!

Third, our new partition/dev/sda3, but not LVM. So, next use Fdisk to change it to LVM.

#fdisk/DEV/SDA

Command (M for help): M
Command (M for help): T //change partition system ID

Partition Number (1-4): 3 //Specify partition numbers
Hex Code (type L to list codes): 8e //Specifies the ID number to be changed, and 8e represents LVM.

Command (M for help): W

Four, restart the system, the landing system. (Be sure to restart the system, or you will not be able to expand the new partition)

V. Format the newly added partition:

#fdisk-L
Device Boot Start End Blocks Id system/dev/sda1 * 1 512000 Linux   /dev/sda2 2611 20458496 8e Linux lvm/dev/sda3 2611 3916 10483750 8e Linux LVM you will find one more partition.
#mkfs-T Ext3/dev/sda3Create the "ext3" file system on the hard disk partition "/dev/sda3".
Now we can use the new partition.

VI. expansion of new partitions #lvs
The #pvcreate/dev/sda3 //pvcreate directive is used to initialize a physical hard disk partition to a physical volume for use by LVM. To create a physical volume, you must first partition the hard disk and set the type of the hard disk partition to "8e" before you can use the Pvcreat directive to initialize the partition to a physical volume.

Physical volume "/dev/sda3" successfully created
#vgextend Volgroup00/dev/sda3 (which is the LVM group name that you currently need to expand, can be viewed through df-h, for example my:/dev/mapper/volgroup00-logvol00)// The vgextend directive is used for dynamic extended volume groups, which increase the capacity of a volume group by adding physical volumes to the volume group.

#vgdisplay //To display metadata information for a LNM volume group

---Volume Group---
VG Name vg_zxw System ID Format lvm2 Metadata areas 1 Metadata Seq Uence No 3
VG Access read/write VG Status resizable MAX LV 0 Cur LV 2 O Pen LV 2 Max PV 0 Cur PV 1 Act PV 1
VG size 19.51 GiB PE size 4.00 MiB Total PE 4994
Alloc pe/size 4994/19.51 GiB free pe/size 4994/10.01GB
VG UUID Sqbgts-ia8x-tcxz-kyxk-syws-tfxq-ubslar
(Main view free pe/size 4994/10.01GB, we can have up to 10.01GB of expansion space.) I generally choose less than 10.01GB)
# Lvextend-l+9.8g/dev/volgroup00/logvol00/dev/sda3
Logical Volume LogVol00 successfully resized
#e2fsck-a/dev/volgroup00/logvol00//use e2fsck instruction to check for file system errors.  You can also use the Fsck-t ext2-v/dev/sda3/to check the ext2 file system. (Do fsck, check the file system)
#resize2fs/dev/volgroup00/logvol00//resize2fs instruction is used to increase or shrink the size of the "EXT2/EXT3" file system that is not loaded.
#df-H//Check your system disk space "/" Directory becomes 40GB
OK, that's it.

VMware virtual Machine (Linux) increases root disk space transfer from

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.