How does VMware resize Linux hard disks?

Source: Internet
Author: User

How to adjust the hard disk size of a VMware Linux Virtual Machine VMware how to adjust the hard disk size of a Linux virtual machine if the hard disk space of a pre-Installed VMware Linux virtual machine is too small, it is quite troublesome to reinstall a new one. Search online method, the introduction is as follows: www.2cto.com A: Hard Disk resizing method: 1?vmware=a command line tool, vmware-vdiskmanager.exe, located in the vmware installation directory, such as C:/Program Files/VMware Workstation/vmware-vdiskmanager.exe. in the windows cmd window, go to the vmware installation directory: cd C:/Program Files/VMware Workstation/vmware-vdiskmanager.exe to view help www.2cto.com 2. for resizing, enter the following command: vmware-vdiskmanager-x 4 Gb "D:/VMware/WinXP/myLinux. vmdk "parameter"-x "indicates the disk space of the virtual machine to be extended, followed by the number to be extended (in this example To 4 GB, this is the total amount of a disk, including the original disk capacity ). Finally, it is the specific file of the Virtual Machine disk to be operated. If there is a space in the path name, it must be enclosed in double quotation marks. Press enter to start execution. After the execution is complete, exit the Command Prompt window and restart VMware. The hard disk space of the virtual machine is 4 GB. After the VM is restarted, it is found that the hard disk of the VM is 4 GB, but after entering the Linux system, use "df-ah" to check whether the hard disk space is as large as originally. This is because although the disk has been expanded, but the file system has not been partitiOned, the specified file system, so the Linux operating system cannot be identified (in fact, it is equivalent to your physical hard disk, although large, but you didn't partition it ). Next we will perform partition processing. Www.2cto.com 3. partition: 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 only have the original partitions. Run the following command: fdisk/dev/sda. "sda is the resized hard disk, which is a SCSI hard disk, and an IDE Hard Disk corresponds to hda, which is an operation on the hard disk." Type: m "list fdisk help" here we want to add a new partition, the part that will be expanded into a new partition, so that it can be identified by the operating system mounting. Type: n "command n is used to add a new partition", fdisk will ask you to choose to add a logical partition (number starting from 5) or a primary partition (Number 1 to 4 ). Select the primary partition, and then type p. Select logical partition and enter l. Select the primary partition, and enter "p" select create primary partition ". fdisk then allows you to select the ID of the primary partition. If sda1, sda2, select 3 as the number, that is, the partition to be created is sda3. at this time, fdisk will let you choose the Start value of the partition. This is the start cylinder value of the partition ); press enter. If you enter a non-default number, the space is wasted. At this time, enter w "to save all and exit, after partitioning 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 mkfs. ext3/dev/sda3 format the specified partition, 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 the new partition: 5. Mount the partition: manually mount, then type: mount/dev/sda3/home/work/"means to mount the new partition to the/home/work/directory." If the new partition is automatically mounted upon startup, modify the/etc/fstab file, add a line in this file:/dev/sda3/home/work ext3 defaults 0 1 "about the file format, I will write an article later to discuss "^_^". After each boot, the partition will be placed under the big work directory. You can use the new partition here. Www.2cto.com 2: Add a hard disk to the VM and attach 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 new one 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 will be used) x indicates a number, 1 to 4 indicates the primary Partition Number, and 5 or more 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. Vim/etc/fstab/dev/sdb1/work ext3 auto 0 1

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.