in the process of use, you often encounter virtual machine disk space is not enough or on demand to increase the hard disk situation. the detailed steps for adding a hard disk or adding hard disk space to Linux in VMware are as follows:
First, Vmware in the Linux ways to add hard drives
1. in VMware, add a hard disk to the editing settings for the Linux virtual machine (setting).
2. in VMware, see that the first 1 drives are /DEV/SDA , and the 2 hard drives are /dev/sdb
3. Create drive Information
Fdisk/dev/sdb
A. press N to add the partition, select p(primary partition);
B. Choose 1, i.e. sdb1;
C. then the space division, all the way to enter. The default is to use the entire disk space.
D. then press W to write the partition information
4. format the hard drive
Mkfs-t EXT3/DEV/SDB1
5. Create a directory that requires mount
Mkdir-p/opt
6. Mount to the specified directory
Mount/dev/sdb1/opt-o RW
7. If you need to load each boot, modify the /etc/fstab file
Add a line to the fstab file:
/dev/sdb1/opt ext3 defaults 0 0
so we're done on the virtual machine. Linux Add hard drive problem resolution.
Second, Vmware ways to increase hard disk space in
1. View the Mount contact
# df-h
Filesystem Size used Avail use% mounted on
/dev/mapper/vg_sycentos-lv_root 50G 3.8G 43G 9%/
Tmpfs 2.0G 68K 2.0G 1%/DEV/SHM
/DEV/SDA1 485M 40M 421M 9%/boot
/dev/mapper/vg_sycentos-lv_home 45G 182M 43G 1%/Home
2. After shutting down the virtual machine, edit the virtual machine settings, modify the size of the hard disk that needs to be expanded, and start the Linux system.
3. The extended disk is/DEV/SDA
# fdisk-l/DEV/SDA
disk/dev/sda:161.1 GB, 161061273600 bytes
255 heads, Sectors/track, 19581 cylinders
Units = Cylinders of 16065 * 8225280 bytes
Sector size (logical/physical): bytes/512 bytes
I/O size (minimum/optimal): bytes/512 bytes
Disk identifier:0x00046f91
Device Boot Start End Blocks Id System
/DEV/SDA1 * 1 512000 Linux
Partition 1 does not end on cylinder boundary.
/dev/sda2 13055 104344576 8e Linux LVM
4. Partition formatting
#fdisk/DEV/SDA
p View the number of partitions (my two/dev/sda1/dev/sda2)
N Add a new partition
p Partition type we select Primary partition
3 Area code Select 3
Enter default (start sector)
Enter default (end sector)
T Modify the partition type
3 Select partition 3
8e modified to LVM (8e is LVM)
w Write partition table
q Complete, exit the FDISK command
5. Let the kernel recognize the new partition
Kpartx-af/dev/sda
Kpartx-a/DEV/SDA
Partx-a/DEV/SDA If you have not seen the new partition after knocking, restart it. 650) this.width=650; "src=" Http://img.baidu.com/hi/jx2/j_0038.gif "alt=" J_0038.gif "/>
6. Formatting the Mount
Mke2fs-t Ext4/dev/sda3
mkdir/mnt/
Moun/dev/sda3/mnt
You can also add/devsda3 to the capacity of the expansion rate in an existing volume group.
This article is from the "Bumblebee" blog, please make sure to keep this source http://933183.blog.51cto.com/923183/1588845
Ways to add hard drives and increase hard disk space to Linux in VMware