简体   繁体   中英

Reduce the size of a Linux VM data disk

My Linux VMs each have two disk (OS + Data)

The data disks are currently set to 1024Gb but only contain <15Gb of content

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.

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? Or am I forced to create a new disk, copy data, then remove the old disk?

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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