扩展VMware 虚拟机硬盘容量,不需要重装系统心得

1.使用vmware自带vmware-vdiskmanager.exe进行扩容第一步。

    首先,进入“运行”,cmd,进入vmware-vdiskmanager.exe所在目录(例如:我的是在C:/Program Files/VMware/VMware Workstation,则(1)c: (2)cd Program Files (3)cd VMware (4)cd VMware Workstation   最后进入C:/Program Files/VMware/VMware Workstation),执行vmware-vdiskmanager.exe -x 20GB "E:/Red Hat Enterprise Linux 5/Red Hat Enterprise Linux 5.vmdk"(其中20GB指扩容后的大小,E:/Red Hat Enterprise Linux 5/Red Hat Enterprise Linux 5.vmdk指要扩容的虚拟机的磁盘)

a. 异常情况:Failed to expand the disk 'E:/VM/SUSEServer.vmdk': One of the parameters supplied is invalid (0x100003e80).

   原因:-x后的参数是扩大后的硬盘空间大小。如果空间大小小于或等于原有的硬盘空间大小,就会出现这个错误。

b. 异常情况:目录中有空格出现,要加上在路径上""

2 调整Fedora 8文件系统大小[转】   转载来自:http://blog.csdn.net/jjl_china/archive/2009/09/15/4550883.aspx
进入Fedora 8系统终端,先添加一个磁盘分区
fdisk /dev/sda

我的执行过程:
[root@localhost ~]# fdisk /dev/sda

The number of cylinders for this disk is set to 3916.
There is nothing wrong with that, but this is larger than 1024,
and could in certain setups cause problems with:
1) software that runs at boot time (e.g., old versions of LILO)
2) booting and partitioning software from other OSs
(e.g., DOS FDISK, OS/2 FDISK)

Command (m for help): p

Disk /dev/sda: 32.2 GB, 32212254720 bytes
255 heads, 63 sectors/track, 3916 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0x000bc363

Device Boot Start End Blocks Id System
/dev/sda1 * 1 25 200781 83 Linux
/dev/sda2 26 1958 15526822+ 8e Linux LVM
/dev/sda3 1959 2610 5237190 8e Linux LVM

Command (m for help): n
Command action
e extended
p primary partition (1-4)
p
Selected partition 4
First cylinder (2611-3916, default 2611):
Using default value 2611
Last cylinder or +size or +sizeM or +sizeK (2611-3916, default 3916):
Using default value 3916

Command (m for help): t
Partition number (1-4): 4
Hex code (type L to list codes): 8e
Changed system type of partition 4 to 8e (Linux LVM)

Command (m for help): p

Disk /dev/sda: 32.2 GB, 32212254720 bytes
255 heads, 63 sectors/track, 3916 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0x000bc363

Device Boot Start End Blocks Id System
/dev/sda1 * 1 25 200781 83 Linux
/dev/sda2 26 1958 15526822+ 8e Linux LVM
/dev/sda3 1959 2610 5237190 8e Linux LVM
/dev/sda4 2611 3916 10490445 8e Linux LVM

Command (m for help): w
The partition table has been altered!

Calling ioctl() to re-read partition table.

WARNING: Re-reading the partition table failed with error 16: Device or resource busy.
The kernel still uses the old table.
The new table will be used at the next reboot.
Syncing disks.

(注:建议重启一下Fedora系统)

[root@localhost ~]# pvcreate /dev/sda4
Physical volume "/dev/sda4" successfully created
[root@localhost ~]# vgextend VolGroup00 /dev/sda4
Volume group "VolGroup00" successfully extended
[root@localhost ~]# lvextend -l +100%FREE /dev/VolGroup00/LogVol00
Extending logical volume LogVol00 to 28.25 GB
Logical volume LogVol00 successfully resized
[root@localhost ~]# lvresize -l +100%FREE /dev/VolGroup00/LogVol00
New size (904 extents) matches existing size (904 extents)
lvresize: Resize a logical volume

lvresize
[-A|--autobackup y|n]
[--alloc AllocationPolicy]
[-d|--debug]
[-h|--help]
[-i|--stripes Stripes [-I|--stripesize StripeSize]]
{-l|--extents [+|-]LogicalExtentsNumber[%{VG|LV|FREE}] |
-L|--size [+|-]LogicalVolumeSize[kKmMgGtTpPeE]}
[-n|--nofsck]
[-r|--resizefs]
[-t|--test]
[--type VolumeType]
[-v|--verbose]
[--version]
LogicalVolume[Path] [ PhysicalVolumePath... ]

[root@localhost ~]# resize2fs /dev/VolGroup00/LogVol00
resize2fs 1.40.2 (12-Jul-2007)
Filesystem at /dev/VolGroup00/LogVol00 is mounted on /; on-line resizing required
old desc_blocks = 2, new_desc_blocks = 2
Performing an on-line resize of /dev/VolGroup00/LogVol00 to 7405568 (4k) blocks.
The filesystem on /dev/VolGroup00/LogVol00 is now 7405568 blocks long.

 

阅读更多
想对作者说点什么? 我来说一句

没有更多推荐了,返回首页

不良信息举报

扩展VMware 虚拟机硬盘容量,不需要重装系统心得

最多只允许输入30个字

加入CSDN,享受更精准的内容推荐,与500万程序员共同成长!
关闭
关闭