Expand disk partitions for Ubuntu in vmwarevm

Source: Internet
Author: User
Tags disk usage

I installed Ubuntu with VMware and chose 20 GB space during installation. During usage, I found that 20 GB space is far from enough. The best way is to reinstall it, however, since the Android source code already exists, it is more troublesome to download it again, so I decided to resize the virtual machine.
 
1. Change the Virtual Disk size
 
First, shut down the ubuntu of the VM, and then use vmware's hard disk adjustment tool vmware-vdiskmanager.exe to change the size of the virtual disk. This tool is under the installation directory of vmware.
 
In the dos environment, enter the following command:
 
Vmware-vdiskmanager-x 80 Gb "E: \ androidVirtualMachines \ myandroid \ Ubuntu2.vmdk"
 
The-x parameter increases the storage space for the virtual machine, and the number following it indicates the size of the storage space.
 
The quotation marks should be in the installation directory of the virtual machine. The file type is vmdk.
 
2. view disk usage
 
Restart the VM. At the ubuntu prompt, enter the df command to view the disk usage and the location where the file system is mounted.
 
$ Df-h
 
File System capacity used available % mount point
 
// Dev/sda1 19G 3.6G 15G 20%/
 
None 1.5G 252 K 1.5G 1%/dev
 
None 1.5G 252 K 1.5G 1%/dev/shm
 
None, 1.5G, 88 K, 1.5G, 1%/var/run
 
None 1.5G 0 1.5G 0%/var/lock
 
None 1.5G 0 1.5G 0%/lib/init/rw
 
3. view the disk device name
 
$ Sudo fdisk-l
 
Disk/dev/sda: 25.9 GB, 25899345920 bytes
 
255 heads, 63 sectors/track, 10443 cylinders
 
Units = cylinders of 16065*512 = 8225280 bytes
 
Sector size (logical/physical): 512 bytes/512 bytes
 
I/O size (minimum/optimal): 512 bytes/512 bytes
 
Disk identifier: 0x0001be23
 
Device Boot Start End Blocks Id System
 
/Dev/sda1*1 2497 20051968 83 Linux
 
/Dev/sda2 2497 2611 916481 5 Extended
 
/Dev/sda5 2497 2611 916480 82 Linux swap/Solaris
 
Hard Disk device name:/dev/sda, size: 26 GB divided into three Ubuntu Hard Disk Partitions

  • 1
  • 2
  • 3
  • Next Page

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.