{"id":268,"date":"2011-12-18T19:09:38","date_gmt":"2011-12-18T18:09:38","guid":{"rendered":"https:\/\/www.phillips321.co.uk\/?p=268"},"modified":"2011-12-19T12:55:03","modified_gmt":"2011-12-19T11:55:03","slug":"converting-vmware-disks-preallocated-growable-2gb","status":"publish","type":"post","link":"https:\/\/www.phillips321.co.uk\/2011\/12\/18\/converting-vmware-disks-preallocated-growable-2gb\/","title":{"rendered":"Converting VMWare disks: preallocated? growable? 2GB?"},"content":{"rendered":"<p>So you&#8217;ve got a VMWare system but when you created it you did so but specified the wrong disk type. For example I have a Win7 32bit VM specifically for iTunes (in my family we have iPhones and iPads). Unfortunately when I created this for some silly reason decided to set the 40GB drive to preallocated meaning I have a single 40GB file taking up far too much room on my limited SSD.<\/p>\n<p>I wanted to convert this down to a growable disk and was able to do so using the vmware-vdiskmanager tool:<\/p>\n<div class=\"codecolorer-container bash vibrant\" style=\"overflow:auto;white-space:nowrap;width:100%;height:300px;\"><table cellspacing=\"0\" cellpadding=\"0\"><tbody><tr><td class=\"line-numbers\"><div>1<br \/>2<br \/>3<br \/>4<br \/>5<br \/>6<br \/>7<br \/>8<br \/>9<br \/>10<br \/>11<br \/>12<br \/>13<br \/>14<br \/>15<br \/>16<br \/>17<br \/>18<br \/>19<br \/>20<br \/>21<br \/>22<br \/>23<br \/>24<br \/>25<br \/>26<br \/>27<br \/>28<br \/>29<br \/>30<br \/>31<br \/>32<br \/>33<br \/>34<br \/>35<br \/>36<br \/>37<br \/>38<br \/>39<br \/>40<br \/>41<br \/>42<br \/>43<br \/>44<br \/>45<br \/>46<br \/>47<br \/>48<br \/>49<br \/>50<br \/>51<br \/>52<br \/>53<br \/>54<br \/>55<br \/>56<br \/>57<br \/>58<br \/>59<br \/>60<br \/>61<br \/><\/div><\/td><td><div class=\"bash codecolorer\">phillips321<span class=\"sy0\">@<\/span>Ubuntu-Desktop:<span class=\"sy0\">\/<\/span>nfs<span class=\"sy0\">\/<\/span>vm<span class=\"sy0\">\/<\/span>iTunes$ vmware-vdiskmanager <span class=\"re5\">-h<\/span><br \/>\nDiskname or some other argument is missing.<br \/>\nVMware Virtual Disk Manager - build <span class=\"nu0\">471780<\/span>.<br \/>\nUsage: vmware-vdiskmanager OPTIONS <span class=\"sy0\">&lt;<\/span>disk-name<span class=\"sy0\">&gt;<\/span> <span class=\"sy0\">|<\/span> <span class=\"sy0\">&lt;<\/span>mount-point<span class=\"sy0\">&gt;<\/span><br \/>\nOffline disk manipulation utility<br \/>\n&nbsp; Operations, only one may be specified at a time:<br \/>\n&nbsp; &nbsp; &nbsp;<span class=\"re5\">-c<\/span> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; : create disk. &nbsp;Additional creation options must<br \/>\n&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; be specified. &nbsp;Only <span class=\"kw3\">local<\/span> virtual disks can be<br \/>\n&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; created.<br \/>\n&nbsp; &nbsp; &nbsp;<span class=\"re5\">-d<\/span> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; : defragment the specified virtual disk. Only<br \/>\n&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class=\"kw3\">local<\/span> virtual disks may be defragmented.<br \/>\n&nbsp; &nbsp; &nbsp;<span class=\"re5\">-k<\/span> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; : shrink the specified virtual disk. Only <span class=\"kw3\">local<\/span><br \/>\n&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; virtual disks may be shrunk.<br \/>\n&nbsp; &nbsp; &nbsp;<span class=\"re5\">-n<\/span> <span class=\"sy0\">&lt;<\/span>source-disk<span class=\"sy0\">&gt;<\/span> &nbsp; &nbsp; : rename the specified virtual disk; need to<br \/>\n&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; specify destination disk-name. Only <span class=\"kw3\">local<\/span> virtual<br \/>\n&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; disks may be renamed.<br \/>\n&nbsp; &nbsp; &nbsp;<span class=\"re5\">-p<\/span> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; : prepare the mounted virtual disk specified by<br \/>\n&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; the <span class=\"kw2\">mount<\/span> point <span class=\"kw1\">for<\/span> shrinking.<br \/>\n&nbsp; &nbsp; &nbsp;<span class=\"re5\">-r<\/span> <span class=\"sy0\">&lt;<\/span>source-disk<span class=\"sy0\">&gt;<\/span> &nbsp; &nbsp; : convert the specified disk; need to specify<br \/>\n&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; destination disk-type. &nbsp;For <span class=\"kw3\">local<\/span> destination disks<br \/>\n&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; the disk <span class=\"kw3\">type<\/span> must be specified.<br \/>\n&nbsp; &nbsp; &nbsp;<span class=\"re5\">-x<\/span> <span class=\"sy0\">&lt;<\/span>new-capacity<span class=\"sy0\">&gt;<\/span> &nbsp; &nbsp;: expand the disk to the specified capacity. Only<br \/>\n&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class=\"kw3\">local<\/span> virtual disks may be expanded.<br \/>\n&nbsp; &nbsp; &nbsp;<span class=\"re5\">-R<\/span> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; : check a sparse virtual disk <span class=\"kw1\">for<\/span> consistency and attempt<br \/>\n&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; to repair any errors.<br \/>\n&nbsp; &nbsp; &nbsp;<span class=\"re5\">-e<\/span> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; : check <span class=\"kw1\">for<\/span> disk chain consistency.<br \/>\n&nbsp; &nbsp; &nbsp;<span class=\"re5\">-D<\/span> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; : <span class=\"kw2\">make<\/span> disk deletable. &nbsp;This should only be used on disks<br \/>\n&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; that have been copied from another product.<br \/>\n<br \/>\n&nbsp; Other Options:<br \/>\n&nbsp; &nbsp; &nbsp;<span class=\"re5\">-q<\/span> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; : <span class=\"kw1\">do<\/span> not log messages<br \/>\n<br \/>\n&nbsp; Additional options <span class=\"kw1\">for<\/span> create and convert:<br \/>\n&nbsp; &nbsp; &nbsp;<span class=\"re5\">-a<\/span> <span class=\"sy0\">&lt;<\/span>adapter<span class=\"sy0\">&gt;<\/span> &nbsp; &nbsp; &nbsp; &nbsp; : <span class=\"br0\">&#40;<\/span><span class=\"kw1\">for<\/span> use with <span class=\"re5\">-c<\/span> only<span class=\"br0\">&#41;<\/span> adapter <span class=\"kw3\">type<\/span><br \/>\n&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class=\"br0\">&#40;<\/span>ide, buslogic, lsilogic<span class=\"br0\">&#41;<\/span>. Pass lsilogic <span class=\"kw1\">for<\/span> other adapter types.<br \/>\n&nbsp; &nbsp; &nbsp;<span class=\"re5\">-s<\/span> <span class=\"sy0\">&lt;<\/span><span class=\"kw2\">size<\/span><span class=\"sy0\">&gt;<\/span> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;: capacity of the virtual disk<br \/>\n&nbsp; &nbsp; &nbsp;<span class=\"re5\">-t<\/span> <span class=\"sy0\">&lt;<\/span>disk-type<span class=\"sy0\">&gt;<\/span> &nbsp; &nbsp; &nbsp; : disk <span class=\"kw3\">type<\/span> <span class=\"kw2\">id<\/span><br \/>\n<br \/>\n&nbsp; Disk types:<br \/>\n&nbsp; &nbsp; &nbsp; <span class=\"nu0\">0<\/span> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; : single growable virtual disk<br \/>\n&nbsp; &nbsp; &nbsp; <span class=\"nu0\">1<\/span> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; : growable virtual disk <span class=\"kw2\">split<\/span> <span class=\"kw1\">in<\/span> 2GB files<br \/>\n&nbsp; &nbsp; &nbsp; <span class=\"nu0\">2<\/span> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; : preallocated virtual disk<br \/>\n&nbsp; &nbsp; &nbsp; <span class=\"nu0\">3<\/span> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; : preallocated virtual disk <span class=\"kw2\">split<\/span> <span class=\"kw1\">in<\/span> 2GB files<br \/>\n&nbsp; &nbsp; &nbsp; <span class=\"nu0\">4<\/span> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; : preallocated ESX-type virtual disk<br \/>\n&nbsp; &nbsp; &nbsp; <span class=\"nu0\">5<\/span> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; : compressed disk optimized <span class=\"kw1\">for<\/span> streaming<br \/>\n&nbsp; &nbsp; &nbsp; <span class=\"nu0\">6<\/span> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; : thin provisioned virtual disk - ESX <span class=\"nu0\">3<\/span>.x and above<br \/>\n<br \/>\n&nbsp; &nbsp; &nbsp;The capacity can be specified <span class=\"kw1\">in<\/span> sectors, KB, MB or GB.<br \/>\n&nbsp; &nbsp; &nbsp;The acceptable ranges:<br \/>\n&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;ide adapter : <span class=\"br0\">&#91;<\/span>1MB, 2040.0GB<span class=\"br0\">&#93;<\/span><br \/>\n&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;scsi adapter: <span class=\"br0\">&#91;<\/span>1MB, 2040.0GB<span class=\"br0\">&#93;<\/span><br \/>\n&nbsp; &nbsp; &nbsp; &nbsp; ex <span class=\"nu0\">1<\/span>: vmware-vdiskmanager <span class=\"re5\">-c<\/span> <span class=\"re5\">-s<\/span> 850MB <span class=\"re5\">-a<\/span> ide <span class=\"re5\">-t<\/span> <span class=\"nu0\">0<\/span> myIdeDisk.vmdk<br \/>\n&nbsp; &nbsp; &nbsp; &nbsp; ex <span class=\"nu0\">2<\/span>: vmware-vdiskmanager <span class=\"re5\">-d<\/span> myDisk.vmdk<br \/>\n&nbsp; &nbsp; &nbsp; &nbsp; ex <span class=\"nu0\">3<\/span>: vmware-vdiskmanager <span class=\"re5\">-r<\/span> sourceDisk.vmdk <span class=\"re5\">-t<\/span> <span class=\"nu0\">0<\/span> destinationDisk.vmdk<br \/>\n&nbsp; &nbsp; &nbsp; &nbsp; ex <span class=\"nu0\">4<\/span>: vmware-vdiskmanager <span class=\"re5\">-x<\/span> 36GB myDisk.vmdk<br \/>\n&nbsp; &nbsp; &nbsp; &nbsp; ex <span class=\"nu0\">5<\/span>: vmware-vdiskmanager <span class=\"re5\">-n<\/span> sourceName.vmdk destinationName.vmdk<br \/>\n&nbsp; &nbsp; &nbsp; &nbsp; ex <span class=\"nu0\">6<\/span>: vmware-vdiskmanager <span class=\"re5\">-r<\/span> sourceDisk.vmdk <span class=\"re5\">-t<\/span> <span class=\"nu0\">4<\/span> <span class=\"re5\">-h<\/span> esx-name.mycompany.com \\<br \/>\n&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class=\"re5\">-u<\/span> username <span class=\"re5\">-f<\/span> passwordfile <span class=\"st0\">&quot;[storage1]\/path\/to\/targetDisk.vmdk&quot;<\/span><br \/>\n&nbsp; &nbsp; &nbsp; &nbsp; ex <span class=\"nu0\">7<\/span>: vmware-vdiskmanager <span class=\"re5\">-k<\/span> myDisk.vmdk<br \/>\n&nbsp; &nbsp; &nbsp; &nbsp; ex <span class=\"nu0\">8<\/span>: vmware-vdiskmanager <span class=\"re5\">-p<\/span> <span class=\"sy0\">&lt;<\/span>mount-point<span class=\"sy0\">&gt;<\/span><br \/>\n&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class=\"br0\">&#40;<\/span>A virtual disk first needs to be mounted at <span class=\"sy0\">&lt;<\/span>mount-point<span class=\"sy0\">&gt;<\/span><span class=\"br0\">&#41;<\/span><\/div><\/td><\/tr><\/tbody><\/table><\/div>\n<p>I order to convert down i needed to use the -r flag along with the disk type that i wished to end with, in this case 0.<\/p>\n<div class=\"codecolorer-container bash vibrant\" style=\"overflow:auto;white-space:nowrap;width:100%;\"><table cellspacing=\"0\" cellpadding=\"0\"><tbody><tr><td class=\"line-numbers\"><div>1<br \/>2<br \/>3<br \/>4<br \/>5<br \/>6<br \/>7<br \/>8<br \/><\/div><\/td><td><div class=\"bash codecolorer\">Disk types:<br \/>\n<span class=\"nu0\">0<\/span> &nbsp; &nbsp; &nbsp; &nbsp; : single growable virtual disk<br \/>\n<span class=\"nu0\">1<\/span> &nbsp; &nbsp; &nbsp; &nbsp; : growable virtual disk <span class=\"kw2\">split<\/span> <span class=\"kw1\">in<\/span> 2GB files<br \/>\n<span class=\"nu0\">2<\/span> &nbsp; &nbsp; &nbsp; &nbsp; : preallocated virtual disk<br \/>\n<span class=\"nu0\">3<\/span> &nbsp; &nbsp; &nbsp; &nbsp; : preallocated virtual disk <span class=\"kw2\">split<\/span> <span class=\"kw1\">in<\/span> 2GB files<br \/>\n<span class=\"nu0\">4<\/span> &nbsp; &nbsp; &nbsp; &nbsp; : preallocated ESX-type virtual disk<br \/>\n<span class=\"nu0\">5<\/span> &nbsp; &nbsp; &nbsp; &nbsp; : compressed disk optimized <span class=\"kw1\">for<\/span> streaming<br \/>\n<span class=\"nu0\">6<\/span> &nbsp; &nbsp; &nbsp; &nbsp; : thin provisioned virtual disk - ESX <span class=\"nu0\">3<\/span>.x and above<\/div><\/td><\/tr><\/tbody><\/table><\/div>\n<p>A quick one-liner and my virtual disk was converted after about an hour.<\/p>\n<div class=\"codecolorer-container bash vibrant\" style=\"overflow:auto;white-space:nowrap;width:100%;\"><table cellspacing=\"0\" cellpadding=\"0\"><tbody><tr><td class=\"line-numbers\"><div>1<br \/>2<br \/>3<br \/>4<br \/>5<br \/><\/div><\/td><td><div class=\"bash codecolorer\">phillips321<span class=\"sy0\">@<\/span>Ubuntu-Desktop:<span class=\"sy0\">\/<\/span>nfs<span class=\"sy0\">\/<\/span>vm<span class=\"sy0\">\/<\/span>iTunes$ vmware-vdiskmanager <span class=\"re5\">-r<\/span> iTunes_preallocated.vmdk <span class=\"re5\">-t<\/span> <span class=\"nu0\">0<\/span> iTunes_growable.vmdk<br \/>\nCreating disk <span class=\"st_h\">'iTunes_growable.vmdk'<\/span><br \/>\n&nbsp; Convert: <span class=\"nu0\">100<\/span><span class=\"sy0\">%<\/span> done.<br \/>\nVirtual disk conversion successful.<br \/>\nphillips321<span class=\"sy0\">@<\/span>Ubuntu-Desktop:<span class=\"sy0\">\/<\/span>nfs<span class=\"sy0\">\/<\/span>vm<span class=\"sy0\">\/<\/span>iTunes$<\/div><\/td><\/tr><\/tbody><\/table><\/div>\n<p>This tool will be great for those that need to split their disk into 2GB files in order to cope with various file system types, preallocate their disk to improve performance or set their disk to growable in order to decrease wasted disk space.<\/p>\n<p>If anyone knows what the option <em>compressed disk optimized for streaming<\/em> means I would love to know as googling didn&#8217;t help.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>So you&#8217;ve got a VMWare system but when you created it you did so but specified the wrong disk type. For example I have a Win7 32bit VM specifically for iTunes (in my family we have iPhones and iPads). Unfortunately when I created this for some silly reason decided to set the 40GB drive to [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[8,3,1],"tags":[104,10,106,5,107,105,103],"_links":{"self":[{"href":"https:\/\/www.phillips321.co.uk\/wp-json\/wp\/v2\/posts\/268"}],"collection":[{"href":"https:\/\/www.phillips321.co.uk\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.phillips321.co.uk\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.phillips321.co.uk\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.phillips321.co.uk\/wp-json\/wp\/v2\/comments?post=268"}],"version-history":[{"count":8,"href":"https:\/\/www.phillips321.co.uk\/wp-json\/wp\/v2\/posts\/268\/revisions"}],"predecessor-version":[{"id":277,"href":"https:\/\/www.phillips321.co.uk\/wp-json\/wp\/v2\/posts\/268\/revisions\/277"}],"wp:attachment":[{"href":"https:\/\/www.phillips321.co.uk\/wp-json\/wp\/v2\/media?parent=268"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.phillips321.co.uk\/wp-json\/wp\/v2\/categories?post=268"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.phillips321.co.uk\/wp-json\/wp\/v2\/tags?post=268"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}