Got it

How to Set Automatic Disk Attachment at a System Start

Created: Feb 25, 2022 12:20:58Latest reply: Feb 26, 2022 03:49:10 196 5 0 0 0
  Rewarded HiCoins: 0 (problem resolved)

Hello, everyone!

I have an ECS, do you know how to set automatic disk attachment at a system start?

Product: Huawei Cloud Stack

Thanks in advance!

  • x
  • convention:

Featured Answers

Best answer

Recommended answer

olive.zhao
Admin Created Feb 25, 2022 12:35:08

Posted by pupu.F at 2022-02-25 12:25 Linux OS.

Hello,

When enabling automatic disk
attachment, you cannot directly specify /dev/xvdb1 in /etc/fstab. This is because
the sequence codes of the instance may change during an instance stop or start
process. You are advised to use the universally unique ²nì²fià (UUID) in /etc/
fstab to automatically attach the disk at a system start.

1. Run the following command to query the partition UUID: 

blkid Disk partition 

For example, run the following command to query the UUID of /dev/xvdb1

blkid /dev/xvdb1 

Information similar to the following is displayed: (The UUID of /dev/xvdb1 is
displayed.) 

[root@ecs-b656 test]# blkid /dev/xvdb1 
/dev/xvdb1: UUID="1851e23f-1c57-40ab-86bb-5fc5fc606ffa" TYPE="ext4"

2. Run the following command to open the fstab file using the vi editor: 

vi /etc/fstab 

3. Press i to enter the editing mode. 

4. Move the cursor to the end of the file and press Enter. Then add the following
information: 

UUID=xxx attachment directory file system defaults 0 2 

Assuming that the fià system is ext4 and the attachment directory is /mnt/sdc

UUID="1851e23f-1c57-40ab-86bb-5fc5fc606ffa /mnt/sdc ext4 defaults 0 2

5. Press Esc, enter :wq, and press Enter

The system saves the configuration and exits the vi editor.

Hope this helps!

View more
  • x
  • convention:

Saqibaz
Saqibaz Created Feb 26, 2022 03:48:50 (0) (0)
 
All Answers
olive.zhao
olive.zhao Admin Created Feb 25, 2022 12:23:20

Hello, Pupu.

What is the OS of your ECS? windows? Linux? Euler OS?

Wait for your feedback!

View more
  • x
  • convention:

pupu.F
pupu.F Created Feb 25, 2022 12:25:04

Posted by olive.zhao at 2022-02-25 12:23 Hello, Pupu.What is the OS of your ECS? windows? Linux? Euler OS?Wait for your feedback!
Linux OS.
View more
  • x
  • convention:

olive.zhao
olive.zhao Admin Created Feb 25, 2022 12:35:08

Posted by pupu.F at 2022-02-25 12:25 Linux OS.

Hello,

When enabling automatic disk
attachment, you cannot directly specify /dev/xvdb1 in /etc/fstab. This is because
the sequence codes of the instance may change during an instance stop or start
process. You are advised to use the universally unique ²nì²fià (UUID) in /etc/
fstab to automatically attach the disk at a system start.

1. Run the following command to query the partition UUID: 

blkid Disk partition 

For example, run the following command to query the UUID of /dev/xvdb1

blkid /dev/xvdb1 

Information similar to the following is displayed: (The UUID of /dev/xvdb1 is
displayed.) 

[root@ecs-b656 test]# blkid /dev/xvdb1 
/dev/xvdb1: UUID="1851e23f-1c57-40ab-86bb-5fc5fc606ffa" TYPE="ext4"

2. Run the following command to open the fstab file using the vi editor: 

vi /etc/fstab 

3. Press i to enter the editing mode. 

4. Move the cursor to the end of the file and press Enter. Then add the following
information: 

UUID=xxx attachment directory file system defaults 0 2 

Assuming that the fià system is ext4 and the attachment directory is /mnt/sdc

UUID="1851e23f-1c57-40ab-86bb-5fc5fc606ffa /mnt/sdc ext4 defaults 0 2

5. Press Esc, enter :wq, and press Enter

The system saves the configuration and exits the vi editor.

Hope this helps!

View more
  • x
  • convention:

Saqibaz
Saqibaz Created Feb 26, 2022 03:48:50 (0) (0)
 
Saqibaz
Saqibaz Created Feb 26, 2022 03:49:10

Thanks for sharing
View more
  • x
  • convention:

Comment

You need to log in to comment to the post Login | Register
Comment

Notice: To protect the legitimate rights and interests of you, the community, and third parties, do not release content that may bring legal risks to all parties, including but are not limited to the following:
  • Politically sensitive content
  • Content concerning pornography, gambling, and drug abuse
  • Content that may disclose or infringe upon others ' commercial secrets, intellectual properties, including trade marks, copyrights, and patents, and personal privacy
Do not share your account and password with others. All operations performed using your account will be regarded as your own actions and all consequences arising therefrom will be borne by you. For details, see " User Agreement."

My Followers

Login and enjoy all the member benefits

Login

Block
Are you sure to block this user?
Users on your blacklist cannot comment on your post,cannot mention you, cannot send you private messages.
Reminder
Please bind your phone number to obtain invitation bonus.
Information Protection Guide
Thanks for using Huawei Enterprise Support Community! We will help you learn how we collect, use, store and share your personal information and the rights you have in accordance with Privacy Policy and User Agreement.