Resize vmware workstation hard disk space

Source: Internet
Author: User
Tags gparted

1. Adjust the original Hard Disk

 

The interface does not provide a way to increase the disk capacity. It can only be executed in the command line format.

 

There is a vmware-vdiskmanager.exe program under the vmwareinstallation directory. It is a command line tool that can be used to modify the size of the virtual machine's hard disk.

The method is as follows:

Step 1: Press win + R to bring up the run dialog box, enter "cmd", and press enter to start the Command Prompt window.

 

Step 2: Go to the VMware installation directory (for example, my installation directory is C:/program files (x86)/vmware workstation ), enter "vmware-vdiskmanager" at the command prompt and press the Enter key without any parameters. The command description is displayed.

Step 3: run a command similar to the following: vmware-vdiskmanager-x l6gb "dvmwarewinxpwindows XP Professional. vmdk "parameter"-X "indicates the disk space of the virtual machine to be extended, followed by the number to be extended (in this example, it is extended to 16 GB, which is the total disk volume, including the original disk capacity ). Finally, the specific file of the Virtual Machine disk to be operated is specified. Because there is space in the path name, it must be enclosed in double quotation marks. Press the Enter key to start execution. After the execution is complete, exit the Command Prompt window and restart VMware. The virtual machine hard disk space has changed to 16 GB.

If the original Virtual Machine hard disk has been divided into multiple partitions, after vmware-vdiskmanager.exe expands the hard disk space, it is necessary to install a third-party partition tool in the system to adjust the Virtual Machine partition. For more information, see: http://www.vmware.com/support/KB/enduser/std_adp.php? P_faqid = 1647

It should be emphasized that the effect after the hard disk size is adjusted is equivalent to increasing the number of cylinders of the original physical hard disk. Therefore, the file system will not automatically increase. You need to resize the file system again. Different systems in this step have different methods. For example

1. If the guest OS is a win series, you can use partion magic to implement

2. If the guest OS is a Linux series, you can use resize2fs to expand the ext2/3 Format File System.

3. If guset OS is another UNIX system, you can add new partitions to the file tree to expand the original file system.

How to add a disk through VM: In the menu bar where there is a "VM", click "Settings" in "VM" or press the shortcut key "Ctrl + D ", click "add" to add a "hard disk ". after entering the system, right-click my computer and select "manage". Then, select "disk management" in "Storage ". After formatting the newly added hard disk, you can add another drive letter = the size of your original hard disk has been expanded

 

Summary:

1. The file name should be enclosed in double quotation marks.

2. The vmdk file name must be included with the path.

3. GB, MB. Don't forget B.

 

 

Using Log File C:/docume ~ 1/admini ~ 1/locals ~ 1/temp/vmware-Administrator/vdiskmana

Ger. Log

Grow: 100% done.

The old geometry C/h/s of the disk is: 1044/255/63

The new geometry C/h/s of the disk is: 1566/255/63

Disk expansion completed successfully.

Warning: If the virtual disk is partitioned, you must use a third-party

Utility in the virtual machine to expand the size of

Partitions. For more information, see:

Http://www.vmware.com/support/kb/enduser/std_adp.php? P_faqid = 1647

 

After restarting the virtual machine, we found that the hard disk of the virtual machine had changed to 16 GB, but after entering the Linux system, we used "DF-ah" to check whether the hard disk space was as large as originally.

Although the disk has been expanded, but the file system has not been partitioned and specified, the Linux operating system cannot be identified (in fact, it is equivalent to your hard disk although it is large, but you didn't partition it ). Next we will perform partition processing.

Partition:

Method 1: Mount

Fdisk command: fdisk-L: print the current disk partition table. At this time, we can see that the total number of disks has indeed increased to 4 GB, but the partitions are only those original partitions.

Run the following command: fdisk/dev/SDA. "SDA is the resized hard disk, which is a SCSI hard disk, and an ide-type hard disk is hda. This operation is performed on this hard disk"

Type: M "list fdisk help"

Here we want to add a new partition, which will be scaled out into a new partition, so that it can be identified by the operating system mounting.

Type: N "command n to add a new partition"

At this time, fdisk will let you choose to add as a logical partition (number starting from 5) or primary partition (Number 1 to 4 ). Select the primary partition, and then type P. Select logical partition and enter L.

We select the primary partition as follows:

Type: P "select create primary partition". fdisk will allow you to select the ID of the primary partition. If you already have sda1 and sda2, select 3, that is, the partition to be created is sda3.

Type: 3

At this time, fdisk will let you choose the start value of the partition. This is the start cylinder value of the partition. You 'd better press enter here,

If you enter a non-default number, the space is wasted;

At this point, type: W "Save all and exit, partition is completed"

We need to restart to find this partition. We cannot use this partition now. Why? Not formatted!

4. format the newly added partition:

Type: mkfs-T ext3/dev/sda3

Or format the specified partition in mkfs. ext3/dev/sda3, and so on. Most of the current systems are in the ext3 format. If you need other partitions, you can view the help of mkfs.

Now we can use this new partition:

5. Mount the partition:

Manually mount the partition, and enter Mount/dev/sda3/home/work/"to mount the new partition to the/home/work/directory, modify the/etc/fstab file and add a line in the file:

/Dev/sda3/home/work ext3 defaults, 0 1 "about the file format, write an article later to discuss ^_^"

After each boot, the partition will be mounted under the big work directory.

You can use the new partition here.

Method 2: Use gparted for partition adjustment, similar to PQ and PM in win system. One of gparted is to install gparted (SUDO apt-Get install gparted) on the existing Linux system) but in this case, the hard disk occupied by Linux cannot be adjusted. The other is to download the gparted disc on the gparted website and use the virtual machine to load the disc to start, after the startup, press enter to enter the gparted software running interface. At this time, the system disk occupied by Linux will also be in the adjustable state.

 

 

2. Add a hard disk to the virtual machine and mount it. This is equivalent to buying another hard disk, which can alleviate the shortage of disk space.

1. Start the VM, select "Edit Virtual Machine Settings", click "adding", and add a disk by default according to the wizard, which is usually a SCSI device. Specify the disk capacity, and restart the instance to enter the system. Root User operation:

2. fdisk-l will see a new setting. If you have a hard disk (sda1, sda2. ..), the newly added disk should be (/dev/sdb ).
It indicates that the system has identified this hard disk. Next we will partition and Format this hard disk. Fdisk/dev/SDB (if you add the IDE settings,
Hdx) X indicates a number, 1 to 4 indicates the number of the primary partition, and 5 or above indicates the logical partition. Specific information can be found online.

3. Partition formatting:

The operation is roughly the same as the preceding partition formatting. You only need to change/dev/SDA to/dev/SDB, and the subsequent operations are also the same.

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.