doc-exports/docs/evs/umn/evs_01_0034.html
zhangyue d05287d5d6 EVS UMN DOC
Reviewed-by: Miskanin, Jan <jan.miskanin@t-systems.com>
Co-authored-by: zhangyue <zhangyue164@huawei.com>
Co-committed-by: zhangyue <zhangyue164@huawei.com>
2024-05-09 07:19:17 +00:00

180 lines
29 KiB
HTML

<a name="evs_01_0034"></a><a name="evs_01_0034"></a>
<h1 class="topictitle1">Initializing a Linux Data Disk (parted)</h1>
<div id="body8662426"><div class="section" id="evs_01_0034__en-us_topic_0000001808490156_section31580524185332"><h4 class="sectiontitle">Scenarios</h4><p id="evs_01_0034__en-us_topic_0000001808490156_p4699546795037">This section uses CentOS 7.4 64bit to describe how to initialize a data disk attached to <span id="evs_01_0034__en-us_topic_0000001808490156_text1146380502125328">a server</span> running Linux and use parted to partition the data disk.</p>
<p id="evs_01_0034__en-us_topic_0000001808490156_p1082441621516">The maximum partition size that MBR supports is 2 TiB and that GPT supports is 18 EiB. If the disk size you need to partition is greater than 2 TiB, partition the disk using GPT.</p>
<p id="evs_01_0034__en-us_topic_0000001808490156_p15721831171512">The fdisk partitioning tool is suitable only for MBR partitions, and the parted partitioning tool is suitable for both MBR and GPT partitions. For more information, see <a href="evs_01_0038.html">Introduction to Data Disk Initialization Scenarios and Partition Styles</a>.</p>
<p id="evs_01_0034__en-us_topic_0000001808330348_p52314842171548">The method for initializing a disk varies slightly depending on the OS running on the server. This document is used for reference only. For the detailed operations and differences, see the product documents of the corresponding OS.</p>
<div class="notice" id="evs_01_0034__en-us_topic_0000001808490156_note13926451175010"><span class="noticetitle"><img src="public_sys-resources/notice_3.0-en-us.png"> </span><div class="noticebody"><p id="evs_01_0034__en-us_topic_0000001808490156_en-us_topic_0044524740_p205672613317">When using a disk for the first time, if you have not initialized it, including creating partitions and file systems, the additional space added to this disk in an expansion later may not be normally used.</p>
</div></div>
</div>
<div class="section" id="evs_01_0034__en-us_topic_0000001808490156_section36737034185332"><h4 class="sectiontitle">Prerequisites</h4><ul id="evs_01_0034__en-us_topic_0000001808490156_en-us_topic_0044524740_ul28913191171813"><li id="evs_01_0034__en-us_topic_0000001808490156_en-us_topic_0044524740_li20771164724419">A data disk has been attached to <span id="evs_01_0034__en-us_topic_0000001808330348_text1464237810424">a server</span> and has not been initialized.</li><li id="evs_01_0034__en-us_topic_0000001808490156_en-us_topic_0044524740_li36962755115557">You have logged in to the server.<ul id="evs_01_0034__en-us_topic_0000001808490156_en-us_topic_0044524740_ul6229092211568"><li id="evs_01_0034__en-us_topic_0000001808490156_en-us_topic_0044524740_li197989548398">For how to log in to an ECS, see the <em id="evs_01_0034__i1354915919503">Elastic Cloud Server User Guide</em>.</li><li id="evs_01_0034__en-us_topic_0000001808490156_en-us_topic_0044524740_li7220898115452">For how to log in to a BMS, see the <em id="evs_01_0034__i43046265114">Bare Metal Server User Guide</em>.</li></ul>
</li></ul>
</div>
<div class="section" id="evs_01_0034__en-us_topic_0000001808490156_section36039836195351"><h4 class="sectiontitle">Creating and Mounting a Partition</h4><p id="evs_01_0034__en-us_topic_0000001808490156_p4530289419544">The following example shows you how a new partition can be created on a new data disk that has been attached to <span id="evs_01_0034__en-us_topic_0000001808490156_text2422957163556">a server</span>. The partition will be created using parted, and GPT will be used. Furthermore, the partition will be formatted using the ext4 file system, mounted on <strong id="evs_01_0034__en-us_topic_0000001808490156_b109171540101711">/mnt/sdc</strong>, and configured to mount automatically at startup.</p>
</div>
<ol id="evs_01_0034__en-us_topic_0000001808490156_ol1329192162914"><li id="evs_01_0034__en-us_topic_0000001808490156_li02952152918"><span>Query information about the new data disk.</span><p><p id="evs_01_0034__en-us_topic_0000001808490156_p6233165017299"><strong id="evs_01_0034__en-us_topic_0000001808490156_b401898111841">lsblk</strong></p>
<div class="p" id="evs_01_0034__en-us_topic_0000001808490156_p1861313818316">Information similar to the following is displayed:<pre class="screen" id="evs_01_0034__en-us_topic_0000001808490156_screen841414913434">root@ecs-test-0001 ~]# lsblk
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
vda 253:0 0 40G 0 disk
└─vda1 253:1 0 40G 0 part /
vdb 253:16 0 100G 0 disk</pre>
</div>
<p id="evs_01_0034__en-us_topic_0000001808490156_p944866918517">In the command output, this server contains two disks. <span class="parmname" id="evs_01_0034__en-us_topic_0000001808490156_parmname2078417130553"><b>/dev/vda</b></span> and <span class="parmname" id="evs_01_0034__en-us_topic_0000001808490156_parmname12784213135515"><b>/dev/vdb</b></span>. <span class="parmname" id="evs_01_0034__en-us_topic_0000001808490156_parmname1778541315552"><b>/dev/vda</b></span> is the system disk, and <span class="parmname" id="evs_01_0034__en-us_topic_0000001808490156_parmname11786613155516"><b>/dev/vdb</b></span> is the new data disk.</p>
</p></li><li id="evs_01_0034__en-us_topic_0000001808490156_li17578198183210"><span>Launch parted to partition the new data disk.</span><p><p id="evs_01_0034__en-us_topic_0000001808490156_p19915181441219"><strong id="evs_01_0034__en-us_topic_0000001808490156_b162582328145953">parted</strong> <em id="evs_01_0034__en-us_topic_0000001808490156_i1217464476145953">New data disk</em></p>
<p id="evs_01_0034__en-us_topic_0000001808490156_p41477006111223">In this example, run the following command:</p>
<p id="evs_01_0034__en-us_topic_0000001808490156_p175788883211"><strong id="evs_01_0034__en-us_topic_0000001808490156_b879811371446">parted /dev/vdb</strong></p>
<div class="p" id="evs_01_0034__en-us_topic_0000001808490156_p2057812811323">Information similar to the following is displayed:<pre class="screen" id="evs_01_0034__en-us_topic_0000001808490156_screen538012914513">[root@ecs-test-0001 ~]# parted /dev/vdb
GNU Parted 3.1
Using /dev/vdb
Welcome to GNU Parted! Type 'help' to view a list of commands.
(parted) </pre>
</div>
</p></li><li id="evs_01_0034__en-us_topic_0000001808490156_li125780811321"><span>Enter <strong id="evs_01_0034__en-us_topic_0000001808490156_b43545514131720">p</strong> and press <strong id="evs_01_0034__en-us_topic_0000001808490156_b56365313131720">Enter</strong> to view the current disk partition style.</span><p><div class="p" id="evs_01_0034__en-us_topic_0000001808490156_p29271455221812">Information similar to the following is displayed:<pre class="screen" id="evs_01_0034__en-us_topic_0000001808490156_screen137411040463">(parted) p
Error: /dev/vdb: unrecognised disk label
Model: Virtio Block Device (virtblk)
Disk /dev/vdb: 107GiB
Sector size (logical/physical): 512B/512B
Partition Table: unknown
Disk Flags:
(parted) </pre>
</div>
<p id="evs_01_0034__en-us_topic_0000001808490156_p4012741718421">In the command output, the <strong id="evs_01_0034__en-us_topic_0000001808490156_b1148445363815">Partition Table</strong> value is <strong id="evs_01_0034__en-us_topic_0000001808490156_b592417555382">unknown</strong>, indicating that no partition style is set for the new disk.</p>
</p></li><li id="evs_01_0034__en-us_topic_0000001808490156_li51339901112856"><span>Set the disk partition style.</span><p><p id="evs_01_0034__en-us_topic_0000001808490156_p9393560112945"><strong id="evs_01_0034__en-us_topic_0000001808490156_b1848002532151728">mklabel</strong> <em id="evs_01_0034__en-us_topic_0000001808490156_i1998704360151728">Disk partition style</em></p>
<p id="evs_01_0034__en-us_topic_0000001808490156_p5919528411302">This command lets you control whether to use MBR or GPT for your partition table. In this example, GPT is used.</p>
<p id="evs_01_0034__en-us_topic_0000001808490156_p11418922112925"><strong id="evs_01_0034__en-us_topic_0000001808490156_b17959944112933">mklabel gpt</strong></p>
<div class="notice" id="evs_01_0034__en-us_topic_0000001808490156_note18848725104723"><span class="noticetitle"><img src="public_sys-resources/notice_3.0-en-us.png"> </span><div class="noticebody"><p id="evs_01_0034__en-us_topic_0000001808490156_en-us_topic_0085245975_p11834286151113">The maximum disk size supported by MBR is 2 TiB, and that supported by GPT is 18 EiB. Because an EVS data disk currently supports up to 32 TiB, use GPT if your disk size is larger than 2 TiB.</p>
<p id="evs_01_0034__en-us_topic_0000001808490156_en-us_topic_0085245975_p612681541585">If the partition style is changed after the disk has been used, all data on the disk will be lost, so take care to select an appropriate partition style when initializing the disk. If you must change the partition style to GPT after a disk has been used, it is recommended that you back up the disk data before the change.</p>
</div></div>
</p></li><li id="evs_01_0034__en-us_topic_0000001808490156_li17114528113148"><span>Enter <strong id="evs_01_0034__en-us_topic_0000001808490156_b1695801853151835">p</strong> and press <strong id="evs_01_0034__en-us_topic_0000001808490156_b188005457151835">Enter</strong> to view the disk partition style.</span><p><div class="p" id="evs_01_0034__en-us_topic_0000001808490156_p19813031113148">Information similar to the following is displayed:<pre class="screen" id="evs_01_0034__en-us_topic_0000001808490156_screen1333873825111">(parted) mklabel gpt
(parted) p
Model: Virtio Block Device (virtblk)
Disk /dev/vdb: 107GiB
Sector size (logical/physical): 512B/512B
Partition Table: gpt
Disk Flags:
Number Start End Size File system Name Flags
(parted) </pre>
</div>
<p id="evs_01_0034__en-us_topic_0000001808490156_p16339115010516">In the command output, the <strong id="evs_01_0034__en-us_topic_0000001808490156_b842352706151643">Partition Table</strong> value is <strong id="evs_01_0034__en-us_topic_0000001808490156_b842352706151622">gpt</strong>, indicating that the disk partition style is GPT.</p>
</p></li><li id="evs_01_0034__en-us_topic_0000001808490156_li2274037316228"><span>Enter <strong id="evs_01_0034__en-us_topic_0000001808490156_b842352706204829">unit s</strong> and press <strong id="evs_01_0034__en-us_topic_0000001808490156_b842352706204833">Enter</strong> to set the measurement unit of the disk to sector.</span></li><li id="evs_01_0034__en-us_topic_0000001808490156_li17033373105032"><span>Create a new partition.</span><p><p id="evs_01_0034__en-us_topic_0000001808490156_p1798722809"><strong id="evs_01_0034__en-us_topic_0000001808490156_b167419798">mkpart</strong> <em id="evs_01_0034__en-us_topic_0000001808490156_i39514141897">Partition name Start sector</em> <em id="evs_01_0034__en-us_topic_0000001808490156_i795119141913">End sector</em></p>
<p id="evs_01_0034__en-us_topic_0000001808490156_p96086206616">In this example, run the following command:</p>
<p id="evs_01_0034__en-us_topic_0000001808490156_p630617311785"><strong id="evs_01_0034__en-us_topic_0000001808490156_b99791930996">mkpart test 2048s 100%</strong></p>
<p id="evs_01_0034__en-us_topic_0000001808490156_p6516336113613">In this example, one partition is created for the new data disk, starting on <strong id="evs_01_0034__en-us_topic_0000001808490156_b38224135412">2048</strong> and using <strong id="evs_01_0034__en-us_topic_0000001808490156_b47435535411">100%</strong> of the rest of the disk. The two values are used for reference only. You can determine the number of partitions and the partition size based on your service requirements.</p>
<div class="p" id="evs_01_0034__en-us_topic_0000001808490156_p3579681322">Information similar to the following is displayed:<pre class="screen" id="evs_01_0034__en-us_topic_0000001808490156_screen8579158143210">(parted) mkpart opt 2048s 100%
(parted)</pre>
</div>
</p></li><li id="evs_01_0034__en-us_topic_0000001808490156_li457988173211"><span>Enter <strong id="evs_01_0034__en-us_topic_0000001808490156_b11781738135410">p</strong> and press <strong id="evs_01_0034__en-us_topic_0000001808490156_b13179103895415">Enter</strong> to print the partition details.</span><p><div class="p" id="evs_01_0034__en-us_topic_0000001808490156_p157919863211">Information similar to the following is displayed:<pre class="screen" id="evs_01_0034__en-us_topic_0000001808490156_screen044361613111">(parted) p
Model: Virtio Block Device (virtblk)
Disk /dev/vdb: 209715200s
Sector size (logical/physical): 512B/512B
Partition Table: gpt
Disk Flags:
Number Start End Size File system Name Flags
1 2048s 209713151s 209711104s test
(parted) </pre>
</div>
</p></li><li id="evs_01_0034__en-us_topic_0000001808490156_li4398403895019"><span>Enter <strong id="evs_01_0034__en-us_topic_0000001808490156_b198198625115314">q</strong> and press <strong id="evs_01_0034__en-us_topic_0000001808490156_b212127154015314">Enter</strong> to exit parted.</span><p><div class="p" id="evs_01_0034__en-us_topic_0000001808490156_p388845720177">Information similar to the following is displayed:<pre class="screen" id="evs_01_0034__en-us_topic_0000001808490156_screen18254819161811">(parted) q
Information: You may need to update /etc/fstab.</pre>
</div>
<p id="evs_01_0034__en-us_topic_0000001808490156_p145861541111818">You can configure automatic mounting by updating the <strong id="evs_01_0034__en-us_topic_0000001808490156_b1858793314478">/etc/fstab</strong> file. Before doing so, format the partition with a desired file system and mount the partition on the mount point.</p>
</p></li><li id="evs_01_0034__en-us_topic_0000001808490156_li21640013114439"><span>View the disk partition information.</span><p><p id="evs_01_0034__en-us_topic_0000001808490156_p60542391114439"><strong id="evs_01_0034__en-us_topic_0000001808490156_b8010609114439">lsblk</strong></p>
<div class="p" id="evs_01_0034__en-us_topic_0000001808490156_p4986620114439">Information similar to the following is displayed:<pre class="screen" id="evs_01_0034__en-us_topic_0000001808490156_screen10760108181215">[root@ecs-test-0001 ~]# lsblk
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
vda 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</pre>
</div>
<p id="evs_01_0034__en-us_topic_0000001808490156_p48773852105546">In the command output, <strong id="evs_01_0034__en-us_topic_0000001808490156_b842352706161344">/dev/vdb1</strong> is the partition you created.</p>
</p></li><li id="evs_01_0034__en-us_topic_0000001808490156_li958068193210"><span>Format the new partition with a desired file system format.</span><p><p id="evs_01_0034__en-us_topic_0000001808490156_p1169510295739"><strong id="evs_01_0034__en-us_topic_0000001808490156_b59009069215057">mkfs</strong> <strong id="evs_01_0034__en-us_topic_0000001808490156_b189101114715057">-t</strong> <em id="evs_01_0034__en-us_topic_0000001808490156_i22062884215057">File system format</em> <strong id="evs_01_0034__en-us_topic_0000001808490156_b123674698515057">/dev/vdb1</strong></p>
<p id="evs_01_0034__en-us_topic_0000001808490156_p5243126995731">In this example, the <span class="filepath" id="evs_01_0034__en-us_topic_0000001808490156_filepath8509192919564"><b>ext4</b></span> format is used for the new partition.</p>
<p id="evs_01_0034__en-us_topic_0000001808490156_p1580148193210"><strong id="evs_01_0034__en-us_topic_0000001808490156_b2150362315270">mkfs -t ext4 /dev/vdb1</strong></p>
<div class="p" id="evs_01_0034__en-us_topic_0000001808490156_p458016833215">Information similar to the following is displayed:<pre class="screen" id="evs_01_0034__en-us_topic_0000001808490156_screen01161834181220">[root@ecs-test-0001 ~]# mkfs -t ext4 /dev/vdb1
mke2fs 1.42.9 (28-Dec-2013)
Filesystem label=
OS type: Linux
Block size=4096 (log=2)
Fragment size=4096 (log=2)
Stride=0 blocks, Stripe width=0 blocks
6553600 inodes, 26213888 blocks
1310694 blocks (5.00%) reserved for the super user
First data block=0
Maximum filesystem blocks=2174746624
800 block groups
32768 blocks per group, 32768 fragments per group
8192 inodes per group
Superblock backups stored on blocks:
32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632, 2654208,
4096000, 7962624, 11239424, 20480000, 23887872
Allocating group tables: done
Writing inode tables: done
Creating journal (32768 blocks): done
Writing superblocks and filesystem accounting information: done</pre>
</div>
<p id="evs_01_0034__en-us_topic_0000001808490156_p1758015813211">The formatting takes a period of time. Observe the system running status and do not exit.</p>
<div class="notice" id="evs_01_0034__en-us_topic_0000001808490156_note29186911243"><span class="noticetitle"><img src="public_sys-resources/notice_3.0-en-us.png"> </span><div class="noticebody"><p id="evs_01_0034__en-us_topic_0000001808490156_p262682811243">The partition sizes supported by file systems vary. Choose an appropriate file system format based on your service requirements.</p>
</div></div>
</p></li><li id="evs_01_0034__en-us_topic_0000001808490156_li1910362714149"><span>Create a mount point.</span><p><p id="evs_01_0034__en-us_topic_0000001808490156_p1910382791412"><strong id="evs_01_0034__en-us_topic_0000001808490156_b1856120194514">mkdir</strong> <em id="evs_01_0034__en-us_topic_0000001808490156_i956219198512">Mount point</em></p>
<p id="evs_01_0034__en-us_topic_0000001808490156_p810320277141">In this example, the <strong id="evs_01_0034__en-us_topic_0000001808490156_b3203220165719">/mnt/sdc</strong> mount point is created.</p>
<p id="evs_01_0034__en-us_topic_0000001808490156_p171039270143"><strong id="evs_01_0034__en-us_topic_0000001808490156_b1110352719144">mkdir /mnt/sdc</strong></p>
<div class="note" id="evs_01_0034__en-us_topic_0000001808490156_note1653352162717"><img src="public_sys-resources/note_3.0-en-us.png"><span class="notetitle"> </span><div class="notebody"><p id="evs_01_0034__en-us_topic_0000001808490156_en-us_topic_0044524669_p153319214278">The <strong id="evs_01_0034__b1034415487519">/mnt</strong> directory exists on all Linux systems. If the mount point cannot be created, it may be that the <strong id="evs_01_0034__b4345184865117">/mnt</strong> directory has been accidentally deleted. You can run <strong id="evs_01_0034__b1534594816513">mkdir -p /mnt/sdc</strong> to create the mount point.</p>
</div></div>
</p></li><li id="evs_01_0034__en-us_topic_0000001808490156_li17103172711414"><span>Mount the new partition on the created mount point.</span><p><p id="evs_01_0034__en-us_topic_0000001808490156_p31039277141"><strong id="evs_01_0034__en-us_topic_0000001808490156_b16411837205110">mount</strong> <em id="evs_01_0034__en-us_topic_0000001808490156_i8642173720513">Disk partition</em> <em id="evs_01_0034__en-us_topic_0000001808490156_i56430370511">Mount point</em></p>
<p id="evs_01_0034__en-us_topic_0000001808490156_p171037271142">In this example, the <strong id="evs_01_0034__en-us_topic_0000001808490156_b2730538175710">/dev/vdb1</strong> partition is mounted on <strong id="evs_01_0034__en-us_topic_0000001808490156_b773063810574">/mnt/sdc</strong>.</p>
<p id="evs_01_0034__en-us_topic_0000001808490156_p51031027171414"><strong id="evs_01_0034__en-us_topic_0000001808490156_b5103122710147">mount /dev/vdb1 /mnt/sdc</strong></p>
</p></li><li id="evs_01_0034__en-us_topic_0000001808490156_li47695742151459"><span>Check the mount result.</span><p><p id="evs_01_0034__en-us_topic_0000001808490156_p26608495151459"><strong id="evs_01_0034__en-us_topic_0000001808490156_b38149863151459">df -TH</strong></p>
<p id="evs_01_0034__en-us_topic_0000001808490156_p7804447151459">Information similar to the following is displayed:</p>
<pre class="screen" id="evs_01_0034__en-us_topic_0000001808490156_screen18302978112619">[root@ecs-test-0001 ~]# df -TH
Filesystem Type Size Used Avail Use% Mounted on
/dev/vda1 ext4 43G 1.9G 39G 5% /
devtmpfs devtmpfs 2.0G 0 2.0G 0% /dev
tmpfs tmpfs 2.0G 0 2.0G 0% /dev/shm
tmpfs tmpfs 2.0G 9.0M 2.0G 1% /run
tmpfs tmpfs 2.0G 0 2.0G 0% /sys/fs/cgroup
tmpfs tmpfs 398M 0 398M 0% /run/user/0
/dev/vdb1 ext4 106G 63M 101G 1% /mnt/sdc</pre>
<p id="evs_01_0034__en-us_topic_0000001808490156_p8231156151459">You should now see that partition <span class="parmname" id="evs_01_0034__en-us_topic_0000001808490156_parmname10736103815813"><b>/dev/vdb1</b></span> is mounted on <span class="filepath" id="evs_01_0034__en-us_topic_0000001808490156_filepath157372382582"><b>/mnt/sdc</b></span>.</p>
<div class="note" id="evs_01_0034__en-us_topic_0000001808490156_note151217575408"><img src="public_sys-resources/note_3.0-en-us.png"><span class="notetitle"> </span><div class="notebody"><p id="evs_01_0034__en-us_topic_0000001808490156_p13141357194019">After the <span id="evs_01_0034__en-us_topic_0000001808490156_text18797917173516">server</span> is restarted, the disk will not be automatically mounted. You can modify the <strong id="evs_01_0034__b18881326135220">/etc/fstab</strong> file to configure automount at startup. For details, see <a href="#evs_01_0034__en-us_topic_0000001808490156_section15839912195453">Configuring Automatic Mounting at System Start</a>.</p>
</div></div>
</p></li></ol>
<div class="section" id="evs_01_0034__en-us_topic_0000001808490156_section15839912195453"><a name="evs_01_0034__en-us_topic_0000001808490156_section15839912195453"></a><a name="en-us_topic_0000001808490156_section15839912195453"></a><h4 class="sectiontitle">Configuring Automatic Mounting at System Start</h4><p id="evs_01_0034__en-us_topic_0000001808490156_en-us_topic_0044524669_p10888449418">The <strong id="evs_01_0034__b1511494218523">fstab</strong> file controls what disks are automatically mounted at <span id="evs_01_0034__text19116124295217">server</span> startup. You can configure the <strong id="evs_01_0034__b169589461525">fstab</strong> file of a <span id="evs_01_0034__text296074616523">server</span> that has data. This operation will not affect the existing data.</p>
<p id="evs_01_0034__en-us_topic_0000001808490156_en-us_topic_0044524669_p3301097119558">The following example uses UUIDs to identify disks in the <strong id="evs_01_0034__b959310529528">fstab</strong> file. You are advised not to use device names (like <strong id="evs_01_0034__b1537195685219">/dev/vdb1</strong>) to identify disks in the file because device names are assigned dynamically and may change (for example, from <strong id="evs_01_0034__b23722564524">/dev/vdb1</strong> to <strong id="evs_01_0034__b143721956105216">/dev/vdb2</strong>) after a <span id="evs_01_0034__text13374656175219">server</span> stop or start. This can even prevent your <span id="evs_01_0034__text037695615528">server</span> from booting up.</p>
<div class="note" id="evs_01_0034__en-us_topic_0000001808490156_en-us_topic_0044524669_note6058396910219"><img src="public_sys-resources/note_3.0-en-us.png"><span class="notetitle"> </span><div class="notebody"><p id="evs_01_0034__en-us_topic_0000001808490156_en-us_topic_0044524669_p838481110219">UUIDs are the unique character strings for identifying partitions in Linux.</p>
</div></div>
<ol id="evs_01_0034__en-us_topic_0000001808490156_en-us_topic_0044524669_ol7409641133211"><li id="evs_01_0034__en-us_topic_0000001808490156_en-us_topic_0044524669_li840964143216"><span>Query the partition UUID.</span><p><p id="evs_01_0034__en-us_topic_0000001808490156_en-us_topic_0044524669_p32760575102436"><strong id="evs_01_0034__b13381625135311">blkid</strong> <em id="evs_01_0034__i17339112585317">Disk partition</em></p>
<p id="evs_01_0034__en-us_topic_0000001808490156_en-us_topic_0044524669_p54606997105845">In this example, the UUID of the <span class="parmname" id="evs_01_0034__parmname17940826145318"><b>/dev/vdb1</b></span> partition is queried.</p>
<p id="evs_01_0034__en-us_topic_0000001808490156_en-us_topic_0044524669_p204811453103215"><strong id="evs_01_0034__en-us_topic_0000001808490156_en-us_topic_0044524669_b11565159153817">blkid /dev/vdb1</strong></p>
<p id="evs_01_0034__en-us_topic_0000001808490156_en-us_topic_0044524669_p13610514113319">Information similar to the following is displayed:</p>
<pre class="screen" id="evs_01_0034__en-us_topic_0000001808490156_en-us_topic_0044524669_screen361091453315">[root@ecs-test-0001 ~]# blkid /dev/vdb1
/dev/vdb1: UUID="0b3040e2-1367-4abb-841d-ddb0b92693df" TYPE="ext4"</pre>
<p id="evs_01_0034__en-us_topic_0000001808490156_en-us_topic_0044524669_p275684701890">Carefully record the UUID, as you will need it for the following step.</p>
</p></li><li id="evs_01_0034__en-us_topic_0000001808490156_en-us_topic_0044524669_li199421823183318"><span>Open the <strong id="evs_01_0034__b0929123395314">fstab</strong> file using the vi editor.</span><p><p id="evs_01_0034__en-us_topic_0000001808490156_en-us_topic_0044524669_p9610114153320"><strong id="evs_01_0034__en-us_topic_0000001808490156_en-us_topic_0044524669_b1361031419337">vi /etc/fstab</strong></p>
</p></li><li id="evs_01_0034__en-us_topic_0000001808490156_en-us_topic_0044524669_li941511389331"><span>Press <strong id="evs_01_0034__b1471015369538">i</strong> to enter editing mode.</span></li><li id="evs_01_0034__en-us_topic_0000001808490156_en-us_topic_0044524669_li8415123893310"><span>Move the cursor to the end of the file and press <strong id="evs_01_0034__b9334385531">Enter</strong>. Then, add the following information:</span><p><pre class="screen" id="evs_01_0034__en-us_topic_0000001808490156_en-us_topic_0044524669_screen8133145031318">UUID=0b3040e2-1367-4abb-841d-ddb0b92693df /mnt/sdc ext4 defaults 0 2</pre>
</p></li><li id="evs_01_0034__en-us_topic_0000001808490156_en-us_topic_0044524669_li841512388338"><span>Press <strong id="evs_01_0034__b28531410165414">Esc</strong>, enter <strong id="evs_01_0034__b18853111015548">:wq</strong>, and press <strong id="evs_01_0034__b9853910185413">Enter</strong>.</span><p><p id="evs_01_0034__en-us_topic_0000001808490156_en-us_topic_0044524669_p1141543813310">The system saves the configurations and exits the vi editor.</p>
</p></li><li id="evs_01_0034__en-us_topic_0000001808490156_en-us_topic_0044524669_en-us_topic_0142861223_li17720613102410"><span>Verify that the disk is auto-mounted at startup.</span><p><ol type="a" id="evs_01_0034__en-us_topic_0000001808490156_en-us_topic_0044524669_en-us_topic_0142861223_ol199891910256"><li id="evs_01_0034__en-us_topic_0000001808490156_en-us_topic_0044524669_en-us_topic_0142861223_li1620791415268">Unmount the partition.<p id="evs_01_0034__en-us_topic_0000001808490156_en-us_topic_0044524669_en-us_topic_0142861223_p18208131462618"><a name="evs_01_0034__en-us_topic_0000001808490156_en-us_topic_0044524669_en-us_topic_0142861223_li1620791415268"></a><a name="en-us_topic_0000001808490156_en-us_topic_0044524669_en-us_topic_0142861223_li1620791415268"></a><strong id="evs_01_0034__b174620164547">umount</strong> <em id="evs_01_0034__i2046271605412">Disk partition</em></p>
<p id="evs_01_0034__en-us_topic_0000001808490156_en-us_topic_0044524669_en-us_topic_0142861223_p621161413262">In this example, run the following command:</p>
<p id="evs_01_0034__en-us_topic_0000001808490156_en-us_topic_0044524669_en-us_topic_0142861223_p1521115148260"><strong id="evs_01_0034__en-us_topic_0000001808490156_en-us_topic_0044524669_en-us_topic_0142861223_b0213614192618">umount /dev/vdb1</strong></p>
</li><li id="evs_01_0034__en-us_topic_0000001808490156_en-us_topic_0044524669_en-us_topic_0142861223_li2397162792610">Reload all the content in the <strong id="evs_01_0034__b421351925420">/etc/fstab</strong> file.<p id="evs_01_0034__en-us_topic_0000001808490156_en-us_topic_0044524669_en-us_topic_0142861223_p1739714278269"><strong id="evs_01_0034__en-us_topic_0000001808490156_en-us_topic_0044524669_en-us_topic_0142861223_b63981278267">mount -a</strong></p>
</li><li id="evs_01_0034__en-us_topic_0000001808490156_en-us_topic_0044524669_en-us_topic_0142861223_li9280203710269">Query the file system mounting information.<p id="evs_01_0034__en-us_topic_0000001808490156_en-us_topic_0044524669_en-us_topic_0142861223_p3282133715264"><a name="evs_01_0034__en-us_topic_0000001808490156_en-us_topic_0044524669_en-us_topic_0142861223_li9280203710269"></a><a name="en-us_topic_0000001808490156_en-us_topic_0044524669_en-us_topic_0142861223_li9280203710269"></a><strong id="evs_01_0034__b124661626175417">mount</strong> <strong id="evs_01_0034__b1146652655417">|</strong> <strong id="evs_01_0034__b846782615548">grep</strong> <em id="evs_01_0034__i9467726105412">Mount point</em></p>
<p id="evs_01_0034__en-us_topic_0000001808490156_en-us_topic_0044524669_en-us_topic_0142861223_p3286437112619">In this example, run the following command:</p>
<p id="evs_01_0034__en-us_topic_0000001808490156_en-us_topic_0044524669_en-us_topic_0142861223_p18286123782619"><strong id="evs_01_0034__en-us_topic_0000001808490156_en-us_topic_0044524669_b925094342911">mount</strong> <strong id="evs_01_0034__en-us_topic_0000001808490156_en-us_topic_0044524669_b1725119437291">|</strong> <strong id="evs_01_0034__en-us_topic_0000001808490156_en-us_topic_0044524669_b15324154395212">grep</strong> <strong id="evs_01_0034__en-us_topic_0000001808490156_en-us_topic_0044524669_b1831387417">/mnt/sdc</strong></p>
<p id="evs_01_0034__en-us_topic_0000001808490156_en-us_topic_0044524669_en-us_topic_0142861223_p429163752616">If information similar to the following is displayed, automatic mounting has been configured:</p>
<pre class="screen" id="evs_01_0034__en-us_topic_0000001808490156_en-us_topic_0044524669_en-us_topic_0142861223_screen429312370265">root@ecs-test-0001 ~]# mount | grep /mnt/sdc
/dev/vdb1 on /mnt/sdc type ext4 (rw,relatime,data=ordered)</pre>
</li></ol>
</p></li></ol>
</div>
</div>
<div>
<div class="familylinks">
<div class="parentlink"><strong>Parent topic:</strong> <a href="evs_01_0058.html">Initialize an EVS Data Disk</a></div>
</div>
</div>