Initialize the Data Disk

<p>After an EBS is mounted to an ECS, you need to log in to the ECS and initialize the EBS, namely formatting EBS before normally using it. This article introduces how to initialize data disk in Linux operating system.</p> <p><strong>Prerequisites</strong></p> <p>You have purchased data disk and successfully mount it to the target Linux instance.</p> <p><strong>Usage Guidelines</strong></p> <p>1.&nbsp; Linux system disk is generally /dev/sda. Do not revise it willfully.</p> <p>2.&nbsp; Do not execute risky commands such as rm-rf/* in the operating system. Such operations will lead all data in the /root directory to be deleted.</p> <p>3.&nbsp; Data disks purchased together with the instances do not need to mount but are partitioned in the operating system.</p> <p>System Initializing and Data Disk Mounting</p> <p><strong>Procedures</strong></p> <p>1.Log in to Linux instance.</p> <p>2.In the left navigation pane, click <strong>Instance</strong> to enter the <strong>Instance Management</strong> page.</p> <p>3.Select the target region. In the operation column of the target instance click <strong>Remote</strong>.</p> <p>4.On the page of remote login that opens, enter initial username root and login password of instance.</p> <p>5.Before mounting, use ls/dev/ vd* to view the only one disk. fdisk-1/ dev/vda shows that the system disk capacity is 60 GB.</p> <p>6.After mounting a data disk of 20 GB, use command above to view the storage quantity and capacity.</p> <p>7.Partition the data disk and execute the following command</p> <p>(1)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Run fdisk/dev/ vdb: Partition the data disk</p> <p>(2)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Enter n and press Enter: Create a new partition</p> <p>(3)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Enter p and press Enter: Select the primary partition</p> <p><strong>Note</strong>: Since a data disk of a single partition is created, you only need to create the primary partition.</p> <p>8.View new partition: Run the command fdisk -l.</p> <p>9.Create a new file system in a new partition: Run the command mkfs.ext3 /dev/vdb1</p> <p>10.&nbsp;(Suggested) back up etc/fstab: Run the command cp /etc/fstab /etc/fstab.bak.</p> <p>11.&nbsp; Storage partition can be mounted via partition ID and UUID.</p> <p>(1)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Mounting via partition ID</p> <p>Write new partition information to /etc/fstab: Run the command echo /dev/vdb1 /mnt ext3 defaults 0 0 &gt;&gt; /etc/fstab</p> <p>(2)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Mounting via UUID</p> <p>[root@ebs/]#&nbsp; blkid /dev/vdb1</p> <p>Write new information to /etc/fstab: Run the command echo UUID=49c0904a-42ce-4eef-87df-0f7de059e68e /mnt ext3 defaults 0 0 &gt;&gt; /etc/fstab</p> <p>12.&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Mounting file systems: Run the command mount /dev/vdb1 /mnt.</p> <p>13.&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; View disk space and usage: df &ndash;h. You can see /mnt directory is successfully mounted as follows.</p> <p>&nbsp;</p> <p>After completing mounting, file system space is available to use.</p> <p><strong>Note:</strong> If you want to uninstall EBS, first unmount/mnt in the operation system and then delete corresponding configuration line just written in /etc/fstab.</p>
Did the above content solve your problem? Yes No
Please complete information!

Call us

400-151-8800

Email us

cloud@pingan.com

Online customer service

Instant reply

Technical Support

cloud products