简体   繁体   English

减小 Linux VM 数据盘的大小

[英]Reduce the size of a Linux VM data disk

My Linux VMs each have two disk (OS + Data)我的 Linux VM 每个都有两个磁盘(操作系统 + 数据)

The data disks are currently set to 1024Gb but only contain <15Gb of content数据磁盘当前设置为 1024Gb 但仅包含 <15Gb 的内容

In have two environments (test and production).在有两个环境(测试和生产)。 The production data disk is premium the test data disk is standard.生产数据盘为高级,测试数据盘为标准。

I want to reduce the size of the production data disk because as I discovered Premium disks are changed on the full size, not just the amount being used as standard disks are.我想减少生产数据磁盘的大小,因为我发现高级磁盘在完整大小上发生了变化,而不仅仅是用作标准磁盘的数量。

So before doing this in production, I wanted to try in test.因此,在生产中执行此操作之前,我想尝试进行测试。 I stop the VM then try to change the size of the disk through the Azure portal but I get an error stating that the new size must be greater than the current - it won't let me reduce the size.我停止虚拟机,然后尝试通过 Azure 门户更改磁盘的大小,但我收到一条错误消息,指出新大小必须大于当前大小 - 它不会让我减小大小。

Is that a constraint of premium disks as tell?这是对高级磁盘的限制吗? Is it a constraint of the Azure portal, or can I run CLI/powershell commands that can do this?这是 Azure 门户的限制,还是我可以运行可以执行此操作的 CLI/powershell 命令? Or am I forced to create a new disk, copy data, then remove the old disk?还是我被迫创建一个新磁盘,复制数据,然后删除旧磁盘?

您无法减小磁盘的大小,因此您必须附加另一个磁盘并使用 robocopy 或其他方法复制内容。

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

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