All Products
Search
Document Center

:FAQ about replacing an operating system

Last Updated:Nov 19, 2025

Replacing an operating system is the process of replacing its system disk. This topic answers frequently asked questions (FAQs) and provides solutions for replacing the operating system (system disk) of an Elastic Compute Service (ECS) instance.

How do I replace an operating system (system disk)?

You can replace the operating system (system disk) by replacing the image of an ECS instance.

Warning

When you replace the operating system (system disk), the original system disk is released and all data on it is purged. Before you perform this operation, create a snapshot of the system disk to back up your data.

Can a custom image created from an instance in Account A be used to replace the operating system of an instance in Account B?

Yes. Account A must first share the custom image with Account B. Then, Account B can use the image to replace the operating system (system disk).

If an image contains data disks, can I use the image to replace an operating system?

You can use an image that contains data disks to replace an operating system. Only the system disk of the original instance is replaced. The data disks of the original instance are not affected.

Important

If you use a custom image that contains data disks to change the operating system, make sure that no dependencies exist between the system disk and the data disks in your services. You must also make sure that operations on the data disks from the new system disk do not affect your business processes. For example, if your services involve read and write operations from the system disk to a data disk, changing the operating system may cause issues, such as abnormal read and write operations on the data disk, because the system disk is changed.

What are the differences between replacing an operating system and re-initializing a system disk?

The main differences are shown in the following table:

Item

Re-initialize the system disk

Change the system disk (operating system)

Feature differences

Re-initialization restores an ECS instance to its initial state. The operating system version does not change.

You can switch the current operating system to a different type or version.

Impact on the system disk

  • The original system disk is not released.

  • Data on the system disk is restored to the state it was in when the instance was created. Applications that you installed and data that was generated after the instance was created are erased. You must back up your data.

  • The system disk ID, disk type, and IP address of the ECS instance remain unchanged.

  • After the operating system is changed, the original system disk is released.

  • All data on the system disk is erased. You must back up your data.

  • The system disk ID changes. The disk type, IP address of the ECS instance, and MAC address of the network interface card (NIC) remain unchanged.

Impact on data disks

Data disks are not affected.

Data disks are not affected.

Impact on snapshots

  • Snapshots created from the system disk can be used to roll back the disk.

  • Manual snapshots and automatic snapshots that are created from the system disk are retained.

  • The automatic snapshot policy remains in effect and does not need to be reconfigured.

  • Snapshots of the original system disk cannot be used to roll back the new system disk but can be used to create custom images.

  • Manual snapshots that are created from the original disk are not released.

  • For automatic snapshots, if Delete Automatic Snapshots While Releasing Disk is enabled for the original system disk, the automatic snapshots are automatically deleted. If Delete Automatic Snapshots While Releasing Disk is not enabled, the snapshots are automatically released upon expiration.

  • The automatic snapshot policy for the original system disk becomes invalid and must be reconfigured.

Billing

Re-initializing a system disk is free of charge. Because the operating system remains unchanged, the billable items do not change.

Changing the operating system is free of charge. However, fees are incurred in the following cases:

  • If the new image is a paid image, you are charged for the image. For more information, see Image billing.

  • If you increase the capacity of the system disk during the replacement, you are charged for the additional capacity. For more information, see Block storage billing.

What do I do if I fail to resize a system disk by replacing the operating system?

When you replace the operating system to resize a system disk, the partition extension may fail due to a timeout. If the system disk is not successfully resize, you must manually extend the partitions. For more information, see Extend partitions and file systems (Linux). This method extends only the system disk partitions and does not affect the operating system version.

When I replace an operating system, what do I do if the target image is not available and a message indicates that the instance is non-I/O optimized?

Cause

The I/O optimization property of the instance must match that of the image. I/O optimized instances can use only I/O optimized images, and non-I/O optimized instances can use only non-I/O optimized images. Therefore, if the I/O optimization properties of the instance and image do not match, you cannot select the target image when you replace the operating system. The following message appears: 'This instance is non-I/O optimized. You can select only non-I/O optimized images to replace the operating system.'

Solutions

  1. Change to a new instance type. All instance types that are available for purchase are I/O optimized.

  2. You can select an image that supports I/O optimized instances to replace the operating system by replacing the system disk.

Note
  • You can call the DescribeInstances operation and check the value of the IoOptimized parameter to check the I/O optimization property of the instance.

  • You can call the DescribeImages operation and check the value of the IsSupportIoOptimized parameter to check the I/O optimization property of the image.