Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

The method of initializing the cloud disk used by the system disk or data disk

2025-02-22 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/03 Report--

In this article, we will learn about how to initialize the cloud disk used by the system disk or data disk. There is a certain reference value, friends in need can refer to, hope to help you.

Reinitialize the cloud disk

When the cloud disk is mounted on the ECS instance, you can use the reinitialize disk feature to restore the cloud disk used as the system disk or data disk to the state it was created in. After reinitialization:

The system disk returns to the state it was in when it was first created. For example, if you create an instance with the public image Windows Server 2008 R2, the operating system remains the original Windows Server 2008 R2 after the system disk is reinitialized, but the installed applications and the resulting data are deleted after the instance is created.

Description

Initialization is performed after replacing the system disk, initializing the replaced system disk, not the pre-replacement system disk.

The cloud disk used as a data disk will return to its original state:

If it was originally empty, it will revert to empty.

If the cloud disk is created through a snapshot, it will return to the state of the snapshot.

If the automatic snapshot policy is applied to the cloud disk, the settings are still valid after reinitialization and do not need to be reset.

Reinitializing the disk will not change the IP address of the ECS instance and the ID of the cloud disk.

Reinitializing the disk does not delete automatic or manual snapshots of the cloud disk, which you can use to roll back the cloud disk.

Warning

You must stop the ECS instance before reinitializing the disk. This operation will disrupt your service. Please proceed with caution.

After reinitializing the disk, the data on the cloud disk will be lost. Be sure to back up the data in advance, such as creating a snapshot for the cloud disk. For more information, please see create Snapshot.

Reinitialize the system disk

prerequisite

When initializing the system disk of a Linux instance, if you use key pair authentication, you must have created the SSH key pair or imported the SSH key pair.

Operation steps

Reinitialize the system disk by following these steps:

Log in to the ECS Management console.

Select the region.

In the left navigation bar, click the instance.

Find the instance that needs to initialize the system disk, and click the instance ID to enter the instance details page.

In the upper right corner of the page, click stop to stop the instance.

Description

If it is a postpaid VPC instance and you have enabled the no charge feature for downtime of postpaid instances, click OK in the pop-up box. In the stop instance dialog box, choose to stop and keep the instance and continue to charge. If the downtime free mode is used, the instance may not be started successfully after reinitializing the system disk.

After the instance has entered the stopped state, in the left navigation bar, click the instance disk.

Locate the system disk, and in the Action column, click reinitialize the disk.

In the pop-up reinitialization disk dialog box, complete the following settings:

Set the authentication method:

Windows instance: reset the login password of the instance. You can use the old password or you can specify a new password.

Linux instance: select to set the key or password, and bind the key pair or reset the password. You can use the old password or you can specify a new password.

(optional) Security reinforcement: choose to activate it for free. After enabling the security hardening feature, your instance will automatically load the CVM security component free of charge, providing security features such as website backdoor detection, remote login reminder, brute force cracking and interception.

(optional) start instance policy: start after selecting reset disk. After initialization, the instance starts automatically.

Click OK to reinitialize the disk.

For main account users only: after obtaining and entering the SMS verification code, click OK to initialize the system disk.

For Linux instances only: if the data disk is mounted before initialization, you need to recreate the mount point information and mount the file system.

Description

In the Linux instance, reinitializing the system disk will not change the contents of the data disk, but the mount information of the data disk will be lost, so you need to do this.

After the system disk is reinitialized, you need to redeploy the business (including application and configuration) to restore the business as soon as possible.

Reinitialize the data disk

After reinitialization, the status of the data disk varies according to the initial state of the cloud disk and the operating system of the instance:

Windows instance: no matter whether the data disk is created from a snapshot or a completely new empty disk, after reinitialization, the data disk will return to its original state after creation, but it can be used directly without other operations.

Linux instance:

If the data disk is created as an empty disk: the file system and contents of the data disk are completely lost, you must reformat, partition the data disk, and mount the data disk partition.

Description

In this case, if you write the command to boot the auto-mount partition in the / etc/fstab file before reinitialization, the boot auto-mount will fail after reinitialization, and an exception will generally occur during startup. Therefore, before reinitializing the data disk, you must comment out the partition of the data disk that is automatically mounted on the boot machine in / etc/fstab.

If the data disk is created from a snapshot: the data disk will revert to the original snapshot state, and there is no need to remount the data disk partition, but all data generated after the data disk is successfully created will be lost.

In the step description in this article, / dev/vdb1 is used to represent the data disk partition, and / InitTest is used to represent the mount point. You can replace it according to the actual situation.

prerequisite

The cloud disk has been mounted to the instance. For more information, please see mounting the cloud disk.

Operation steps

Reinitialize the data disk by following these steps:

Only applicable to Linux instances: if the data disk is created as an empty disk and you add the command to automatically mount the data disk partition in / etc/fstab, you must comment out the command to start and mount the data disk partition in / etc/fstab. The steps are as follows:

Remotely connect to the Linux instance.

Run vim / etc/fstab.

Press I to enter edit mode.

Find the data disk partition mount information and add # to comment out the mount information, as shown below.

# / dev/vdb1 / InitTest ext3 defaults 0 0

Press Esc to exit edit mode, enter: wq to save and exit.

Log in to the ECS Management console.

In the left navigation bar, click the instance.

Select the region.

Find the instance that needs to initialize the data disk, and click the instance ID to enter the instance details page.

In the upper right corner of the page, click stop to stop the instance.

Description

If it is a postpaid VPC instance and you have enabled the no charge feature for downtime of postpaid instances, click OK in the pop-up box. In the stop instance dialog box, choose to stop and keep the instance and continue to charge. If the downtime free mode is used, the instance may not be started successfully after reinitializing the data disk.

After the instance has entered the stopped state, in the left navigation bar, click the instance disk.

Locate the data disk, and in the Action column, click reinitialize the disk.

In the pop-up reinitialize disk dialog box, after reading the prompt carefully, click OK to reinitialize the disk.

Only applicable to main account users: after obtaining and entering the SMS verification code, click OK.

In the left navigation bar, click instance details.

In the upper right corner of the page, click start, start the instance, and complete the initialization of the data disk.

For Linux instances only: if the data disk is created as an empty disk, you must Linux format and mount the data disk.

After the data disk is reinitialized, you need to redeploy the business (including application and configuration) to restore the business as soon as possible.

Related API

ReInitDisk

The above is a brief introduction to the initialization method of the cloud disk used by the system disk or data disk. Of course, the differences in the detailed use of the above have to be understood by everyone. If you want to know more, welcome to follow the industry information channel!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report