VMware的改變預分配硬碟空間的方法

warehouse發表於2010-01-06
最近透過vmware裝rac遇到n多問題,一個比較突出的問題是我在安裝linux時虛擬的磁碟都沒有預分配磁碟空間,導致在oracle安裝的過程中虛擬機器直接當機,很不穩定,於是想嘗試預分配磁碟空間...[@more@]

把原來Red Hat Enterprise Linux 4.vmdk從20g調整為30g,如果小於20g的話出現錯誤了,因為-x表示要擴充套件磁碟

--=================================

C:Program FilesVMwareVMware Server>vmware-vdiskmanager.exe -x 20Gb "F:Virtual Machinesnode2Red Hat Enterprise Linux 4.vmdk"
Using log file C:DOCUME~1WCHXYS~1.004LOCALS~1Tempvmware-wchvdiskmanager.lo
g
Failed to expand the disk 'F:Virtual Machinesnode2Red Hat Enterprise Linux 4.
vmdk': One of the parameters supplied is invalid (1).

C:Program FilesVMwareVMware Server>vmware-vdiskmanager.exe -x 30Gb "F:Virtua
l Machinesnode2Red Hat Enterprise Linux 4.vmdk"
Using log file C:DOCUME~1WCHXYS~1.004LOCALS~1Tempvmware-wchvdiskmanager.lo
g
Grow: 100% done.
The old geometry C/H/S of the disk is: 2610/255/63
The new geometry C/H/S of the disk is: 3916/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 the
partitions. For more information, see:

預分配的話我們可以使用下面的命令:

C:Program FilesVMwareVMware Server>vmware-vdiskmanager.exe -r "F:Virtual Ma
chinesnode2Red Hat Enterprise Linux 4.vmdk" -s 6Gb -t 2 "F:Virtual Machinesn
ode2Red Hat Enterprise Linux 4_1.vmdk"
Using log file C:DOCUME~1WCHXYS~1.004LOCALS~1Tempvmware-wchvdiskmanager.lo
g
Creating monolithic preallocated disk 'F:Virtual Machinesnode2Red Hat Enterpr
ise Linux 4_1.vmdk'
Convert: 100% done.
Virtual disk conversion successful.

不過從執行的結果來看我發現一下預分配了30g,而不是我制定的6g,所以使用預分配時要注意...

--=====================================

VMware的改變預分配硬碟空間的方法

如何擴充套件虛擬機器的區間?

假設擬定vmware虛擬的在e分割槽的win2003下,那麼轉到vmware的安裝目錄下,執行
vmware-vdiskmanager -x 4Gb "E:vmwin2003Windows Server 2003 Enterprise Edition.vmdk"


命令如下:

1假定vmware workstation安裝在c盤下:
C:Program FilesVMwareVMware Workstation>vmware-vdiskmanager -x 4Gb "E:vmwin
2003Windows Server 2003 Enterprise Edition.vmdk"
2 假定vmware server安裝在d盤下:
d:Program FilesVMwareVMware Workstation>vmware-vdiskmanager -x 14Gb "E:vmwin
2003Windows Server 2003 Enterprise Edition.vmdk"

Using log file C:DOCUME~1ADMINI~1LOCALS~1Tempvmware-Administratorvdiskmana
ger.log
Grow: 100% done.
The old geometry C/H/S of the disk is: 261/255/63
The new geometry C/H/S of the disk is: 522/255/63
Disk expansion completed successfully.


vmware: D:Program FilesVMwareVMware Server>vmware-vdiskmanager -x 6gb "D:Virtual Mac
hinessusWindows 2000 Professional (2).vmdk"

引數 -x 表示要擴充套件虛擬機器硬碟空間;緊隨其後的數字指擴充套件到 的大小(如12Gb,表示磁碟總量,包含原來的磁碟容量)


參考一下:
VMware Virtual Disk Manager - build 12544.
Usage: vmware-vdiskmanager.exe OPTIONS diskName | drive-letter:
Offline disk manipulation utility
Options:
-c : create disk; need to specify other create options
-d : defragment the specified virtual disk
-k : shrink the specified virtual disk
-n : rename the specified virtual disk; need to
specify destination disk-name
-p : prepare the mounted virtual disk specified by
the drive-letter for shrinking
-q : do not log messages
-r : convert the specified disk; need to specify
destination disk-type
-x : expand the disk to the specified capacity
Additional options for create and convert:
-a : adapter type (ide, buslogic or lsilogic)
-s : capacity of the virtual disk
-t : disk type id
Disk types:
0 : single growable virtual disk
1 : growable virtual disk split in 2Gb files
2 : preallocated virtual disk
3 : preallocated virtual disk split in 2Gb files
The capacity can be specified in sectors, Kb, Mb or Gb.
The acceptable ranges:
ide adapter : [100.0Mb, 950.0Gb]
scsi adapter: [100.0Mb, 950.0Gb]
ex 1: vmware-vdiskmanager.exe -c -s 850Mb -a ide -t 0 myIdeDisk.vmdk
ex 2: vmware-vdiskmanager.exe -d myDisk.vmdk
ex 3: vmware-vdiskmanager.exe -r sourceDisk.vmdk -t 0 destinationDisk.vm
dk
ex 4: vmware-vdiskmanager.exe -x 36Gb myDisk.vmdk
ex 5: vmware-vdiskmanager.exe -n sourceName.vmdk destinationName.vmdk
ex 6: vmware-vdiskmanager.exe -k myDisk.vmdk
ex 7: vmware-vdiskmanager.exe -p m:
(A virtual disk first needs to be mounted at m:
using the VMware Diskmount Utility.)

本文來自CSDN部落格,轉載請標明出處:http://blog.csdn.net/gbys/archive/2008/05/30/2495078.aspx

來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/19602/viewspace-1030315/,如需轉載,請註明出處,否則將追究法律責任。

相關文章