getting started - huawei · elastic volume service getting started issue 03 date 2018-09-26 huawei...

86
Elastic Volume Service Getting Started Issue 03 Date 2018-09-26 HUAWEI TECHNOLOGIES CO., LTD.

Upload: others

Post on 20-Jul-2020

0 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Getting Started - Huawei · Elastic Volume Service Getting Started Issue 03 Date 2018-09-26 HUAWEI TECHNOLOGIES CO., LTD

Elastic Volume Service

Getting Started

Issue 03

Date 2018-09-26

HUAWEI TECHNOLOGIES CO., LTD.

Page 2: Getting Started - Huawei · Elastic Volume Service Getting Started Issue 03 Date 2018-09-26 HUAWEI TECHNOLOGIES CO., LTD

Copyright © Huawei Technologies Co., Ltd. 2020. All rights reserved.

No part of this document may be reproduced or transmitted in any form or by any means without priorwritten consent of Huawei Technologies Co., Ltd. Trademarks and Permissions

and other Huawei trademarks are trademarks of Huawei Technologies Co., Ltd.All other trademarks and trade names mentioned in this document are the property of their respectiveholders. NoticeThe purchased products, services and features are stipulated by the contract made between Huawei andthe customer. All or part of the products, services and features described in this document may not bewithin the purchase scope or the usage scope. Unless otherwise specified in the contract, all statements,information, and recommendations in this document are provided "AS IS" without warranties, guaranteesor representations of any kind, either express or implied.

The information in this document is subject to change without notice. Every effort has been made in thepreparation of this document to ensure accuracy of the contents, but all statements, information, andrecommendations in this document do not constitute a warranty of any kind, express or implied.

Issue 03 (2018-09-26) Copyright © Huawei Technologies Co., Ltd. i

Page 3: Getting Started - Huawei · Elastic Volume Service Getting Started Issue 03 Date 2018-09-26 HUAWEI TECHNOLOGIES CO., LTD

Contents

1 Basic Operation Procedure.................................................................................................... 1

2 Step 1: Preparations................................................................................................................4

3 Step 2: Purchase an EVS Disk................................................................................................5

4 Step 3: Attach an EVS Disk..................................................................................................174.1 Attaching a Non-Shared Disk........................................................................................................................................... 174.2 Attaching a Shared Disk..................................................................................................................................................... 18

5 Step 4: Initialize an EVS Data Disk....................................................................................205.1 Introduction to Data Disk Initialization Scenarios and Partition Styles.............................................................205.2 Initializing a Windows Data Disk (Windows Server 2008).................................................................................... 225.3 Initializing a Windows Data Disk (Windows Server 2016).................................................................................... 295.4 Initializing a Linux Data Disk (fdisk)..............................................................................................................................375.5 Initializing a Linux Data Disk (parted).......................................................................................................................... 435.6 Initializing a Windows Data Disk Larger Than 2 TB (Windows Server 2008)................................................. 495.7 Initializing a Windows Data Disk Larger Than 2 TB (Windows Server 2012)................................................. 575.8 Initializing a Linux Data Disk Larger Than 2 TB (parted).......................................................................................655.9 Initializing Windows Data Disks Using Script............................................................................................................. 715.10 Initializing Linux Data Disks Using Script.................................................................................................................. 79

A Change History...................................................................................................................... 83

Elastic Volume ServiceGetting Started Contents

Issue 03 (2018-09-26) Copyright © Huawei Technologies Co., Ltd. ii

Page 4: Getting Started - Huawei · Elastic Volume Service Getting Started Issue 03 Date 2018-09-26 HUAWEI TECHNOLOGIES CO., LTD

1 Basic Operation Procedure

EVS disks can be attached to servers and be used as system disks and data disks.Table 1-1 lists the disk purchasing methods.

Table 1-1 Purchasing methods

Disk Description Method

Systemdisk

System disks arepurchased along withservers and cannot bepurchased separately.

● Methods of Purchasing an ECS● Creating a BMS Supporting Quick

Provisioning

Datadisk

Data disks can bepurchased along withservers or separately.

● Methods of Purchasing an ECS● Creating a BMS Supporting Quick

Provisioning● Purchasing an EVS Disk

Figure 1-1 shows how to purchase a data disk separately.

Elastic Volume ServiceGetting Started 1 Basic Operation Procedure

Issue 03 (2018-09-26) Copyright © Huawei Technologies Co., Ltd. 1

Page 5: Getting Started - Huawei · Elastic Volume Service Getting Started Issue 03 Date 2018-09-26 HUAWEI TECHNOLOGIES CO., LTD

Figure 1-1 Purchase procedure

1. Register with HUAWEI CLOUD and top up the account. For details, see Step 1:Preparations.

2. Set the disk type, capacity, and name. For more information, see Step 2:Purchase an EVS Disk.

3. Attach the separately purchased disk to a server. For more information, seethe following topics:

– Attaching a Non-Shared Disk

– Attaching a Shared Disk

4. A disk cannot be used right away after being attached to a server. You mustlog in to the server and initialize the disk. For more information, see thefollowing topics:

– Introduction to Data Disk Initialization Scenarios and Partition Styles

– Windows

▪ Initializing a Windows Data Disk (Windows Server 2008)

▪ Initializing a Windows Data Disk (Windows Server 2016)

▪ Initializing a Windows Data Disk Larger Than 2 TB (WindowsServer 2008)

▪ Initializing a Windows Data Disk Larger Than 2 TB (WindowsServer 2012)

– Linux

▪ Initializing a Linux Data Disk (fdisk)

Elastic Volume ServiceGetting Started 1 Basic Operation Procedure

Issue 03 (2018-09-26) Copyright © Huawei Technologies Co., Ltd. 2

Page 6: Getting Started - Huawei · Elastic Volume Service Getting Started Issue 03 Date 2018-09-26 HUAWEI TECHNOLOGIES CO., LTD

▪ Initializing a Linux Data Disk (parted)

▪ Initializing a Linux Data Disk Larger Than 2 TB (parted)

Elastic Volume ServiceGetting Started 1 Basic Operation Procedure

Issue 03 (2018-09-26) Copyright © Huawei Technologies Co., Ltd. 3

Page 7: Getting Started - Huawei · Elastic Volume Service Getting Started Issue 03 Date 2018-09-26 HUAWEI TECHNOLOGIES CO., LTD

2 Step 1: Preparations

Before using the EVS service, you need to make the following preparations:

● Register with HUAWEI CLOUD and Complete Real-Name Authentication● Top Up Your Account

Register with HUAWEI CLOUD and Complete Real-Name AuthenticationIf you already have a HUAWEI CLOUD account, skip this part. If you do not have aHUAWEI CLOUD account, perform the following steps to create one:

1. Visit https://www.huaweicloud.com/ and click Register.2. On the displayed Register page, register an account as prompted. For details,

see Registering on the HUAWEI CLOUD Management Console.After you have successfully registered, the system automatically redirects youto your personal information page.

3. Complete real-name authentication by following the instructions in Real-Name Authentication.

Top Up Your AccountEnsure that your account has sufficient balance.

● For EVS price details, see Billing Modes.● For details about how to top up an account, see Topping Up an Account.

Elastic Volume ServiceGetting Started 2 Step 1: Preparations

Issue 03 (2018-09-26) Copyright © Huawei Technologies Co., Ltd. 4

Page 8: Getting Started - Huawei · Elastic Volume Service Getting Started Issue 03 Date 2018-09-26 HUAWEI TECHNOLOGIES CO., LTD

3 Step 2: Purchase an EVS Disk

ScenariosEVS disks can be system disks or data disks of servers.

● When a server is created, the system disk is automatically purchased andattached. You do not need to purchase the system disk separately.

● Data disks can be purchased during or after the server purchase. If youpurchase data disks during the server purchase, the system will automaticallyattach the data disks to the server. If you purchase data disks after the servercreation, you need to manually attach the purchased data disks to the server.

NO TE

● The billing mode of the EVS disk purchased with the the server is the same as that ofthe server.

● A yearly/monthly-billed EVS disk purchased with a yearly/monthly-billed server cannotbe attached to other servers.

This topic describes how to separately purchase disks on the EVS console.

Procedure

Step 1 Log in to the management console.

Step 2 Under Storage, click Elastic Volume Service.

The disk list page is displayed.

Step 3 Click Buy Disk.

Step 4 Configure basic disk information according to Table 3-1.

Elastic Volume ServiceGetting Started 3 Step 2: Purchase an EVS Disk

Issue 03 (2018-09-26) Copyright © Huawei Technologies Co., Ltd. 5

Page 9: Getting Started - Huawei · Elastic Volume Service Getting Started Issue 03 Date 2018-09-26 HUAWEI TECHNOLOGIES CO., LTD

Table 3-1 Parameter description

Parameter

Sub-Parameter

Description ExampleValue

BillingMode

- MandatoryYou can pay for EVS disks in two ways:● Yearly/Monthly● Pay-per-use

Yearly/Monthly

Region - MandatoryResources are region-specific andcannot be used across regions throughinternal network connections. For lownetwork latency and quick resourceaccess, select the nearest region.

-

AZ - MandatorySpecifies the availability zone (AZ)where you want to create the disk.NOTE

● Disks can only be attached to theservers in the same AZ.

● The AZ of a disk cannot be changedafter the disk has been created.

AZ1

DiskSpecifications

Disk Type Mandatory. The disk type cannot bechanged after the purchase iscomplete.The available disk types are as follows:● Common I/O (previous generation

product)● High I/O● General Purpose SSD● Ultra-high I/O● Extreme SSD (open beta testing)NOTE

When a disk is created from a snapshot,the disk type of the newly created disk willbe consistent with that of the snapshot'ssource disk.

Ultra-high I/O

Elastic Volume ServiceGetting Started 3 Step 2: Purchase an EVS Disk

Issue 03 (2018-09-26) Copyright © Huawei Technologies Co., Ltd. 6

Page 10: Getting Started - Huawei · Elastic Volume Service Getting Started Issue 03 Date 2018-09-26 HUAWEI TECHNOLOGIES CO., LTD

Parameter

Sub-Parameter

Description ExampleValue

Capacity(GB)

MandatorySpecifies the disk size. Only data diskscan be created on the current page,and the disk capacity ranges from 10GB to 32768 GB.NOTE

● When you use a backup to create adisk, the disk capacity must be greaterthan or equal to the backup size. In thecondition that you do not specify thedisk capacity, if the backup size issmaller than 10 GB, the defaultcapacity 10 GB will be used as the diskcapacity; if the backup size is greaterthan 10 GB, the disk capacity will beconsistent with the backup size.

● When you use a snapshot to create adisk, the disk capacity must be greaterthan or equal to the snapshot size. Inthe condition that you do not specifythe disk capacity, if the snapshot size issmaller than 10 GB, the defaultcapacity 10 GB will be used as the diskcapacity; if the snapshot size is greaterthan 10 GB, the disk capacity will beconsistent with the snapshot size.

● The system shows you the maximumnumber of disks as well as themaximum disk capacity allowed topurchase. To ensure effective resourceusage, if the disk capacity you needexceeds the upper limit, click IncreaseQuota to obtain a higher quota. Youcan purchase the disk capacity youneed after the request is approved.

100 GB

Elastic Volume ServiceGetting Started 3 Step 2: Purchase an EVS Disk

Issue 03 (2018-09-26) Copyright © Huawei Technologies Co., Ltd. 7

Page 11: Getting Started - Huawei · Elastic Volume Service Getting Started Issue 03 Date 2018-09-26 HUAWEI TECHNOLOGIES CO., LTD

Parameter

Sub-Parameter

Description ExampleValue

SelectDataSource● Create

frombackup

● Createfromsnapshot

● Createfromimage

Optional● If you choose Create from backup,

the backup data is used to createthe disk.Click Select Data Source andchoose Create from backup. Onthe displayed page, select thetarget backup and click OK.NOTE

– One backup cannot be used forconcurrent disk creation operationsat the same time. For example, ifyou are creating disk A from abackup, this backup can be used tocreate another disk only after disk Ahas been created.

– If a disk is created from a backup ofa system disk, the new disk can beused as a data disk only.

● If you choose Create fromsnapshot, the snapshot data is usedto create the disk.Click Select Data Source andchoose Create from snapshot. Onthe displayed page, select thetarget snapshot and click OK.NOTE

– The disk type of the new disk is thesame as that of the snapshot'ssource disk.

– The device type of the new disk isthe same as that of the snapshot'ssource disk.

– The encryption attribute of the newdisk is the same as that of thesnapshot's source disk.

● If you choose Create from image,the image data is used to create thedisk.Click Select Data Source andchoose Create from image. On thedisplayed page, select the targetimage and click OK.

● Createfrombackup:autobackup-001

● Createfromsnapshot:snapshot-001

Elastic Volume ServiceGetting Started 3 Step 2: Purchase an EVS Disk

Issue 03 (2018-09-26) Copyright © Huawei Technologies Co., Ltd. 8

Page 12: Getting Started - Huawei · Elastic Volume Service Getting Started Issue 03 Date 2018-09-26 HUAWEI TECHNOLOGIES CO., LTD

Parameter

Sub-Parameter

Description ExampleValue

NOTE– The device type of the new disk is

the same as that of the image'ssource disk.

– If a disk is created from an image,the encryption attribute of the diskwill be the same as that of theimage's source disk.

Elastic Volume ServiceGetting Started 3 Step 2: Purchase an EVS Disk

Issue 03 (2018-09-26) Copyright © Huawei Technologies Co., Ltd. 9

Page 13: Getting Started - Huawei · Elastic Volume Service Getting Started Issue 03 Date 2018-09-26 HUAWEI TECHNOLOGIES CO., LTD

Parameter

Sub-Parameter

Description ExampleValue

CloudBackupandRecovery

- Cloud Backup and Recovery (CBR) letsyou back up EVS disks and ECSs anduse the backups for restoration. Afteryou set Cloud Backup and Recovery,the system binds the EVS disk to thecloud backup vault and associates thedisk with the selected backup policy toperiodically back up the disk.● Do not use: Skip this configuration

if CBR is not required. If you stillneed to set backup protection aftera disk is successfully purchased, login to the CBR console, locate thetarget vault, and bind the disk tothe vault.

● Use existing1. Select an existing cloud backup

vault from the drop-down list.2. Select a backup policy from the

drop-down list, or log in to theCBR console and configure adesired one.

● Buy now:1. Set the name of the cloud

backup vault, which is acharacter string consisting of 1to 64 characters, includingletters, digits, underscores (_),and hyphens (-), for example,vault-f61e. The default namingrule is vault_xxxx.

2. Enter the vault capacity, which isrequired for backing up the disk.The vault capacity cannot be lessthan the size of the disk to bebacked up. The value rangesfrom the disk size to 10,485,760in the unit of GB.

3. Select a backup policy from thedrop-down list, or log in to theCBR console and configure adesired one.

-

Elastic Volume ServiceGetting Started 3 Step 2: Purchase an EVS Disk

Issue 03 (2018-09-26) Copyright © Huawei Technologies Co., Ltd. 10

Page 14: Getting Started - Huawei · Elastic Volume Service Getting Started Issue 03 Date 2018-09-26 HUAWEI TECHNOLOGIES CO., LTD

Parameter

Sub-Parameter

Description ExampleValue

More AdvancedSettings● Share● SCSI● Encryp

tion

Optional● Share

If you select Share, a shared disk iscreated. A shared disk can beattached to up to 16 servers. If youdo not select Share, a non-shareddisk is created, and the disk can beattached to one a server only.When you select both SCSI andShare, a shared SCSI disk is created.NOTE

The sharing attribute of a disk cannotbe changed after the disk has beencreated.

● SCSIIf you select SCSI, a SCSI disk iscreated. Such disks allow the serverOS to directly access the underlyingstorage media and send SCSIcommands to the disks. If you donot select SCSI, a VBD disk iscreated. That said, the disk devicetype is VBD, the default device type.NOTE

The device type of a disk cannot bechanged after the disk has beencreated.

● EncryptionThe encryption function on thisconsole is used for data diskencryption only. System diskencryption depends on images. Fordetails, see the Image ManagementService User Guide.To use the disk encryption function,select Encryption. The displayeddialog box contains the followingparameters:– Create Agency

An agency is a trust relationshipbetween two tenants or services.A tenant can create an agency togrant resource access rights toanother tenant or service. If theKMS access rights are notgranted to EVS, the Create

-

Elastic Volume ServiceGetting Started 3 Step 2: Purchase an EVS Disk

Issue 03 (2018-09-26) Copyright © Huawei Technologies Co., Ltd. 11

Page 15: Getting Started - Huawei · Elastic Volume Service Getting Started Issue 03 Date 2018-09-26 HUAWEI TECHNOLOGIES CO., LTD

Parameter

Sub-Parameter

Description ExampleValue

Agency dialog box will bedisplayed. Otherwise, it will notbe displayed.Click Yes to grant the KMSaccess rights to EVS. After therights have been granted, EVScan obtain KMS keys to encryptor decrypt EVS disks.After the KMS access rights havebeen granted, follow-upoperations do not require therights to be granted again.

– KMS Key NameKMS Key Name is displayedonly after the KMS access rightshave been granted.KMS Key Name is the identifierof the key, and you can use KMSKey Name to specify the KMSkey that is to be used forencryption. One of the followingkeys can be used:Default Master Key: After theKMS access rights have beengranted to EVS, the systemautomatically creates a DefaultMaster Key and names it evs/default.CMKs: Existing or newly createdCMKs. For details, see KeyManagement Service >Creating a CMK in the DataEncryption Workshop UserGuide.

Elastic Volume ServiceGetting Started 3 Step 2: Purchase an EVS Disk

Issue 03 (2018-09-26) Copyright © Huawei Technologies Co., Ltd. 12

Page 16: Getting Started - Huawei · Elastic Volume Service Getting Started Issue 03 Date 2018-09-26 HUAWEI TECHNOLOGIES CO., LTD

Parameter

Sub-Parameter

Description ExampleValue

NOTE– Before you use the EVS disk

encryption function, KMS accessrights need to be granted to EVS. Ifyou have the right to grant thepermission, grant the KMS accessrights to EVS directly. If you do nothave this permission, contact a userwith the security administratorrights to grant KMS access rights toEVS, then repeat the precedingoperations.

– The encryption attribute of a diskcannot be changed after the disk iscreated.

Tag OptionalDuring the EVS disk creation, you cantag the EVS resources. Tags identifycloud resources for purposes of easycategorization and quick search.A tag is composed of a key-value pair.● Key: Mandatory if the disk is going

to be taggedA tag key is a string of no morethan 36 characters. It consists ofletters, digits, underscores (_),hyphens (-), and Unicodecharacters (\u4E00-\u9FFF).

● Value: Optional if the disk is goingto be taggedA tag value is a string of no morethan 43 characters. It consists ofletters, digits, underscores (_),periods (.), hyphens (-), andUnicode characters (\u4E00-\u9FFF).

NOTE● A maximum of 10 tags can be added

for an EVS disk.● Tag keys of the same EVS disk must be

unique.For details about tags, see the TagManagement Service User Guide.

-

Elastic Volume ServiceGetting Started 3 Step 2: Purchase an EVS Disk

Issue 03 (2018-09-26) Copyright © Huawei Technologies Co., Ltd. 13

Page 17: Getting Started - Huawei · Elastic Volume Service Getting Started Issue 03 Date 2018-09-26 HUAWEI TECHNOLOGIES CO., LTD

Parameter

Sub-Parameter

Description ExampleValue

EnterpriseProject

- MandatoryWhen creating EVS disks, you can addan existing enterprise project for thedisks.An enterprise project facilitatesproject-level management andgrouping of cloud resources and users.The default project is default.

default

DiskName

- Mandatory● If you create disks individually, this

parameter value is used as theactual disk name.The name can contain a maximumof 64 characters.

● If you create disks in a batch, thisparameter value is used as theprefix of disk names, and one diskname will be composed of thisparameter value and a four-digitnumber.The name can contain a maximumof 59 characters.NOTE

The name of a disk can be changedafter the disk is created.

For example,if you createtwo disks andset volumefor DiskName, theEVS disknames will bevolume-0001andvolume-0002.

Elastic Volume ServiceGetting Started 3 Step 2: Purchase an EVS Disk

Issue 03 (2018-09-26) Copyright © Huawei Technologies Co., Ltd. 14

Page 18: Getting Started - Huawei · Elastic Volume Service Getting Started Issue 03 Date 2018-09-26 HUAWEI TECHNOLOGIES CO., LTD

Parameter

Sub-Parameter

Description ExampleValue

Quantity - ● Usage duration: This parameter ismandatory if you select Yearly/Monthly for Billing Mode.You can choose 1 month to 5 yearsfor the usage duration.

● Auto Renewal: This parameter isoptional.Your order will automatically renewon a monthly or yearly basis,depending on if you purchased 1-9months, or 1-5 years.

● Disk quantity: This parameter isoptional.The default value is set to 1, whichmeans one disk will be created.Currently, you can create up to 100disks at a time.

NOTE● If the disk is created from a backup,

batch creation is not possible, and thisparameter must be set to 1.

● If the disk is created from a snapshot,batch creation is not possible, and thisparameter must be set to 1.

● The system shows you the maximumnumber of disks as well as themaximum disk capacity allowed topurchase. To ensure effective resourceusage, if the number of disks you needexceeds the upper limit, click IncreaseQuota to obtain a higher quota. Youcan purchase the disks you need afterthe request is approved.

Disk validityperiod: 1 yearSelect AutoRenewal.Disk quantity:1

Step 5 Click Next.

● If you select Yearly/Monthly for Billing Mode,

a. Check the disk details on the Confirm page.

b. Confirm the information and click Submit.

c. On the Pay page, select a desired payment method and confirm thepayment. The system displays a message indicating payment processedsuccessfully.

d. Click Back to Elastic Volume Service to return to the Elastic VolumeService page.

● If you select Pay-per-use for Billing Mode,

a. Check the disk details on the Confirm page.

Elastic Volume ServiceGetting Started 3 Step 2: Purchase an EVS Disk

Issue 03 (2018-09-26) Copyright © Huawei Technologies Co., Ltd. 15

Page 19: Getting Started - Huawei · Elastic Volume Service Getting Started Issue 03 Date 2018-09-26 HUAWEI TECHNOLOGIES CO., LTD

b. Confirm the information and click Submit. The system displays amessage indicating task submitted successfully.

c. Click Back to Disk List to return to the Elastic Volume Service page.

Step 6 Click Back to Disk List.

Step 7 Go back to the disk list page and view the disk status.

When the disk status changes to Available, the disk is successfully created.

----End

Elastic Volume ServiceGetting Started 3 Step 2: Purchase an EVS Disk

Issue 03 (2018-09-26) Copyright © Huawei Technologies Co., Ltd. 16

Page 20: Getting Started - Huawei · Elastic Volume Service Getting Started Issue 03 Date 2018-09-26 HUAWEI TECHNOLOGIES CO., LTD

4 Step 3: Attach an EVS Disk

4.1 Attaching a Non-Shared Disk

Scenarios

Independently purchased EVS disks are data disks. In the disk list, the function ofsuch disks is displayed as Data disk, and the status is displayed as Available. Inthis case, you need to attach the data disks to servers for use.

A system disk must be purchased during a server creation and is automaticallyattached. In the disk list, the function of such disks is displayed as System disk,and the status is displayed as In-use. After a system disk is detached from aserver, the disk function changes to Bootable disk, and the status changes toAvailable.

NO TE

Bootable disks are the system disks detached from servers. A bootable disk can be re-attached to a server and be used as a system disk or data disk depending on the devicename selected. For details, see Attaching an Existing System Disk.

This topic describes how to attach a non-shared disk. A non-shared disk can beattached to one server only.

Procedure

Step 1 Log in to the management console.

Step 2 Under Storage, click Elastic Volume Service.

The disk list page is displayed.

Step 3 Locate the target disk in the list and click Attach.

Step 4 Select the server and then select a device name from the drop-down list. Ensurethat the EVS disk and server are in the same AZ.

One device name can be attached with one EVS disk only. For the mappingbetween device names displayed on the management console and those on the

Elastic Volume ServiceGetting Started 4 Step 3: Attach an EVS Disk

Issue 03 (2018-09-26) Copyright © Huawei Technologies Co., Ltd. 17

Page 21: Getting Started - Huawei · Elastic Volume Service Getting Started Issue 03 Date 2018-09-26 HUAWEI TECHNOLOGIES CO., LTD

server, see What Is the Mapping Between Device Names and Disks? in theElastic Cloud Server User Guide.

Step 5 Click OK. A dialog box is displayed, showing "The attaching process is NOTcompleted yet. You must initialize the disk before using it".

Step 6 Click OK to return to the disk list page. The status of the disk is Attaching,indicating that the disk is being attached to the server. When the disk statuschanges to In-use, the disk is successfully attached.

Step 7 Initialize the EVS disk.

After the disk has been attached to a server, the disk can be used only after youhave initialized it. For details, see Introduction to Data Disk InitializationScenarios and Partition Styles.

----End

Related OperationsIf your disk cannot be attached to a server, see Why My EVS Disk Cannot BeAttached to a Server?

For details about how to attach an existing system disk, see Attaching anExisting System Disk.

4.2 Attaching a Shared Disk

ScenariosIndependently purchased EVS disks are data disks. In the disk list, the function ofsuch disks is displayed as Data disk, and the status is displayed as Available. Inthis case, you need to attach the data disks to servers for use.

This topic describes how to attach a shared disk.

If your disk cannot be attached to a server, see Why My EVS Disk Cannot BeAttached to a Server?

Constraints● A shared disk can be attached to a maximum of 16 servers. These servers and

the shared disk must be in the same AZ.● If a shared disk is in the In-use state, ensure that the maximum number of

servers that the disk can be attached to has not been reached.● All the servers of a shared disk must run either Windows or Linux no matter

the disk is attached to them in a batch or individually.For example, if you attach a shared disk to multiple Windows servers in abatch and then detach it from all its servers, the disk cannot be attached toLinux servers later. This is because Windows and Linux support different filesystems and cannot identify the original file system on the disk. Improperoperations may damage the original file system.

● A shared disk can only be used as a data disk. It cannot be used as a systemdisk.

Elastic Volume ServiceGetting Started 4 Step 3: Attach an EVS Disk

Issue 03 (2018-09-26) Copyright © Huawei Technologies Co., Ltd. 18

Page 22: Getting Started - Huawei · Elastic Volume Service Getting Started Issue 03 Date 2018-09-26 HUAWEI TECHNOLOGIES CO., LTD

Procedure

Step 1 Log in to the management console.

Step 2 Under Storage, click Elastic Volume Service.

The disk list page is displayed.

Step 3 Locate the target disk in the list and click Attach.

Shared disks support batch attachment so that you can attach a shared disk tomultiple servers at a time. The left area in the Attach Disk dialog box shows theserver list. After you select the target servers and click the right arrow key in themiddle, the selected servers will be displayed in the right area.

Step 4 Select the target servers and then select a device name from the drop-down listfor each server you selected. Ensure that the EVS disk and servers are in the sameAZ.

One device name can be attached with one EVS disk only. If a device name hasbeen used, it will no longer be displayed in the drop-down list and cannot beselected.

Step 5 Click OK. A dialog box is displayed, showing "The attaching process is NOTcompleted yet. You must initialize the disk before using it".

Step 6 Click OK to return to the disk list page. The status of the disk is Attaching,indicating that the disk is being attached to the servers. When the disk statuschanges to In-use, the disk is successfully attached.

NO TICE

If you simply attach a shared EVS disk to multiple servers, files cannot be sharedbetween the servers as shared EVS disks do not have the cluster capability.Therefore, build a shared file system or deploy a cluster management system toshare files between servers.

----End

Related OperationsIf your disk cannot be attached to a server, see Why My EVS Disk Cannot BeAttached to a Server?

For details about how to attach an existing system disk, see Attaching anExisting System Disk.

Elastic Volume ServiceGetting Started 4 Step 3: Attach an EVS Disk

Issue 03 (2018-09-26) Copyright © Huawei Technologies Co., Ltd. 19

Page 23: Getting Started - Huawei · Elastic Volume Service Getting Started Issue 03 Date 2018-09-26 HUAWEI TECHNOLOGIES CO., LTD

5 Step 4: Initialize an EVS Data Disk

5.1 Introduction to Data Disk Initialization Scenariosand Partition Styles

ScenariosAfter a disk is attached to a server, you need to log in to the server to initialize thedisk, that is, format the disk. You must initialize a disk before accessing it.● System disk

A system disk does not require manual initialization because it isautomatically created and initialized upon server creation. The default diskpartition style is master boot record (MBR).

● Data disk– If a data disk is created along with a server, it will be automatically

attached to the server.– If a data disk is created separately, you need to manually attach it to a

server.In both cases, you must initialize the data disk before using it. Choose aproper disk partition style based on your service plan.

ConstraintsA disk created from a data source does not need to be initialized. Such a diskcontains the data of the data source in the beginning. Initializing the disk mayclear the initial data on this disk.

Disk Partition StylesTable 5-1 lists the common disk partition styles. In Linux, different disk partitionstyles require different partitioning tools.

Elastic Volume ServiceGetting Started 5 Step 4: Initialize an EVS Data Disk

Issue 03 (2018-09-26) Copyright © Huawei Technologies Co., Ltd. 20

Page 24: Getting Started - Huawei · Elastic Volume Service Getting Started Issue 03 Date 2018-09-26 HUAWEI TECHNOLOGIES CO., LTD

Table 5-1 Disk partition styles

DiskPartitionStyle

MaximumDiskCapacitySupported

Maximum Number ofPartitions Supported

LinuxPartitioningTool

Master BootRecord (MBR)

2 TB ● 4 primary partitions● 3 primary partitions and 1

extended partitionWith MBR, one may createseveral primary partitions andan extended partition. Anextended partition must bedivided into several logicalpartitions before use. Forexample, if 6 partitions need tobe created, you can create thepartitions in the following twoways:● 3 primary partitions and 1

extended partition, with theextended partition dividedinto 3 logical partitions

● 1 primary partition and 1extended partition, with theextended partition dividedinto 5 logical partitions

● fdisk● parted

GUIDPartitionTable (GPT)

18 EB1 EB =1048576 TB

UnlimitedDisk partitions created usingGPT are not categorized.

parted

NO TICE

The maximum disk capacity supported by MBR is 2 TB, and that supported by GPTis 18 EB. Because a data disk currently supports up to 32 TB, use the GPT partitionstyle if your disk capacity is larger than 2 TB.

If you change the disk partition style after the disk has been used, the data on thedisk will be cleared. Therefore, select a proper disk partition style when initializingthe disk.

Partitioning Operation Guide

For a disk smaller than 2 TB, see the following topics:

● Initializing a Windows Data Disk (Windows Server 2008)

● Initializing a Windows Data Disk (Windows Server 2016)

Elastic Volume ServiceGetting Started 5 Step 4: Initialize an EVS Data Disk

Issue 03 (2018-09-26) Copyright © Huawei Technologies Co., Ltd. 21

Page 25: Getting Started - Huawei · Elastic Volume Service Getting Started Issue 03 Date 2018-09-26 HUAWEI TECHNOLOGIES CO., LTD

● Initializing a Linux Data Disk (fdisk)● Initializing a Linux Data Disk (parted)

For a disk larger than 2 TB, see the following topics:● Initializing a Windows Data Disk Larger Than 2 TB (Windows Server

2008)● Initializing a Windows Data Disk Larger Than 2 TB (Windows Server

2012)● Initializing a Linux Data Disk Larger Than 2 TB (parted)

5.2 Initializing a Windows Data Disk (Windows Server2008)

ScenariosThis topic uses Windows Server 2008 R2 Enterprise 64bit to describe how toinitialize a data disk attached to a server running Windows.

The maximum disk capacity supported by MBR is 2 TB, and that supported by GPTis 18 EB. Therefore, use the GPT partition style if your disk capacity is larger than 2TB. For details, see Initializing a Windows Data Disk Larger Than 2 TB(Windows Server 2008). For details about disk partition styles, see Introductionto Data Disk Initialization Scenarios and Partition Styles.

The method for initializing a disk varies depending on the OS running on theserver. This document is used for reference only. For the detailed operations anddifferences, see the product documents of the corresponding OS.

NO TICE

When using a disk for the first time, if you have not initialized it, includingcreating partitions and file systems, the additional space added to this disk in anexpansion later may not be normally used.

Prerequisites● A data disk has been attached to a server and has not been initialized.● You have logged in to the server.

– For how to log in to an ECS, see Logging In to an ECS.– For how to log in to a BMS, see Logging In to a BMS.

Procedure

Step 1 On the desktop of the server, right-click Computer and choose Manage from theshortcut menu.

The Server Manager window is displayed.

Step 2 In the navigation tree, choose Storage > Disk Management.

Elastic Volume ServiceGetting Started 5 Step 4: Initialize an EVS Data Disk

Issue 03 (2018-09-26) Copyright © Huawei Technologies Co., Ltd. 22

Page 26: Getting Started - Huawei · Elastic Volume Service Getting Started Issue 03 Date 2018-09-26 HUAWEI TECHNOLOGIES CO., LTD

The Disk Management window is displayed.● If Figure 5-1 is displayed, the new disk is offline. Go to Step 3.● If Figure 5-4 is displayed, the Initialize Disk window is prompted. Go to Step

5.

Figure 5-1 Disk Management

Step 3 Disks are displayed in the right pane. In the Disk 1 area, right-click Offline andchoose Online from the shortcut menu to online the disk.

Figure 5-2 Online the disk

Elastic Volume ServiceGetting Started 5 Step 4: Initialize an EVS Data Disk

Issue 03 (2018-09-26) Copyright © Huawei Technologies Co., Ltd. 23

Page 27: Getting Started - Huawei · Elastic Volume Service Getting Started Issue 03 Date 2018-09-26 HUAWEI TECHNOLOGIES CO., LTD

NO TE

If the disk is offline, you need to online the disk before initializing it.

Step 4 After making the disk online, the disk status changes from Offline to NotInitialized. Right-click the disk status and choose Initialize Disk from the shortcutmenu, as shown in Figure 5-3.

Figure 5-3 Initialize Disk

Step 5 In the Initialize Disk dialog box, select the target disk, click MBR (Master BootRecord) or GPT (GUID Partition Table), and click OK, as shown in Figure 5-4.

Elastic Volume ServiceGetting Started 5 Step 4: Initialize an EVS Data Disk

Issue 03 (2018-09-26) Copyright © Huawei Technologies Co., Ltd. 24

Page 28: Getting Started - Huawei · Elastic Volume Service Getting Started Issue 03 Date 2018-09-26 HUAWEI TECHNOLOGIES CO., LTD

Figure 5-4 Unallocated space

NO TICE

The maximum disk capacity supported by MBR is 2 TB, and that supported by GPTis 18 EB. Because a data disk currently supports up to 32 TB, use the GPT partitionstyle if your disk capacity is larger than 2 TB.If you change the disk partition style after the disk has been used, the data on thedisk will be cleared. Therefore, select a proper disk partition style when initializingthe disk.

Step 6 Right-click at the unallocated space and choose New Simple Volume from theshortcut menu, as shown in Figure 5-5.

Elastic Volume ServiceGetting Started 5 Step 4: Initialize an EVS Data Disk

Issue 03 (2018-09-26) Copyright © Huawei Technologies Co., Ltd. 25

Page 29: Getting Started - Huawei · Elastic Volume Service Getting Started Issue 03 Date 2018-09-26 HUAWEI TECHNOLOGIES CO., LTD

Figure 5-5 New Simple Volume

Step 7 On the displayed New Simple Volume Wizard window, click Next.

Figure 5-6 New Simple Volume Wizard

Step 8 Specify the volume size and click Next. The default value is the maximum size.

Elastic Volume ServiceGetting Started 5 Step 4: Initialize an EVS Data Disk

Issue 03 (2018-09-26) Copyright © Huawei Technologies Co., Ltd. 26

Page 30: Getting Started - Huawei · Elastic Volume Service Getting Started Issue 03 Date 2018-09-26 HUAWEI TECHNOLOGIES CO., LTD

Figure 5-7 Specify Volume Size

Step 9 Assign the driver letter and click Next.

Figure 5-8 Assign Driver Letter or Path

Step 10 Select Format this volume with the following settings, set parameters based onthe actual requirements, and select Perform a quick format. Then, click Next.

Elastic Volume ServiceGetting Started 5 Step 4: Initialize an EVS Data Disk

Issue 03 (2018-09-26) Copyright © Huawei Technologies Co., Ltd. 27

Page 31: Getting Started - Huawei · Elastic Volume Service Getting Started Issue 03 Date 2018-09-26 HUAWEI TECHNOLOGIES CO., LTD

Figure 5-9 Format Partition

Figure 5-10 Completing the partition creation

NO TICE

The partition sizes supported by file systems vary. Therefore, you are advised tochoose an appropriate file system based on your service requirements.

Elastic Volume ServiceGetting Started 5 Step 4: Initialize an EVS Data Disk

Issue 03 (2018-09-26) Copyright © Huawei Technologies Co., Ltd. 28

Page 32: Getting Started - Huawei · Elastic Volume Service Getting Started Issue 03 Date 2018-09-26 HUAWEI TECHNOLOGIES CO., LTD

Step 11 Click Finish. Wait for the initialization to complete. When the volume statuschanges to Healthy, the initialization has finished successfully, as shown in Figure5-11.

Figure 5-11 Disk initialization succeeded

----End

5.3 Initializing a Windows Data Disk (Windows Server2016)

ScenariosThis topic uses Windows Server 2016 Standard 64bit to describe how to initialize adata disk attached to a server running Windows.

The maximum disk capacity supported by MBR is 2 TB, and that supported by GPTis 18 EB. Therefore, use the GPT partition style if your disk capacity is larger than 2TB. For details, see Initializing a Windows Data Disk Larger Than 2 TB(Windows Server 2008). For details about disk partition styles, see Introductionto Data Disk Initialization Scenarios and Partition Styles.

The method for initializing a disk varies depending on the OS running on theserver. This document is used for reference only. For the detailed operations anddifferences, see the product documents of the corresponding OS.

Elastic Volume ServiceGetting Started 5 Step 4: Initialize an EVS Data Disk

Issue 03 (2018-09-26) Copyright © Huawei Technologies Co., Ltd. 29

Page 33: Getting Started - Huawei · Elastic Volume Service Getting Started Issue 03 Date 2018-09-26 HUAWEI TECHNOLOGIES CO., LTD

NO TICE

When using a disk for the first time, if you have not initialized it, includingcreating partitions and file systems, the additional space added to this disk in anexpansion later may not be normally used.

Prerequisites● A data disk has been attached to a server and has not been initialized.

● You have logged in to the server.

– For how to log in to an ECS, see Logging In to an ECS.

– For how to log in to a BMS, see Logging In to a BMS.

Procedure

Step 1 On the desktop of the server, click the start icon in the lower left corner.

The Windows Server window is displayed.

Step 2 Click Server Manager.

The Server Manager window is displayed.

Figure 5-12 Server Manager

Step 3 In the upper right corner, choose Tools > Computer Management.

The Computer Management window is displayed.

Elastic Volume ServiceGetting Started 5 Step 4: Initialize an EVS Data Disk

Issue 03 (2018-09-26) Copyright © Huawei Technologies Co., Ltd. 30

Page 34: Getting Started - Huawei · Elastic Volume Service Getting Started Issue 03 Date 2018-09-26 HUAWEI TECHNOLOGIES CO., LTD

Figure 5-13 Computer Management

Step 4 Choose Storage > Disk Management.

Disks are displayed in the right pane. If there is a disk that is not initialized, thesystem will prompt you with the Initialize Disk dialog box.

Figure 5-14 Disk list

Elastic Volume ServiceGetting Started 5 Step 4: Initialize an EVS Data Disk

Issue 03 (2018-09-26) Copyright © Huawei Technologies Co., Ltd. 31

Page 35: Getting Started - Huawei · Elastic Volume Service Getting Started Issue 03 Date 2018-09-26 HUAWEI TECHNOLOGIES CO., LTD

Step 5 In the Initialize Disk dialog box, the to-be-initialized disk is selected. Select a diskpartition style and click OK. In this example, GPT (GUID Partition Table) isselected.

The Computer Management window is displayed.

Figure 5-15 Computer Management (Windows Server 2016)

NO TICE

The maximum disk capacity supported by MBR is 2 TB, and that supported by GPTis 18 EB. Because a data disk currently supports up to 32 TB, use the GPT partitionstyle if your disk capacity is larger than 2 TB.If you change the disk partition style after the disk has been used, the data on thedisk will be cleared. Therefore, select a proper disk partition style when initializingthe disk.

Step 6 Right-click at the unallocated disk space and choose New Simple Volume fromthe shortcut menu.

The New Simple Volume Wizard window is displayed.

Elastic Volume ServiceGetting Started 5 Step 4: Initialize an EVS Data Disk

Issue 03 (2018-09-26) Copyright © Huawei Technologies Co., Ltd. 32

Page 36: Getting Started - Huawei · Elastic Volume Service Getting Started Issue 03 Date 2018-09-26 HUAWEI TECHNOLOGIES CO., LTD

Figure 5-16 New Simple Volume Wizard (Windows Server 2016)

Step 7 Follow the prompts and click Next.

The Specify Volume Size page is displayed.

Figure 5-17 Specify Volume Size (Windows Server 2016)

Step 8 Specify the volume size and click Next. The system selects the maximum volumesize by default. You can specify the volume size as required. In this example, thedefault setting is used.

Elastic Volume ServiceGetting Started 5 Step 4: Initialize an EVS Data Disk

Issue 03 (2018-09-26) Copyright © Huawei Technologies Co., Ltd. 33

Page 37: Getting Started - Huawei · Elastic Volume Service Getting Started Issue 03 Date 2018-09-26 HUAWEI TECHNOLOGIES CO., LTD

The Assign Drive Letter or Path page is displayed.

Figure 5-18 Assign Driver Letter or Path (Windows Server 2016)

Step 9 Assign a drive letter or path to your partition and click Next. The system assignsdrive letter D by default. In this example, the default setting is used.

The Format Partition page is displayed.

Figure 5-19 Format Partition (Windows Server 2016)

Elastic Volume ServiceGetting Started 5 Step 4: Initialize an EVS Data Disk

Issue 03 (2018-09-26) Copyright © Huawei Technologies Co., Ltd. 34

Page 38: Getting Started - Huawei · Elastic Volume Service Getting Started Issue 03 Date 2018-09-26 HUAWEI TECHNOLOGIES CO., LTD

Step 10 Specify format settings and click Next. The system selects the NTFS file system bydefault. You can specify the file system type as required. In this example, thedefault setting is used.

The Completing the New Simple Volume Wizard page is displayed.

Figure 5-20 Completing the New Simple Volume Wizard (Windows Server 2016)

NO TICE

The partition sizes supported by file systems vary. Therefore, you are advised tochoose an appropriate file system based on your service requirements.

Step 11 Click Finish.

Wait for the initialization to complete. When the volume status changes toHealthy, the initialization has finished successfully, as shown in Figure 5-21.

Elastic Volume ServiceGetting Started 5 Step 4: Initialize an EVS Data Disk

Issue 03 (2018-09-26) Copyright © Huawei Technologies Co., Ltd. 35

Page 39: Getting Started - Huawei · Elastic Volume Service Getting Started Issue 03 Date 2018-09-26 HUAWEI TECHNOLOGIES CO., LTD

Figure 5-21 Disk initialization succeeded (Windows Server 2016)

Step 12 After the volume is created, click on the task bar and check whether a newvolume appears in This PC. In this example, New Volume (D:) is the new volume.

If New Volume (D:) appears, the disk is successfully initialized and no furtheraction is required.

Elastic Volume ServiceGetting Started 5 Step 4: Initialize an EVS Data Disk

Issue 03 (2018-09-26) Copyright © Huawei Technologies Co., Ltd. 36

Page 40: Getting Started - Huawei · Elastic Volume Service Getting Started Issue 03 Date 2018-09-26 HUAWEI TECHNOLOGIES CO., LTD

Figure 5-22 This PC (Windows Server 2016)

----End

5.4 Initializing a Linux Data Disk (fdisk)

ScenariosThis topic uses CentOS 7.4 64bit to describe how to initialize a data disk attachedto a server running Linux and use fdisk to partition the data disk.

The maximum disk capacity supported by MBR is 2 TB, and that supported by GPTis 18 EB. Therefore, use the GPT partition style if your disk capacity is larger than 2TB. In Linux, if you choose to use the GPT partition style, the fdisk partitioning toolcannot be used. Use the parted partitioning tool instead. For details about diskpartition styles, see Introduction to Data Disk Initialization Scenarios andPartition Styles.

The method for initializing a disk varies depending on the OS running on theserver. This document is used for reference only. For the detailed operations anddifferences, see the product documents of the corresponding OS.

NO TICE

When using a disk for the first time, if you have not initialized it, includingcreating partitions and file systems, the additional space added to this disk in anexpansion later may not be normally used.

Elastic Volume ServiceGetting Started 5 Step 4: Initialize an EVS Data Disk

Issue 03 (2018-09-26) Copyright © Huawei Technologies Co., Ltd. 37

Page 41: Getting Started - Huawei · Elastic Volume Service Getting Started Issue 03 Date 2018-09-26 HUAWEI TECHNOLOGIES CO., LTD

Prerequisites● A data disk has been attached to a server and has not been initialized.● You have logged in to the server.

– For how to log in to an ECS, see Logging In to an ECS.– For how to log in to a BMS, see Logging In to a BMS.

Creating and Mounting a PartitionThe following example shows you how a new primary partition can be created ona new data disk that has been attached to a server. The primary partition will becreated using fdisk, and MBR is the default partition style. Furthermore, thepartition will be formatted using the ext4 file system, mounted on /mnt/sdc, andconfigured automatic mounting at system start.

Step 1 Run the following command to query information about the new data disk:

fdisk -l

Information similar to the following is displayed:[root@ecs-test-0001 ~]# fdisk -l

Disk /dev/vda: 42.9 GB, 42949672960 bytes, 83886080 sectorsUnits = sectors of 1 * 512 = 512 bytesSector size (logical/physical): 512 bytes / 512 bytesI/O size (minimum/optimal): 512 bytes / 512 bytesDisk label type: dosDisk identifier: 0x000bcb4e

Device Boot Start End Blocks Id System/dev/vda1 * 2048 83886079 41942016 83 Linux

Disk /dev/vdb: 107.4 GB, 107374182400 bytes, 209715200 sectorsUnits = sectors of 1 * 512 = 512 bytesSector size (logical/physical): 512 bytes / 512 bytesI/O size (minimum/optimal): 512 bytes / 512 bytes

In the command output, the server contains two disks. /dev/vda is the systemdisk, and /dev/vdb is the new data disk.

Step 2 Run the following command to enter fdisk to partition the new data disk:

fdisk New data disk

In this example, run the following command:

fdisk /dev/vdb

Information similar to the following is displayed:[root@ecs-test-0001 ~]# fdisk /dev/vdbWelcome to fdisk (util-linux 2.23.2).

Changes will remain in memory only, until you decide to write them.Be careful before using the write command.

Device does not contain a recognized partition tableBuilding a new DOS disklabel with disk identifier 0x38717fc1.

Command (m for help):

Step 3 Enter n and press Enter to create a new partition.

Information similar to the following is displayed:

Elastic Volume ServiceGetting Started 5 Step 4: Initialize an EVS Data Disk

Issue 03 (2018-09-26) Copyright © Huawei Technologies Co., Ltd. 38

Page 42: Getting Started - Huawei · Elastic Volume Service Getting Started Issue 03 Date 2018-09-26 HUAWEI TECHNOLOGIES CO., LTD

Command (m for help): nPartition type: p primary (0 primary, 0 extended, 4 free) e extended

There are two types of disk partitions:● Choosing p creates a primary partition.● Choosing e creates an extended partition.

NO TE

If the MBR partition style is used, a maximum of 4 primary partitions, or 3 primarypartitions and 1 extended partition can be created. The extended partition cannot be useddirectly and must be divided into logical partitions before use.

Disk partitions created using GPT are not categorized.

Step 4 In this example, a primary partition is created. Therefore, enter p and press Enterto create a primary partition.

Information similar to the following is displayed:Select (default p): pPartition number (1-4, default 1):

Partition number indicates the serial number of the primary partition. The valueranges from 1 to 4.

Step 5 Enter the serial number of the primary partition and press Enter. Primary partitionnumber 1 is used in this example. One usually starts with partition number 1when partitioning an empty disk.

Information similar to the following is displayed:Partition number (1-4, default 1): 1First sector (2048-209715199, default 2048):

First sector indicates the start sector. The value ranges from 2048 to 209715199,and the default value is 2048.

Step 6 Select the default start sector 2048 and press Enter.

The system displays the start and end sectors of the partition's available space.You can customize the value within this range or use the default value. The startsector must be smaller than the partition's end sector.

Information similar to the following is displayed:First sector (2048-209715199, default 2048):Using default value 2048Last sector, +sectors or +size{K,M,G} (2048-209715199, default 209715199):

Last sector indicates the end sector. The value ranges from 2048 to 209715199,and the default value is 209715199.

Step 7 Select the default end sector 209715199 and press Enter.

The system displays the start and end sectors of the partition's available space.You can customize the value within this range or use the default value. The startsector must be smaller than the partition's end sector.

Information similar to the following is displayed:

Last sector, +sectors or +size{K,M,G} (2048-209715199, default 209715199):Using default value 209715199Partition 1 of type Linux and of size 100 GiB is set

Elastic Volume ServiceGetting Started 5 Step 4: Initialize an EVS Data Disk

Issue 03 (2018-09-26) Copyright © Huawei Technologies Co., Ltd. 39

Page 43: Getting Started - Huawei · Elastic Volume Service Getting Started Issue 03 Date 2018-09-26 HUAWEI TECHNOLOGIES CO., LTD

Command (m for help):

A primary partition has been created for the new data disk.

Step 8 Enter p and press Enter to view details about the new partition.

Information similar to the following is displayed:Command (m for help): p

Disk /dev/vdb: 107.4 GB, 107374182400 bytes, 209715200 sectorsUnits = sectors of 1 * 512 = 512 bytesSector size (logical/physical): 512 bytes / 512 bytesI/O size (minimum/optimal): 512 bytes / 512 bytesDisk label type: dosDisk identifier: 0x38717fc1

Device Boot Start End Blocks Id System/dev/vdb1 2048 209715199 104856576 83 Linux

Command (m for help):

Details about the /dev/vdb1 partition are displayed.

Step 9 Enter w and press Enter to write the changes to the partition table.

Information similar to the following is displayed:Command (m for help): wThe partition table has been altered!

Calling ioctl() to re-read partition table.Syncing disks.

The partition is created.

NO TE

In case that you want to discard the changes made before, you can exit fdisk by entering q.

Step 10 Run the following command to synchronize the new partition table to the OS:

partprobe

Step 11 Run the following command to set the file system format for the new partition:

mkfs -t File system format /dev/vdb1

In this example, run the following command to set the ext4 file system for thenew partition:

mkfs -t ext4 /dev/vdb1

Information similar to the following is displayed:[root@ecs-test-0001 ~]# mkfs -t ext4 /dev/vdb1mke2fs 1.42.9 (28-Dec-2013)Filesystem label=OS type: LinuxBlock size=4096 (log=2)Fragment size=4096 (log=2)Stride=0 blocks, Stripe width=0 blocks6553600 inodes, 26214144 blocks1310707 blocks (5.00%) reserved for the super userFirst data block=0Maximum filesystem blocks=2174746624800 block groups32768 blocks per group, 32768 fragments per group8192 inodes per group

Elastic Volume ServiceGetting Started 5 Step 4: Initialize an EVS Data Disk

Issue 03 (2018-09-26) Copyright © Huawei Technologies Co., Ltd. 40

Page 44: Getting Started - Huawei · Elastic Volume Service Getting Started Issue 03 Date 2018-09-26 HUAWEI TECHNOLOGIES CO., LTD

Superblock backups stored on blocks: 32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632, 2654208, 4096000, 7962624, 11239424, 20480000, 23887872

Allocating group tables: doneWriting inode tables: doneCreating journal (32768 blocks): doneWriting superblocks and filesystem accounting information: done

The formatting takes a period of time. Observe the system running status and donot exit.

NO TICE

The partition sizes supported by file systems vary. Therefore, you are advised tochoose an appropriate file system based on your service requirements.

Step 12 Run the following command to create a mount point:

mkdir Mount point

In this example, run the following command to create the /mnt/sdc mount point:

mkdir /mnt/sdc

Step 13 Run the following command to mount the new partition on the created mountpoint:

mount Disk partition Mount point

In this example, run the following command to mount the new partition /dev/vdb1 on /mnt/sdc:

mount /dev/vdb1 /mnt/sdc

Step 14 Run the following command to view the mount result:

df -TH

Information similar to the following is displayed:

[root@ecs-test-0001 ~]# df -THFilesystem Type Size Used Avail Use% Mounted on/dev/vda1 ext4 43G 1.9G 39G 5% /devtmpfs devtmpfs 2.0G 0 2.0G 0% /devtmpfs tmpfs 2.0G 0 2.0G 0% /dev/shmtmpfs tmpfs 2.0G 9.1M 2.0G 1% /runtmpfs tmpfs 2.0G 0 2.0G 0% /sys/fs/cgrouptmpfs tmpfs 398M 0 398M 0% /run/user/0/dev/vdb1 ext4 106G 63M 101G 1% /mnt/sdc

New partition /dev/vdb1 is mounted on /mnt/sdc.

NO TE

If the server is restarted, the mounting will become invalid. You can set automaticmounting for partitions at system start by modifying the /etc/fstab file. For details, seeSetting Automatic Mounting at System Start.

----End

Elastic Volume ServiceGetting Started 5 Step 4: Initialize an EVS Data Disk

Issue 03 (2018-09-26) Copyright © Huawei Technologies Co., Ltd. 41

Page 45: Getting Started - Huawei · Elastic Volume Service Getting Started Issue 03 Date 2018-09-26 HUAWEI TECHNOLOGIES CO., LTD

Setting Automatic Mounting at System StartTo automatically mount disk partitions at system start, do not specify partitions,for example /dev/vdb1, in /etc/fstab because the sequence of cloud devices, andtherefore their names may change during the server stop and start. You areadvised to use the universally unique identifier (UUID) in /etc/fstab to setautomatic mounting at system start.

NO TE

UUID is the unique character string for disk partitions in a Linux system.

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

blkid Disk partition

In this example, run the following command to query the UUID of the /dev/vdb1partition:

blkid /dev/vdb1

Information similar to the following is displayed:

[root@ecs-test-0001 ~]# blkid /dev/vdb1/dev/vdb1: UUID="0b3040e2-1367-4abb-841d-ddb0b92693df" TYPE="ext4"

The UUID of the /dev/vdb1 partition is displayed.

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

vi /etc/fstab

Step 3 Press i to enter the editing mode.

Step 4 Move the cursor to the end of the file and press Enter. Then, add the followinginformation:UUID=0b3040e2-1367-4abb-841d-ddb0b92693df /mnt/sdc ext4 defaults 0 2

The preceding content is used for reference only. Add the information that is usedin the environment. The parameters are described as follows:● The first column indicates the partition UUID obtained in Step 1.● The second column indicates the directory on which the partition is mounted.

You can query the mount point using the df -TH command.● The third column indicates the file system format of the partition. You can

query the file system format using the df -TH command.● The fourth column indicates the partition mount option. Normally, this

parameter is set to defaults.● The fifth column indicates the Linux dump backup option.

– 0: not use Linux dump backup. Normally, dump backup is not used, andyou can set this parameter to 0.

– 1: use Linux dump backup.● The sixth column indicates the fsck option, that is, whether to use fsck to

check the attached disk during startup.– 0: not use fsck.– If the mount point is the root partition (/), this parameter must be set to

1.

Elastic Volume ServiceGetting Started 5 Step 4: Initialize an EVS Data Disk

Issue 03 (2018-09-26) Copyright © Huawei Technologies Co., Ltd. 42

Page 46: Getting Started - Huawei · Elastic Volume Service Getting Started Issue 03 Date 2018-09-26 HUAWEI TECHNOLOGIES CO., LTD

When this parameter is set to 1 for the root partition, this parameter forother partitions must start with 2 so that the system checks the partitionsin the ascending order of the values.

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

The system saves the configurations and exits the vi editor.

Step 6 Perform the following operations to verify the automatic mounting function:

1. Run the following command to unmount the partition:umount Disk partitionIn this example, run the following command:umount /dev/vdb1

2. Run the following command to reload all the content in the /etc/fstab file:mount -a

3. Run the following command to query the file system mounting information:mount | grep Mount pointIn this example, run the following command:mount | grep /mnt/sdcIf information similar to the following is displayed, the automatic mountingfunction takes effect:root@ecs-test-0001 ~]# mount | grep /mnt/sdc/dev/vdb1 on /mnt/sdc type ext4 (rw,relatime,data=ordered)

----End

5.5 Initializing a Linux Data Disk (parted)

ScenariosThis topic uses CentOS 7.4 64bit to describe how to initialize a data disk attachedto a server running Linux and use parted to partition the data disk.

The maximum disk capacity supported by MBR is 2 TB, and that supported by GPTis 18 EB. Therefore, use the GPT partition style if your disk capacity is larger than 2TB. In Linux, if you choose to use the GPT partition style, the fdisk partitioning toolcannot be used. Use the parted partitioning tool instead. For details about diskpartition styles, see Introduction to Data Disk Initialization Scenarios andPartition Styles.

The method for initializing a disk varies depending on the OS running on theserver. This document is used for reference only. For the detailed operations anddifferences, see the product documents of the corresponding OS.

NO TICE

When using a disk for the first time, if you have not initialized it, includingcreating partitions and file systems, the additional space added to this disk in anexpansion later may not be normally used.

Elastic Volume ServiceGetting Started 5 Step 4: Initialize an EVS Data Disk

Issue 03 (2018-09-26) Copyright © Huawei Technologies Co., Ltd. 43

Page 47: Getting Started - Huawei · Elastic Volume Service Getting Started Issue 03 Date 2018-09-26 HUAWEI TECHNOLOGIES CO., LTD

Prerequisites● A data disk has been attached to a server and has not been initialized.● You have logged in to the server.

– For how to log in to an ECS, see Logging In to an ECS.– For how to log in to a BMS, see Logging In to a BMS.

Creating and Mounting a PartitionThe following example shows you how a new partition can be created on a newdata disk that has been attached to a server. The partition will be created usingparted, and GPT is used as the partition style. Furthermore, the partition will beformatted using the ext4 file system, mounted on /mnt/sdc, and configuredautomatic mounting at system start.

Step 1 Run the following command to query information about the new data disk:

lsblk

Information similar to the following is displayed:root@ecs-test-0001 ~]# lsblkNAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINTvda 253:0 0 40G 0 disk└─vda1 253:1 0 40G 0 part /vdb 253:16 0 100G 0 disk

In the command output, the server contains two disks. /dev/vda is the systemdisk, and /dev/vdb is the new data disk.

Step 2 Run the following command to enter parted to partition the new data disk:

parted New data disk

In this example, run the following command:

parted /dev/vdb

Information similar to the following is displayed:[root@ecs-test-0001 ~]# parted /dev/vdbGNU Parted 3.1Using /dev/vdbWelcome to GNU Parted! Type 'help' to view a list of commands.(parted)

Step 3 Enter p and press Enter to view the current disk partition style.

Information similar to the following is displayed:(parted) pError: /dev/vdb: unrecognised disk labelModel: Virtio Block Device (virtblk)Disk /dev/vdb: 107GBSector size (logical/physical): 512B/512BPartition Table: unknownDisk Flags:(parted)

In the command output, the Partition Table value is unknown, indicating that nopartition style is set for the new disk.

Step 4 Run the following command to set the disk partition style:

mklabel Disk partition style

Elastic Volume ServiceGetting Started 5 Step 4: Initialize an EVS Data Disk

Issue 03 (2018-09-26) Copyright © Huawei Technologies Co., Ltd. 44

Page 48: Getting Started - Huawei · Elastic Volume Service Getting Started Issue 03 Date 2018-09-26 HUAWEI TECHNOLOGIES CO., LTD

In this example, run the following command to set the partition style to GPT:(Disk partition styles can be MBR or GPT.)

mklabel gpt

NO TICE

The maximum disk capacity supported by MBR is 2 TB, and that supported by GPTis 18 EB. Because a data disk currently supports up to 32 TB, use the GPT partitionstyle if your disk capacity is larger than 2 TB.If you change the disk partition style after the disk has been used, the data on thedisk will be cleared. Therefore, select a proper disk partition style when initializingthe disk.

Step 5 Enter p and press Enter to view the disk partition style.

Information similar to the following is displayed:(parted) mklabel gpt(parted) pModel: Virtio Block Device (virtblk)Disk /dev/vdb: 107GBSector size (logical/physical): 512B/512BPartition Table: gptDisk Flags:

Number Start End Size File system Name Flags

(parted)

In the command output, the Partition Table value is gpt, indicating that the diskpartition style is GPT.

Step 6 Enter unit s and press Enter to set the measurement unit of the disk to sector.

Step 7 Run the following command and press Enter:

mkpart Partition name Start sector End sector

In this example, run the following command:

mkpart test 2048s 100%

In this example, one partition is created for the new data disk. Variable 2048sindicates the disk start sector, and variable 100% indicates the disk end sector. Thetwo values are used for reference only. You can determine the number ofpartitions and the partition size based on your service requirements.

Information similar to the following is displayed:(parted) mkpart opt 2048s 100%(parted)

Step 8 Enter p and press Enter to view details about the new partition.

Information similar to the following is displayed:(parted) pModel: Virtio Block Device (virtblk)Disk /dev/vdb: 209715200sSector size (logical/physical): 512B/512BPartition Table: gptDisk Flags:

Elastic Volume ServiceGetting Started 5 Step 4: Initialize an EVS Data Disk

Issue 03 (2018-09-26) Copyright © Huawei Technologies Co., Ltd. 45

Page 49: Getting Started - Huawei · Elastic Volume Service Getting Started Issue 03 Date 2018-09-26 HUAWEI TECHNOLOGIES CO., LTD

Number Start End Size File system Name Flags 1 2048s 209713151s 209711104s test

(parted)

Step 9 Enter q and press Enter to exit parted.

Information similar to the following is displayed:(parted) qInformation: You may need to update /etc/fstab.

You can set automatic disk mounting by updating the /etc/fstab file. Beforeupdating the file, set the file system format for the partition and mount thepartition on the mount point.

Step 10 Run the following command to view the disk partition information:

lsblk

Information similar to the following is displayed:[root@ecs-test-0001 ~]# lsblkNAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINTvda 253:0 0 40G 0 disk└─vda1 253:1 0 40G 0 part /vdb 253:16 0 100G 0 disk└─vdb1 253:17 0 100G 0 part

In the command output, /dev/vdb1 is the partition you created.

Step 11 Run the following command to set the file system format for the new partition:

mkfs -t File system format /dev/vdb1

In this example, run the following command to set the ext4 file system for thenew partition:

mkfs -t ext4 /dev/vdb1

Information similar to the following is displayed:[root@ecs-test-0001 ~]# mkfs -t ext4 /dev/vdb1mke2fs 1.42.9 (28-Dec-2013)Filesystem label=OS type: LinuxBlock size=4096 (log=2)Fragment size=4096 (log=2)Stride=0 blocks, Stripe width=0 blocks6553600 inodes, 26213888 blocks1310694 blocks (5.00%) reserved for the super userFirst data block=0Maximum filesystem blocks=2174746624800 block groups32768 blocks per group, 32768 fragments per group8192 inodes per groupSuperblock backups stored on blocks: 32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632, 2654208, 4096000, 7962624, 11239424, 20480000, 23887872

Allocating group tables: doneWriting inode tables: doneCreating journal (32768 blocks): doneWriting superblocks and filesystem accounting information: done

The formatting takes a period of time. Observe the system running status and donot exit.

Elastic Volume ServiceGetting Started 5 Step 4: Initialize an EVS Data Disk

Issue 03 (2018-09-26) Copyright © Huawei Technologies Co., Ltd. 46

Page 50: Getting Started - Huawei · Elastic Volume Service Getting Started Issue 03 Date 2018-09-26 HUAWEI TECHNOLOGIES CO., LTD

NO TICE

The partition sizes supported by file systems vary. Therefore, you are advised tochoose an appropriate file system based on your service requirements.

Step 12 Run the following command to create a mount point:

mkdir Mount point

In this example, run the following command to create the /mnt/sdc mount point:

mkdir /mnt/sdc

Step 13 Run the following command to mount the new partition on the created mountpoint:

mount Disk partition Mount point

In this example, run the following command to mount the new partition /dev/vdb1 on /mnt/sdc:

mount /dev/vdb1 /mnt/sdc

Step 14 Run the following command to view the mount result:

df -TH

Information similar to the following is displayed:

[root@ecs-test-0001 ~]# df -THFilesystem Type Size Used Avail Use% Mounted on/dev/vda1 ext4 43G 1.9G 39G 5% /devtmpfs devtmpfs 2.0G 0 2.0G 0% /devtmpfs tmpfs 2.0G 0 2.0G 0% /dev/shmtmpfs tmpfs 2.0G 9.0M 2.0G 1% /runtmpfs tmpfs 2.0G 0 2.0G 0% /sys/fs/cgrouptmpfs tmpfs 398M 0 398M 0% /run/user/0/dev/vdb1 ext4 106G 63M 101G 1% /mnt/sdc

New partition /dev/vdb1 is mounted on /mnt/sdc.

NO TE

If the server is restarted, the mounting will become invalid. You can set automaticmounting for partitions at system start by modifying the /etc/fstab file. For details, seeSetting Automatic Mounting at System Start.

----End

Setting Automatic Mounting at System StartTo automatically mount disk partitions at system start, do not specify partitions,for example /dev/vdb1, in /etc/fstab because the sequence of cloud devices, andtherefore their names may change during the server stop and start. You areadvised to use the universally unique identifier (UUID) in /etc/fstab to setautomatic mounting at system start.

NO TE

UUID is the unique character string for disk partitions in a Linux system.

Elastic Volume ServiceGetting Started 5 Step 4: Initialize an EVS Data Disk

Issue 03 (2018-09-26) Copyright © Huawei Technologies Co., Ltd. 47

Page 51: Getting Started - Huawei · Elastic Volume Service Getting Started Issue 03 Date 2018-09-26 HUAWEI TECHNOLOGIES CO., LTD

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

blkid Disk partition

In this example, run the following command to query the UUID of the /dev/vdb1partition:

blkid /dev/vdb1

Information similar to the following is displayed:

[root@ecs-test-0001 ~]# blkid /dev/vdb1/dev/vdb1: UUID="0b3040e2-1367-4abb-841d-ddb0b92693df" TYPE="ext4"

The UUID of the /dev/vdb1 partition is displayed.

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

vi /etc/fstab

Step 3 Press i to enter the editing mode.

Step 4 Move the cursor to the end of the file and press Enter. Then, add the followinginformation:UUID=0b3040e2-1367-4abb-841d-ddb0b92693df /mnt/sdc ext4 defaults 0 2

The preceding content is used for reference only. Add the information that is usedin the environment. The parameters are described as follows:● The first column indicates the partition UUID obtained in Step 1.● The second column indicates the directory on which the partition is mounted.

You can query the mount point using the df -TH command.● The third column indicates the file system format of the partition. You can

query the file system format using the df -TH command.● The fourth column indicates the partition mount option. Normally, this

parameter is set to defaults.● The fifth column indicates the Linux dump backup option.

– 0: not use Linux dump backup. Normally, dump backup is not used, andyou can set this parameter to 0.

– 1: use Linux dump backup.● The sixth column indicates the fsck option, that is, whether to use fsck to

check the attached disk during startup.– 0: not use fsck.– If the mount point is the root partition (/), this parameter must be set to

1.When this parameter is set to 1 for the root partition, this parameter forother partitions must start with 2 so that the system checks the partitionsin the ascending order of the values.

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

The system saves the configurations and exits the vi editor.

Step 6 Perform the following operations to verify the automatic mounting function:

1. Run the following command to unmount the partition:umount Disk partition

Elastic Volume ServiceGetting Started 5 Step 4: Initialize an EVS Data Disk

Issue 03 (2018-09-26) Copyright © Huawei Technologies Co., Ltd. 48

Page 52: Getting Started - Huawei · Elastic Volume Service Getting Started Issue 03 Date 2018-09-26 HUAWEI TECHNOLOGIES CO., LTD

In this example, run the following command:umount /dev/vdb1

2. Run the following command to reload all the content in the /etc/fstab file:mount -a

3. Run the following command to query the file system mounting information:mount | grep Mount pointIn this example, run the following command:mount | grep /mnt/sdcIf information similar to the following is displayed, the automatic mountingfunction takes effect:root@ecs-test-0001 ~]# mount | grep /mnt/sdc/dev/vdb1 on /mnt/sdc type ext4 (rw,relatime,data=ordered)

----End

5.6 Initializing a Windows Data Disk Larger Than 2 TB(Windows Server 2008)

Scenarios

This topic uses Windows Server 2008 R2 Standard 64bit to describe how toinitialize a data disk whose capacity is larger than 2 TB. In the followingoperations, the capacity of the example disk is 3 TB.

The maximum disk capacity supported by MBR is 2 TB, and that supported by GPTis 18 EB. Therefore, use the GPT partition style if your disk capacity is larger than 2TB. For details, see Initializing a Windows Data Disk Larger Than 2 TB(Windows Server 2008). For details about disk partition styles, see Introductionto Data Disk Initialization Scenarios and Partition Styles.

The method for initializing a disk varies depending on the OS running on theserver. This document is used for reference only. For the detailed operations anddifferences, see the product documents of the corresponding OS.

NO TICE

When using a disk for the first time, if you have not initialized it, includingcreating partitions and file systems, the additional space added to this disk in anexpansion later may not be normally used.

Prerequisites● A data disk has been attached to a server and has not been initialized.● You have logged in to the server.

– For how to log in to an ECS, see Logging In to an ECS.– For how to log in to a BMS, see Logging In to a BMS.

Elastic Volume ServiceGetting Started 5 Step 4: Initialize an EVS Data Disk

Issue 03 (2018-09-26) Copyright © Huawei Technologies Co., Ltd. 49

Page 53: Getting Started - Huawei · Elastic Volume Service Getting Started Issue 03 Date 2018-09-26 HUAWEI TECHNOLOGIES CO., LTD

Procedure

Step 1 On the desktop of the server, click Start.

The Start window is displayed.

Step 2 Right-click Computer and choose Manage from the short-cut menu.

The Server Manager window is displayed.

Figure 5-23 Server Manager (Windows Server 2008)

Step 3 Disks are listed in the right pane. If the new disk is in the offline state, bring itonline before initialize it.

In the Disk 1 area, right-click and choose Online from the shortcut menu.

When the Disk 1 status changes from Offline to Not Initialized, the disk has beenbrought online.

Elastic Volume ServiceGetting Started 5 Step 4: Initialize an EVS Data Disk

Issue 03 (2018-09-26) Copyright © Huawei Technologies Co., Ltd. 50

Page 54: Getting Started - Huawei · Elastic Volume Service Getting Started Issue 03 Date 2018-09-26 HUAWEI TECHNOLOGIES CO., LTD

Figure 5-24 Bring online succeeded (Windows Server 2008)

Step 4 In the Disk 1 area, right-click and choose Initialize Disk from the shortcut menu.

The Initialize Disk dialog box is displayed.

Figure 5-25 Initialize Disk (Windows Server 2008)

Step 5 In the Initialize Disk dialog box, the to-be-initialized disk is selected. In thisexample, the disk capacity is larger than 2 TB. Therefore, select GPT (GUIDPartition Table) and click OK.

The Server Manager window is displayed.

Elastic Volume ServiceGetting Started 5 Step 4: Initialize an EVS Data Disk

Issue 03 (2018-09-26) Copyright © Huawei Technologies Co., Ltd. 51

Page 55: Getting Started - Huawei · Elastic Volume Service Getting Started Issue 03 Date 2018-09-26 HUAWEI TECHNOLOGIES CO., LTD

Figure 5-26 Server Manager (Windows Server 2008)

NO TICE

The maximum disk capacity supported by MBR is 2 TB, and that supported by GPTis 18 EB. Because a data disk currently supports up to 32 TB, use the GPT partitionstyle if your disk capacity is larger than 2 TB.If you change the disk partition style after the disk has been used, the data on thedisk will be cleared. Therefore, select a proper disk partition style when initializingthe disk.

Step 6 Right-click at the unallocated disk space and choose New Simple Volume fromthe shortcut menu.

The New Simple Volume Wizard window is displayed.

Elastic Volume ServiceGetting Started 5 Step 4: Initialize an EVS Data Disk

Issue 03 (2018-09-26) Copyright © Huawei Technologies Co., Ltd. 52

Page 56: Getting Started - Huawei · Elastic Volume Service Getting Started Issue 03 Date 2018-09-26 HUAWEI TECHNOLOGIES CO., LTD

Figure 5-27 New Simple Volume Wizard (Windows Server 2008)

Step 7 Follow the prompts and click Next.

The Specify Volume Size page is displayed.

Figure 5-28 Specify Volume Size (Windows Server 2008)

Step 8 Specify the volume size and click Next. The system selects the maximum volumesize by default. You can specify the volume size as required. In this example, thedefault setting is used.

The Assign Drive Letter or Path page is displayed.

Elastic Volume ServiceGetting Started 5 Step 4: Initialize an EVS Data Disk

Issue 03 (2018-09-26) Copyright © Huawei Technologies Co., Ltd. 53

Page 57: Getting Started - Huawei · Elastic Volume Service Getting Started Issue 03 Date 2018-09-26 HUAWEI TECHNOLOGIES CO., LTD

Figure 5-29 Assign Driver Letter or Path (Windows Server 2008)

Step 9 Assign a drive letter or path to your partition and click Next. The system assignsdrive letter D by default. In this example, the default setting is used.

The Format Partition page is displayed.

Figure 5-30 Format Partition (Windows Server 2008)

Step 10 Specify format settings and click Next. The system selects the NTFS file system bydefault. You can specify the file system type as required. In this example, thedefault setting is used.

The Completing the New Simple Volume Wizard page is displayed.

Elastic Volume ServiceGetting Started 5 Step 4: Initialize an EVS Data Disk

Issue 03 (2018-09-26) Copyright © Huawei Technologies Co., Ltd. 54

Page 58: Getting Started - Huawei · Elastic Volume Service Getting Started Issue 03 Date 2018-09-26 HUAWEI TECHNOLOGIES CO., LTD

Figure 5-31 Completing the New Simple Volume Wizard

NO TICE

The partition sizes supported by file systems vary. Therefore, you are advised tochoose an appropriate file system based on your service requirements.

Step 11 Click Finish.

Wait for the initialization to complete. When the volume status changes toHealthy, the initialization has finished successfully, as shown in Figure 5-32.

Elastic Volume ServiceGetting Started 5 Step 4: Initialize an EVS Data Disk

Issue 03 (2018-09-26) Copyright © Huawei Technologies Co., Ltd. 55

Page 59: Getting Started - Huawei · Elastic Volume Service Getting Started Issue 03 Date 2018-09-26 HUAWEI TECHNOLOGIES CO., LTD

Figure 5-32 Disk initialization succeeded (Windows Server 2008)

Step 12 After the volume is created, click and check whether a new volume appearsin Computer. In this example, New Volume (D:) is the new volume.

If New Volume (D:) appears, the disk is successfully initialized and no furtheraction is required.

Figure 5-33 Computer (Windows Server 2008)

----End

Elastic Volume ServiceGetting Started 5 Step 4: Initialize an EVS Data Disk

Issue 03 (2018-09-26) Copyright © Huawei Technologies Co., Ltd. 56

Page 60: Getting Started - Huawei · Elastic Volume Service Getting Started Issue 03 Date 2018-09-26 HUAWEI TECHNOLOGIES CO., LTD

5.7 Initializing a Windows Data Disk Larger Than 2 TB(Windows Server 2012)

ScenariosThis topic uses Windows Server 2012 R2 Standard 64bit to describe how toinitialize a data disk whose capacity is larger than 2 TB. In the followingoperations, the capacity of the sample disk is 3 TB.

The maximum disk capacity supported by MBR is 2 TB, and that supported by GPTis 18 EB. Therefore, use the GPT partition style if your disk capacity is larger than 2TB. For details, see Initializing a Windows Data Disk Larger Than 2 TB(Windows Server 2008). For details about disk partition styles, see Introductionto Data Disk Initialization Scenarios and Partition Styles.

The method for initializing a disk varies depending on the OS running on theserver. This document is used for reference only. For the detailed operations anddifferences, see the product documents of the corresponding OS.

NO TICE

When using a disk for the first time, if you have not initialized it, includingcreating partitions and file systems, the additional space added to this disk in anexpansion later may not be normally used.

Prerequisites● A data disk has been attached to a server and has not been initialized.● You have logged in to the server.

– For how to log in to an ECS, see Logging In to an ECS.– For how to log in to a BMS, see Logging In to a BMS.

Procedure

Step 1 On the desktop of the server, click in the lower area.

The Server Manager window is displayed.

Elastic Volume ServiceGetting Started 5 Step 4: Initialize an EVS Data Disk

Issue 03 (2018-09-26) Copyright © Huawei Technologies Co., Ltd. 57

Page 61: Getting Started - Huawei · Elastic Volume Service Getting Started Issue 03 Date 2018-09-26 HUAWEI TECHNOLOGIES CO., LTD

Figure 5-34 Server Manager (Windows Server 2012)

Step 2 In the upper right corner, choose Tools > Computer Management.

The Computer Management window is displayed.

Figure 5-35 Computer Management

Step 3 Choose Storage > Disk Management.

Disks are displayed in the right pane.

Elastic Volume ServiceGetting Started 5 Step 4: Initialize an EVS Data Disk

Issue 03 (2018-09-26) Copyright © Huawei Technologies Co., Ltd. 58

Page 62: Getting Started - Huawei · Elastic Volume Service Getting Started Issue 03 Date 2018-09-26 HUAWEI TECHNOLOGIES CO., LTD

Figure 5-36 Disk list

Step 4 (Optional) If the new disk is in the offline state, bring it online before initializingit.

In the Disk 1 area, right-click and choose Online from the shortcut menu.

When the status of Disk 1 changes from Offline to Not Initialized, the disk hasbeen brought online.

Figure 5-37 Bring online succeeded (Windows Server 2012)

Step 5 In the Disk 1 area, right-click and choose Initialize Disk from the shortcut menu.

Elastic Volume ServiceGetting Started 5 Step 4: Initialize an EVS Data Disk

Issue 03 (2018-09-26) Copyright © Huawei Technologies Co., Ltd. 59

Page 63: Getting Started - Huawei · Elastic Volume Service Getting Started Issue 03 Date 2018-09-26 HUAWEI TECHNOLOGIES CO., LTD

The Initialize Disk dialog box is displayed.

Figure 5-38 Initialize Disk (Windows Server 2012)

Step 6 In the Initialize Disk dialog box, the to-be-initialized disk is selected. In thisexample, the disk capacity is larger than 2 TB. Therefore, select GPT (GUIDPartition Table) and click OK.

The Computer Management window is displayed.

Figure 5-39 Computer Management (Windows Server 2012)

Elastic Volume ServiceGetting Started 5 Step 4: Initialize an EVS Data Disk

Issue 03 (2018-09-26) Copyright © Huawei Technologies Co., Ltd. 60

Page 64: Getting Started - Huawei · Elastic Volume Service Getting Started Issue 03 Date 2018-09-26 HUAWEI TECHNOLOGIES CO., LTD

NO TICE

The maximum disk capacity supported by MBR is 2 TB, and that supported by GPTis 18 EB. Because a data disk currently supports up to 32 TB, use the GPT partitionstyle if your disk capacity is larger than 2 TB.If you change the disk partition style after the disk has been used, the data on thedisk will be cleared. Therefore, select a proper disk partition style when initializingthe disk.

Step 7 Right-click at the unallocated disk space and choose New Simple Volume fromthe shortcut menu.

The New Simple Volume Wizard window is displayed.

Figure 5-40 New Simple Volume Wizard (Windows Server 2012)

Step 8 Follow the prompts and click Next.

The Specify Volume Size page is displayed.

Elastic Volume ServiceGetting Started 5 Step 4: Initialize an EVS Data Disk

Issue 03 (2018-09-26) Copyright © Huawei Technologies Co., Ltd. 61

Page 65: Getting Started - Huawei · Elastic Volume Service Getting Started Issue 03 Date 2018-09-26 HUAWEI TECHNOLOGIES CO., LTD

Figure 5-41 Specify Volume Size (Windows Server 2012)

Step 9 Specify the volume size and click Next. The system selects the maximum volumesize by default. You can specify the volume size as required. In this example, thedefault setting is used.

The Assign Drive Letter or Path page is displayed.

Figure 5-42 Assign Driver Letter or Path (Windows Server 2012)

Step 10 Assign a drive letter or path to your partition and click Next. The system assignsdrive letter D by default. In this example, the default setting is used.

Elastic Volume ServiceGetting Started 5 Step 4: Initialize an EVS Data Disk

Issue 03 (2018-09-26) Copyright © Huawei Technologies Co., Ltd. 62

Page 66: Getting Started - Huawei · Elastic Volume Service Getting Started Issue 03 Date 2018-09-26 HUAWEI TECHNOLOGIES CO., LTD

The Format Partition page is displayed.

Figure 5-43 Format Partition (Windows Server 2012)

Step 11 Specify format settings and click Next. The system selects the NTFS file system bydefault. You can specify the file system type as required. In this example, thedefault setting is used.

The Completing the New Simple Volume Wizard page is displayed.

Figure 5-44 Completing the New Simple Volume Wizard (Windows Server 2012)

Elastic Volume ServiceGetting Started 5 Step 4: Initialize an EVS Data Disk

Issue 03 (2018-09-26) Copyright © Huawei Technologies Co., Ltd. 63

Page 67: Getting Started - Huawei · Elastic Volume Service Getting Started Issue 03 Date 2018-09-26 HUAWEI TECHNOLOGIES CO., LTD

NO TICE

The partition sizes supported by file systems vary. Therefore, you are advised tochoose an appropriate file system based on your service requirements.

Step 12 Click Finish.

Wait for the initialization to complete. When the volume status changes toHealthy, the initialization has finished successfully, as shown in Figure 5-45.

Figure 5-45 Disk initialization succeeded (Windows Server 2012)

Step 13 After the volume is created, click and check whether a new volume appearsin This PC. In this example, New Volume (D:) is the new volume.

If New Volume (D:) appears, the disk is successfully initialized and no furtheraction is required.

Elastic Volume ServiceGetting Started 5 Step 4: Initialize an EVS Data Disk

Issue 03 (2018-09-26) Copyright © Huawei Technologies Co., Ltd. 64

Page 68: Getting Started - Huawei · Elastic Volume Service Getting Started Issue 03 Date 2018-09-26 HUAWEI TECHNOLOGIES CO., LTD

Figure 5-46 This PC (Windows Server 2012)

----End

5.8 Initializing a Linux Data Disk Larger Than 2 TB(parted)

ScenariosThis topic uses CentOS 7.4 64bit to describe how to use parted to initialize a datadisk whose capacity is larger than 2 TB. In the following operations, the capacityof the sample disk is 3 TB.

The maximum disk capacity supported by MBR is 2 TB, and that supported by GPTis 18 EB. Therefore, use the GPT partition style if your disk capacity is larger than 2TB. In Linux, if you choose to use the GPT partition style, the fdisk partitioning toolcannot be used. Use the parted partitioning tool instead. For details about diskpartition styles, see Introduction to Data Disk Initialization Scenarios andPartition Styles.

The method for initializing a disk varies depending on the OS running on theserver. This document is used for reference only. For the detailed operations anddifferences, see the product documents of the corresponding OS.

NO TICE

When using a disk for the first time, if you have not initialized it, includingcreating partitions and file systems, the additional space added to this disk in anexpansion later may not be normally used.

Elastic Volume ServiceGetting Started 5 Step 4: Initialize an EVS Data Disk

Issue 03 (2018-09-26) Copyright © Huawei Technologies Co., Ltd. 65

Page 69: Getting Started - Huawei · Elastic Volume Service Getting Started Issue 03 Date 2018-09-26 HUAWEI TECHNOLOGIES CO., LTD

Prerequisites● A data disk has been attached to a server and has not been initialized.● You have logged in to the server.

– For how to log in to an ECS, see Logging In to an ECS.– For how to log in to a BMS, see Logging In to a BMS.

Creating and Mounting a PartitionThe following example shows you how a new partition can be created on a newdata disk that has been attached to a server. The partition will be created usingparted, and GPT is used as the partition style. Furthermore, the partition will beformatted using the ext4 file system, mounted on /mnt/sdc, and configuredautomatic mounting at system start.

Step 1 Run the following command to query information about the new data disk:

lsblk

Information similar to the following is displayed:

[root@ecs-centos74 ~]# lsblkNAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINTvda 253:0 0 40G 0 disk├─vda1 253:1 0 1G 0 part /boot└─vda2 253:2 0 39G 0 part /vdb 253:16 0 3T 0 disk

In the command output, the server contains two disks. /dev/vda is the systemdisk, and /dev/vdb is the new data disk.

Step 2 Run the following command to enter parted to partition the new data disk:

parted New data disk

In this example, run the following command:

parted /dev/vdb

Information similar to the following is displayed:

[root@ecs-centos74 ~]# parted /dev/vdbGNU Parted 3.1Using /dev/vdbWelcome to GNU Parted! Type 'help' to view a list of commands.(parted)

Step 3 Enter p and press Enter to view the current disk partition style.

Information similar to the following is displayed:

(parted) pError: /dev/vdb: unrecognised disk labelModel: Virtio Block Device (virtblk)Disk /dev/vdb: 3299GBSector size (logical/physical): 512B/512BPartition Table: unknownDisk Flags:(parted)

In the command output, the Partition Table value is unknown, indicating that nopartition style is set for the new disk.

Elastic Volume ServiceGetting Started 5 Step 4: Initialize an EVS Data Disk

Issue 03 (2018-09-26) Copyright © Huawei Technologies Co., Ltd. 66

Page 70: Getting Started - Huawei · Elastic Volume Service Getting Started Issue 03 Date 2018-09-26 HUAWEI TECHNOLOGIES CO., LTD

Step 4 Run the following command to set the disk partition style:

mklabel Disk partition style

In this example, run the following command to set the disk partition style to GPT:(Disk partition styles can be MBR or GPT.)

mklabel gpt

NO TICE

The maximum disk capacity supported by MBR is 2 TB, and that supported by GPTis 18 EB. Because a data disk currently supports up to 32 TB, use the GPT partitionstyle if your disk capacity is larger than 2 TB.If you change the disk partition style after the disk has been used, the data on thedisk will be cleared. Therefore, select a proper disk partition style when initializingthe disk.

Step 5 Enter p and press Enter to view the disk partition style.

Information similar to the following is displayed:

(parted) mklabel gpt(parted) pModel: Virtio Block Device (virtblk)Disk /dev/vdb: 3299GBSector size (logical/physical): 512B/512BPartition Table: gptDisk Flags: Number Start End Size File system Name Flags (parted)

Step 6 Enter unit s and press Enter to set the measurement unit of the disk to sector.

Step 7 Run the following command and press Enter:

mkpart Partition name Start sector End sector

In this example, run the following command:

mkpart opt 2048s 100%

In this example, one partition is created for the new data disk. Value 2048sindicates the disk start sector, and 100% indicates the disk end sector. The twovalues are used for reference only. You can determine the number of partitionsand the partition size based on your service requirements.

Information similar to the following is displayed:(parted) mkpart opt 2048s 100%Warning: The resulting partition is not properly aligned for best performance.Ignore/Cancel? Ignore

If the preceding warning message is displayed, enter Ignore to ignore theperformance warning.

Step 8 Enter p and press Enter to view details about the new partition.

Information similar to the following is displayed:

Elastic Volume ServiceGetting Started 5 Step 4: Initialize an EVS Data Disk

Issue 03 (2018-09-26) Copyright © Huawei Technologies Co., Ltd. 67

Page 71: Getting Started - Huawei · Elastic Volume Service Getting Started Issue 03 Date 2018-09-26 HUAWEI TECHNOLOGIES CO., LTD

(parted) pModel: Virtio Block Device (virtblk)Disk /dev/vdb: 6442450944sSector size (logical/physical): 512B/512BPartition Table: gptDisk Flags: Number Start End Size File system Name Flags 1 2048s 6442448895s 6442446848s opt

Details about the dev/vdb1 partition are displayed.

Step 9 Enter q and press Enter to exit parted.

Step 10 Run the following command to view the disk partition information:

lsblk

Information similar to the following is displayed:

[root@ecs-centos74 ~]# lsblkNAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINTvda 253:0 0 40G 0 disk├─vda1 253:1 0 1G 0 part /boot└─vda2 253:2 0 39G 0 part /vdb 253:16 0 3T 0 disk└─vdb1 253:17 0 3T 0 part

In the command output, /dev/vdb1 is the partition you created.

Step 11 Run the following command to set the file system format for the new partition:

mkfs -t File system format /dev/vdb1

In this example, run the following command to set the ext4 file system for thenew partition:

mkfs -t ext4 /dev/vdb1

Information similar to the following is displayed:

[root@ecs-centos74 ~]# mkfs -t ext4 /dev/vdb1mke2fs 1.42.9 (28-Dec-2013)Filesystem label=OS type: LinuxBlock size=4096 (log=2)Fragment size=4096 (log=2)Stride=0 blocks, Stripe width=0 blocks201326592 inodes, 805305856 blocks40265292 blocks (5.00%) reserved for the super userFirst data block=0Maximum filesystem blocks=295279001624576 block groups32768 blocks per group, 32768 fragments per group8192 inodes per groupSuperblock backups stored on blocks: 32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632, 2654208, 4096000, 7962624, 11239424, 20480000, 23887872, 71663616, 78675968, 102400000, 214990848, 512000000, 550731776, 644972544 Allocating group tables: doneWriting inode tables: doneCreating journal (32768 blocks): doneWriting superblocks and filesystem accounting information: done

The formatting takes a period of time. Observe the system running status and donot exit.

Elastic Volume ServiceGetting Started 5 Step 4: Initialize an EVS Data Disk

Issue 03 (2018-09-26) Copyright © Huawei Technologies Co., Ltd. 68

Page 72: Getting Started - Huawei · Elastic Volume Service Getting Started Issue 03 Date 2018-09-26 HUAWEI TECHNOLOGIES CO., LTD

NO TICE

The partition sizes supported by file systems vary. Therefore, you are advised tochoose an appropriate file system based on your service requirements.

Step 12 Run the following command to create a mount point:

mkdir Mount point

In this example, run the following command to create the /mnt/sdc mount point:

mkdir /mnt/sdc

Step 13 Run the following command to mount the new partition on the created mountpoint:

mount Disk partition Mount point

In this example, run the following command to mount the new partition /dev/vdb1 on /mnt/sdc:

mount /dev/vdb1 /mnt/sdc

Step 14 Run the following command to view the mount result:

df -TH

Information similar to the following is displayed:

[root@ecs-centos74 ~]# df -THFilesystem Type Size Used Avail Use% Mounted on/dev/vda2 ext4 42G 1.5G 38G 4% /devtmpfs devtmpfs 2.0G 0 2.0G 0% /devtmpfs tmpfs 2.0G 0 2.0G 0% /dev/shmtmpfs tmpfs 2.0G 8.9M 2.0G 1% /runtmpfs tmpfs 2.0G 0 2.0G 0% /sys/fs/cgroup/dev/vda1 ext4 1.1G 153M 801M 17% /boottmpfs tmpfs 398M 0 398M 0% /run/user/0/dev/vdb1 ext4 3.3T 93M 3.1T 1% /mnt/sdc

New partition dev/vdb1 is mounted on /mnt/sdc.

----End

Setting Automatic Mounting at System Start

To automatically mount disk partitions at system start, do not specify partitions,for example /dev/vdb1, in /etc/fstab because the sequence of cloud devices, andtherefore their names may change during the server stop and start. You areadvised to use the universally unique identifier (UUID) in /etc/fstab to setautomatic mounting at system start.

NO TE

UUID is the unique character string for disk partitions in a Linux system.

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

blkid Disk partition

Elastic Volume ServiceGetting Started 5 Step 4: Initialize an EVS Data Disk

Issue 03 (2018-09-26) Copyright © Huawei Technologies Co., Ltd. 69

Page 73: Getting Started - Huawei · Elastic Volume Service Getting Started Issue 03 Date 2018-09-26 HUAWEI TECHNOLOGIES CO., LTD

In this example, run the following command to query the UUID of the /dev/vdb1partition:

blkid /dev/vdb1

Information similar to the following is displayed:

[root@ecs-test-0001 ~]# blkid /dev/vdb1/dev/vdb1: UUID="0b3040e2-1367-4abb-841d-ddb0b92693df" TYPE="ext4"

The UUID of the /dev/vdb1 partition is displayed.

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

vi /etc/fstab

Step 3 Press i to enter the editing mode.

Step 4 Move the cursor to the end of the file and press Enter. Then, add the followinginformation:UUID=0b3040e2-1367-4abb-841d-ddb0b92693df /mnt/sdc ext4 defaults 0 2

The preceding content is used for reference only. Add the information that is usedin the environment. The parameters are described as follows:● The first column indicates the partition UUID obtained in Step 1.● The second column indicates the directory on which the partition is mounted.

You can query the mount point using the df -TH command.● The third column indicates the file system format of the partition. You can

query the file system format using the df -TH command.● The fourth column indicates the partition mount option. Normally, this

parameter is set to defaults.● The fifth column indicates the Linux dump backup option.

– 0: not use Linux dump backup. Normally, dump backup is not used, andyou can set this parameter to 0.

– 1: use Linux dump backup.● The sixth column indicates the fsck option, that is, whether to use fsck to

check the attached disk during startup.– 0: not use fsck.– If the mount point is the root partition (/), this parameter must be set to

1.When this parameter is set to 1 for the root partition, this parameter forother partitions must start with 2 so that the system checks the partitionsin the ascending order of the values.

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

The system saves the configurations and exits the vi editor.

Step 6 Perform the following operations to verify the automatic mounting function:

1. Run the following command to unmount the partition:umount Disk partitionIn this example, run the following command:umount /dev/vdb1

Elastic Volume ServiceGetting Started 5 Step 4: Initialize an EVS Data Disk

Issue 03 (2018-09-26) Copyright © Huawei Technologies Co., Ltd. 70

Page 74: Getting Started - Huawei · Elastic Volume Service Getting Started Issue 03 Date 2018-09-26 HUAWEI TECHNOLOGIES CO., LTD

2. Run the following command to reload all the content in the /etc/fstab file:

mount -a

3. Run the following command to query the file system mounting information:

mount | grep Mount pointIn this example, run the following command:

mount | grep /mnt/sdc

If information similar to the following is displayed, the automatic mountingfunction takes effect:root@ecs-test-0001 ~]# mount | grep /mnt/sdc/dev/vdb1 on /mnt/sdc type ext4 (rw,relatime,data=ordered)

----End

5.9 Initializing Windows Data Disks Using Script

Scenarios

This topic uses Windows Server 2008 R2 Enterprise 64bit to describe how toautomatically initialize data disks attached to a server running Windows.

The method for initializing a disk varies depending on the OS running on theserver. This document is used for reference only. For the detailed operations anddifferences, see the product documents of the corresponding OS.

NO TICE

When using a disk for the first time, if you have not initialized it, includingcreating partitions and file systems, the additional space added to this disk in anexpansion later may not be normally used.

Prerequisites● A data disk has been attached to a server and has not been initialized.

● You have logged in to the server.

– For how to log in to an ECS, see Logging In to an ECS.

– For how to log in to a BMS, see Logging In to a BMS.

Constraints● This script uses the NTFS file system and MBR partition style by default.

● This script does not support the initialization of disks that form Windowslogical volume groups.

● This script supports the initialization of up to 23 Windows data disks.

● Only data disks in Windows simplified Chinese and English can be initialized.

Elastic Volume ServiceGetting Started 5 Step 4: Initialize an EVS Data Disk

Issue 03 (2018-09-26) Copyright © Huawei Technologies Co., Ltd. 71

Page 75: Getting Started - Huawei · Elastic Volume Service Getting Started Issue 03 Date 2018-09-26 HUAWEI TECHNOLOGIES CO., LTD

Manually Executing the Script to Initialize Windows Data Disks

Step 1 Log in to the server, visit https://ecs-instance-driver.obs.myhwclouds.com/datadisk/WinVMDataDiskAutoInitialize.ps1 to obtain the automatic diskinitialization script, and save it to C:\Windows\System32.

Step 2 On the server desktop, click Start, right-click Windows PowerShell, and chooseRun as administrator from the shortcut menu.

Figure 5-47 Run Windows PowerShell as administrator

Step 3 In the displayed dialog box, run the following command to set the script executionpolicy:

Set-ExecutionPolicy -ExecutionPolicy Bypass -Force

Step 4 Run the following command in the dialog box to execute the initialization script:

C:\Windows\System32\WinVMDataDiskAutoInitialize.ps1

Information similar to the following is displayed:

Elastic Volume ServiceGetting Started 5 Step 4: Initialize an EVS Data Disk

Issue 03 (2018-09-26) Copyright © Huawei Technologies Co., Ltd. 72

Page 76: Getting Started - Huawei · Elastic Volume Service Getting Started Issue 03 Date 2018-09-26 HUAWEI TECHNOLOGIES CO., LTD

NO TE

If the command output shows that PowerShell cannot load the file, the reason is that theWindows system policy does not allow the PowerShell script downloaded from the networkto be executed when the script is not signed.To solve this problem, run the set-ExecutionPolicy RemoteSigned command and restartPowerShell.

Step 5 (Optional) On the Disk Management page, view the initialization result.

Elastic Volume ServiceGetting Started 5 Step 4: Initialize an EVS Data Disk

Issue 03 (2018-09-26) Copyright © Huawei Technologies Co., Ltd. 73

Page 77: Getting Started - Huawei · Elastic Volume Service Getting Started Issue 03 Date 2018-09-26 HUAWEI TECHNOLOGIES CO., LTD

Figure 5-48 Disk Management

----End

Configuring Automatic Initialization of Windows Data Disks

Step 1 On the server desktop, click Start, right-click Computer in the list, and chooseManage from the shortcut menu.

The Server Manager window is displayed.

Elastic Volume ServiceGetting Started 5 Step 4: Initialize an EVS Data Disk

Issue 03 (2018-09-26) Copyright © Huawei Technologies Co., Ltd. 74

Page 78: Getting Started - Huawei · Elastic Volume Service Getting Started Issue 03 Date 2018-09-26 HUAWEI TECHNOLOGIES CO., LTD

Step 2 In the navigation tree on the left, choose Configuration > Task Scheduler > TaskScheduler Library, then right-click and choose Create Task from the shortcutmenu.

The Create Task page is displayed.

Elastic Volume ServiceGetting Started 5 Step 4: Initialize an EVS Data Disk

Issue 03 (2018-09-26) Copyright © Huawei Technologies Co., Ltd. 75

Page 79: Getting Started - Huawei · Elastic Volume Service Getting Started Issue 03 Date 2018-09-26 HUAWEI TECHNOLOGIES CO., LTD

Step 3 On the displayed page, click the General tab, enter WinVMDataDiskInitialize inthe Name text box, and click Change User or Group.

The Select User or Group page is displayed.

Step 4 Click Advanced in the lower left corner of the page.

Elastic Volume ServiceGetting Started 5 Step 4: Initialize an EVS Data Disk

Issue 03 (2018-09-26) Copyright © Huawei Technologies Co., Ltd. 76

Page 80: Getting Started - Huawei · Elastic Volume Service Getting Started Issue 03 Date 2018-09-26 HUAWEI TECHNOLOGIES CO., LTD

Step 5 Click Find Now to the right of the page. In the search result list, select SYSTEMand click OK.

The Select User or Group page is displayed.

Step 6 Click OK.

Elastic Volume ServiceGetting Started 5 Step 4: Initialize an EVS Data Disk

Issue 03 (2018-09-26) Copyright © Huawei Technologies Co., Ltd. 77

Page 81: Getting Started - Huawei · Elastic Volume Service Getting Started Issue 03 Date 2018-09-26 HUAWEI TECHNOLOGIES CO., LTD

Step 7 Click the Triggers tab and click Create in the lower left corner of the page.

Step 8 On the New Trigger page, choose At log on for Begin the task, retain the defaultsettings for other parameters, and click OK.

Step 9 Click the Actions tab and click Create in the lower left corner of the page.

Step 10 On the Edit Action page, set the following parameters:● Action: Choose Start a program.● Program/Script: Select powershell.exe.

Elastic Volume ServiceGetting Started 5 Step 4: Initialize an EVS Data Disk

Issue 03 (2018-09-26) Copyright © Huawei Technologies Co., Ltd. 78

Page 82: Getting Started - Huawei · Elastic Volume Service Getting Started Issue 03 Date 2018-09-26 HUAWEI TECHNOLOGIES CO., LTD

● Add arguments (optional): Enter -ExecutionPolicy Bypass C:\Windows\System32\WinVMDataDiskAutoInitialize.ps1.

Click OK.

Step 11 On the Create Task page, click OK.

After the configuration is complete, new disks purchased and attached to thisserver will be automatically initialized after the server is logged in to again.

NO TE

To enable automatic initialization of Windows data disks on multiple servers, configureautomatic initialization on one server, create a private image for this server, and use theimage to batch create servers.

----End

5.10 Initializing Linux Data Disks Using Script

ScenariosThis topic uses CentOS 7.4 64bit to describe how to initialize data disks attachedto a server running Linux using the initialization script.

Elastic Volume ServiceGetting Started 5 Step 4: Initialize an EVS Data Disk

Issue 03 (2018-09-26) Copyright © Huawei Technologies Co., Ltd. 79

Page 83: Getting Started - Huawei · Elastic Volume Service Getting Started Issue 03 Date 2018-09-26 HUAWEI TECHNOLOGIES CO., LTD

The method for initializing a disk varies depending on the OS running on theserver. This document is used for reference only. For the detailed operations anddifferences, see the product documents of the corresponding OS.

NO TICE

When using a disk for the first time, if you have not initialized it, includingcreating partitions and file systems, the additional space added to this disk in anexpansion later may not be normally used.

Prerequisites● A data disk has been attached to a server and has not been initialized.● You have logged in to the server.

– For how to log in to an ECS, see Logging In to an ECS.– For how to log in to a BMS, see Logging In to a BMS.

ConstraintsThis script uses the EXT4 file system by default. This script cannot be used tocreate LVM or VG partitions.

Initializing New Disks1. Log in to the server and run the following command to obtain the automatic

disk initialization script:wget https://ecs-instance-driver.obs.myhwclouds.com/datadisk/LinuxVMDataDiskAutoInitialize.sh

2. Run the following command to change the permission of the script:chmod -x LinuxVMDataDiskAutoInitialize.sh

3. Execute the following script to automatically detect the data disks to beinitialized:sh LinuxVMDataDiskAutoInitialize.shThe script automatically detects and displays the drive letters (forexample, /dev/vdb) except the system disk on the server. Then, you need toenter the drive letter to be initialized, for example, /dev/vdb.

Figure 5-49 Automatic detecting disks

4. Enter the drive letter and press Enter. The script automatically creates thepartition for the disk and formats it.

Elastic Volume ServiceGetting Started 5 Step 4: Initialize an EVS Data Disk

Issue 03 (2018-09-26) Copyright © Huawei Technologies Co., Ltd. 80

Page 84: Getting Started - Huawei · Elastic Volume Service Getting Started Issue 03 Date 2018-09-26 HUAWEI TECHNOLOGIES CO., LTD

Figure 5-50 Entering the drive letter

5. Enter the directory on which you want to mount the partition, for example, /data-test.

Figure 5-51 Entering the mounting directory

The initialization is complete until the script has mounted the partition andconfigured automatic mounting upon server start.

Figure 5-52 Disk initialization completed

Initializing Existing Disks1. Log in to the server and run the following command to obtain the automatic

disk initialization script:wget https://ecs-instance-driver.obs.myhwclouds.com/datadisk/LinuxVMDataDiskAutoInitialize.sh

2. Run the following command to change the permission of the script:chmod -x LinuxVMDataDiskAutoInitialize.sh

3. Execute the following script to automatically detect the data disks to beinitialized:sh LinuxVMDataDiskAutoInitialize.sh

Elastic Volume ServiceGetting Started 5 Step 4: Initialize an EVS Data Disk

Issue 03 (2018-09-26) Copyright © Huawei Technologies Co., Ltd. 81

Page 85: Getting Started - Huawei · Elastic Volume Service Getting Started Issue 03 Date 2018-09-26 HUAWEI TECHNOLOGIES CO., LTD

4. The script automatically detects that the disk partition has been mounted anddisplays the mounting directory. Determine whether to unmount the partition.Enter y to unmount the partition, or enter n to exit the script. In this example,enter y to continue the initialization.

Figure 5-53 Unmounting the disk partition

5. After the disk partition is unmounted, determine whether to format the disk.Enter y to format the disk, or enter n to exit the script.

Figure 5-54 Formatting the disk

6. After the disk is formatted, the system automatically creates a partition andcompletes the formatting. Enter the directory on which you want to mountthe partition, for example, /data-test.

Figure 5-55 Entering the mounting directory

The initialization is complete until the script has mounted the partition andconfigured automatic mounting upon server start.

Figure 5-56 Disk formatting and partition mounting completed

Elastic Volume ServiceGetting Started 5 Step 4: Initialize an EVS Data Disk

Issue 03 (2018-09-26) Copyright © Huawei Technologies Co., Ltd. 82

Page 86: Getting Started - Huawei · Elastic Volume Service Getting Started Issue 03 Date 2018-09-26 HUAWEI TECHNOLOGIES CO., LTD

A Change History

Release Date What's New

2018-09-26 This issue is the third official release, which incorporates thefollowing change:● Modified the parameter list for purchasing disks according to

the modifications made on the console.

2018-06-30 This issue is the second official release, which incorporates thefollowing changes:● Added section Initializing a Windows Data Disk Greater

Than 2 TB (Windows Server 2008).● Added section Initializing a Windows Data Disk Greater

Than 2 TB (Windows Server 2012).● Added section Initializing a Linux Data Disk Greater Than

2 TB (parted).

2018-06-15 This issue is the first official release.

Elastic Volume ServiceGetting Started A Change History

Issue 03 (2018-09-26) Copyright © Huawei Technologies Co., Ltd. 83