- Documentation
Elastic Compute Service
Elastic Compute Service
User Guide
Images
Changing operating systems
Images
Changing operating systems
Changing operating systems
Scenarios
Changing the operating system is an important means to reset the system volume and recover instances from system failures.
- When an existing instance encounters a system failure, you can change the operating system (that is, reset the system volume) to restore the instance to its initial status at startup.
- When the current operating system of an existing instance does not meet your business requirements, you can also change the operating system to meet business requirements.
You can change the operating system regardless of whether you change the operating system type. For example, you can change a Windows operating system to another Windows operating system. You can also change a Linux operating system to a Windows operating system.
tip
You can also use the operating system migration feature of the SMC to change the CentOS operating system of an instance to the CentOS-compatible veLinux operating system without downtime. Learn more. Considerations
Changing the operating system is a high-risk operation that may cause prolonged business interruptions. Read the following precautions before you proceed.
Procedure
You can change the operating system of one or multiple existing instances at the same time to restore the system volume to the initial status.
tip
When you change the operating system of multiple existing instances at the same time, take note of the following items:
- The instances for which you want to change the operating system must remain in Stopped state, and their associated availability zones, images, and billing methods must be identical.
- You can change the operating system for up to 20 instances at the same time.
- You can log in to the instances for which you have changed the operating system at the same time by using the newly configured credentials.
- In the top menu bar, select the region and project where the target instance resides.
- On the Instances page, click "Stop" in the "Actions" column of the target instance to stop the instance.
- After the instance is stopped, click "... > Volumes & Image > Replace operating system" in the "Actions" column of the instance. Configure the parameters described in the following table.
- Read the precautions for replacing the system volume and click the "Confirm the order" button to submit the request.
tip
If the target instance is running a Linux operating system and the billing method is subscription, when you change the Linux operating system to a Windows operating system, you will be redirected to the order information confirmation page. On the order information confirmation page, you can confirm the new configuration information and choose whether to use a coupon to offset fees.
Operation results
- Successful: After you submit the request for changing the operating system, the instance changes to the Rebuilding status. Approximately 10 minutes later, the operating system is changed, the instance automatically starts, and the status changes to Running. Billing is resumed for instances in economical mode. Click the instance name to go to the instance details page, on which the new image is displayed.
- Failed: The status changes from Rebuilding to Stopped. The instance will roll back to the pre-failure status and remain in the shutdown status. Please retry or contact customer service for assistance.
After you change the operating system, you must perform the following operations before the data disk can be used as expected.
Switch between Linux operating systems
Switch between Windows and Linux operating systems
- Execute the following command to view information about unmounted data volumes.
- If the following result is displayed, the original data volume vdb (this volume contains one partition vdb1) is not mounted.
-
- Execute the following command to create a mount point.
tip
Replace /data with the name of the target mount point.
- Execute the following command to mount the data volume to the target mount point.
tip
Replace /dev/vdb1 with the name of the target data volume partition.
Replace /data/ with the name of the target mount point.
- Configure automatic mounting.
- Execute the following command to query the UUID of the partition.
tip
Please replace /dev/vdb1 with the target data disk partition name.
-
- Run the following command to open the /etc/fstab file.
- Press the i key to enter edit mode, and add the following content at the end of the file.
tip
Replace 9439749e-8d07-4ce2-9591-xxxxxbc9 with the actual UUID of the target volume partition.
Replace /data with the actual mount point name for the target volume partition.
Replace ext4 with the actual file system format of the target volume partition.
- Press the esc key to exit editing, enter :wq, and press Enter to save and exit the file.
- After the Linux operating system is changed to a Windows operating system, the Windows operating system cannot recognize file system formats such as ext3, ext4, and XFS by default.
- If your data volume contains important data, you can install software (such as Ext2Read or Ext2Fsd) to recognize the data volume and obtain the data.
- After the Windows operating system is changed to a Linux operating system, the Linux operating system cannot recognize the NTFS file system format by default.
- If your data volume contains important data, you can install software (such as ntfsprogs) to recognize the data volume and retrieve the data.
Related documents
Last updated: 2026.08.04 11:11:47