简体   繁体   English

是否可以减小 Azure 上的 VM 磁盘大小

[英]Is it possible to reduce the size of a VM disk on Azure

Is it possible to reduce the size of a VM disk?是否可以减小 VM 磁盘的大小?

I have a 500 GB disk with 20 GB of occupation.我有一个占用 20 GB 的 500 GB 磁盘。 I want to reduce the size to 100GB.我想将大小减小到 100GB。 The Azure Portal only allows you to increase. Azure Portal 只允许你增加。 How can I reduce the size?我怎样才能减小尺寸?

The VM has the UBUNTU operating system. VM 具有 UBUNTU 操作系统。

Yes you can shrink you VM size是的,您可以缩小 VM 大小

  1. First, create a new Data disk from the Azure portal.首先,从 Azure 门户创建一个新的数据磁盘。 Select 'Create disk' and follow the wizard to create a managed disk. Select“创建磁盘”并按照向导创建托管磁盘。
  2. Next, RDP to the VM in order to initialize the new disk.接下来,RDP 到 VM 以初始化新磁盘。 Go to Disk Management and assign a size and Drive letter for the new volume. Go 到磁盘管理并为新卷分配大小和驱动器号。
  3. Once the new volume is initialized, move the files from the source disk to the new volume.初始化新卷后,将文件从源磁盘移动到新卷。 This can be done using the robocopy.这可以使用 robocopy 来完成。

If you are looking for other option you can refer below link as well https://devblogs.microsoft.com/premier-developer/how-to-shrink-a-managed-disk/如果您正在寻找其他选项,您也可以参考下面的链接https://devblogs.microsoft.com/premier-developer/how-to-shrink-a-managed-disk/

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM