how to shrink or convert VMDK format image ?


===============================================================

how to shrink vmdk


in guest:

for OS X :

su diskutil secureErase freespace 0 [harddrive name]

for some other linux/unix OS , we should do below two steps to replace "diskutil":

1)  cat /dev/zero > zero.fill

2)  rm -f zero.fill


on host:
C:\Program Files (x86)\VMware\VMware Workstation\vmware-vdiskmanager.exe -k [vmdk path]


REFERENCE:

    https://www.insanelymac.com/forum/topic/308367-how-to-shrink-os-x-vmdk/

================================================================

about VMDK and VDI format convert

as we know, VMDK is the shortname of Virtual Machine Disk, initially developed by VMWare and now it's an

open format.

VDI is the shortname of VirtualBox Disk Image, it's specified for virtualbox but the others VMM also support

this format. In some place, the VDI means Virtual Desktop Infrastructure, but here we are talking about a file format.

---------------------------------------------------------------------------------------------------------

1) performance

at first, in my opinion I supposed the VMDK image has a higher performance than VDI on VMWare or the VDI image

worked better than VMDK on VBox. but finally I found there is no difference. they are just image formats to content

data.

----------------------------------------------------------------------------------------------------------

2) format convert

raw / vdi / vmdk / vhd / qcow2

using qemu-img:

    qemu-img covert -f [origin format] <source image> -o [target format] <target image>

using vboxmanager:

    vboxmanager  clonehd <source image>  <target image> --format [target format]

===================================================================

    


  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
C++中的string类提供了shrink_to_fit()函数,可以使string的容量(capacity)随着size的缩小而缩小。\[2\]当我们使用resize()函数来改变string的大小时,如果size缩小后,字符超出的部分会被裁剪掉,但是capacity不会减小。而shrink_to_fit()函数可以在size缩小后,将capacity也相应地缩小,以节省内存空间。\[2\]这个函数在C++11中被引入,可以通过调用string对象的shrink_to_fit()方法来使用。 #### 引用[.reference_title] - *1* [C++ string清空并释放内存空间的两种方法(shrink_to_fit()、swap())](https://blog.csdn.net/qq_41687938/article/details/117731243)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v91^insertT0,239^v3^insert_chatgpt"}} ] [.reference_item] - *2* [c++ string的详细用法(15)reserve()与resize()与shrink_to_fit()](https://blog.csdn.net/qq_40630246/article/details/103655230)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v91^insertT0,239^v3^insert_chatgpt"}} ] [.reference_item] - *3* [【C++】如何释放vector的内存空间及std::vector::shrink_to_fit用法简介](https://blog.csdn.net/weixin_43753894/article/details/126970068)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v91^insertT0,239^v3^insert_chatgpt"}} ] [.reference_item] [ .reference_list ]

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值