doc-exports/docs/evs/umn/evs_faq_0073.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

75 lines
8.6 KiB
HTML

<a name="evs_faq_0073"></a><a name="evs_faq_0073"></a>
<h1 class="topictitle1">How Do I Extend the File System of an Unpartitioned Data Disk in Linux?</h1>
<div id="body8662426"><div class="section" id="evs_faq_0073__en-us_topic_0241810111_en-us_topic_0240716537_section53681336113113"><h4 class="sectiontitle">Scenarios</h4><p id="evs_faq_0073__en-us_topic_0241810111_en-us_topic_0240716537_p2097914393317">If no partition but only a file system is created on a data disk, extend the file system according to the following operations:</p>
<p id="evs_faq_0073__p15126150152714">Run the <strong id="evs_faq_0073__b147173172811">lsblk</strong> command. Information similar to the following is displayed:</p>
<pre class="screen" id="evs_faq_0073__screen15467163152916">[root@ecs-test ~]# 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 60G 0 disk /mnt/sdc</pre>
<p id="evs_faq_0073__p8951201263013">In the command output, no partition but only a file system is created on data disk <strong id="evs_faq_0073__b1744239181718">/dev/vdb</strong>.</p>
<p id="evs_faq_0073__en-us_topic_0241810111_en-us_topic_0240716537_p15270194355816">In the following example, CentOS 7.4 64bit is used as the sample OS, data disk <strong id="evs_faq_0073__b41274571197">/dev/vdb</strong> has 10 GiB, no partition but only a file system is created on the disk, and additional 50 GiB has been added to this data disk on the management console. The following steps show how to extend this 50 GiB to the file system.</p>
<ul id="evs_faq_0073__en-us_topic_0241810111_en-us_topic_0240716537_ul1272311492618"><li id="evs_faq_0073__en-us_topic_0241810111_en-us_topic_0240716537_li77233147263"><a href="#evs_faq_0073__en-us_topic_0241810111_en-us_topic_0240716537_section63374919338">Extending the EXT* File System</a></li><li id="evs_faq_0073__en-us_topic_0241810111_en-us_topic_0240716537_li810142052614"><a href="#evs_faq_0073__en-us_topic_0241810111_en-us_topic_0240716537_section1248016813484">Extending the XFS File System</a></li></ul>
<p id="evs_faq_0073__en-us_topic_0241810111_en-us_topic_0240716537_p6521114615416">The way you allocate additional space depends on the OS. This example is used for reference only. For the detailed operations and differences, see the corresponding OS documentations.</p>
</div>
<div class="section" id="evs_faq_0073__en-us_topic_0241810111_en-us_topic_0240716537_section63374919338"><a name="evs_faq_0073__en-us_topic_0241810111_en-us_topic_0240716537_section63374919338"></a><a name="en-us_topic_0241810111_en-us_topic_0240716537_section63374919338"></a><h4 class="sectiontitle">Extending the EXT* File System</h4><ol id="evs_faq_0073__en-us_topic_0241810111_en-us_topic_0240716537_ol1276413439382"><li id="evs_faq_0073__en-us_topic_0241810111_en-us_topic_0240716537_li576416430389"><span>Run the following command to extend the file system:</span><p><p id="evs_faq_0073__en-us_topic_0241810111_en-us_topic_0240716537_p158621314155312"><strong id="evs_faq_0073__en-us_topic_0241810111_en-us_topic_0240716537_b17847130175318">resize2fs</strong> <em id="evs_faq_0073__en-us_topic_0241810111_en-us_topic_0240716537_i6259173413536">Disk name</em></p>
<p id="evs_faq_0073__en-us_topic_0241810111_en-us_topic_0240716537_p5942134415534">In this example, run the following command:</p>
<p id="evs_faq_0073__en-us_topic_0241810111_en-us_topic_0240716537_p1418213115315"><strong id="evs_faq_0073__en-us_topic_0241810111_en-us_topic_0240716537_b1622453195314">resize2fs /dev/vdb</strong></p>
<p id="evs_faq_0073__en-us_topic_0241810111_en-us_topic_0240716537_p178611816185411">Information similar to the following is displayed:</p>
<pre class="screen" id="evs_faq_0073__en-us_topic_0241810111_en-us_topic_0240716537_screen184720539395">[root@ecs-test ~]# resize2fs /dev/vdb
resize2fs 1.42.9 (28-Dec-2013)
Filesystem at /dev/vdb is mounted on /root/test; on-line resizing required
old_desc_blocs = 2, old_desc_blocs = 8
[17744.521535] EXT4-fs (vdb): resizing filesystem from 26214400 to 15728640 blocks
[17744.904470] EXT4-fs (vdb): resized filesystem to 15728640
The filesystem on /dev/vdb is now 15728640 blocks long.</pre>
</p></li><li id="evs_faq_0073__en-us_topic_0241810111_en-us_topic_0240716537_li17468248123913"><span>Run the following command to view the result:</span><p><p id="evs_faq_0073__en-us_topic_0241810111_en-us_topic_0240716537_p1930111013402"><strong id="evs_faq_0073__en-us_topic_0241810111_en-us_topic_0240716537_b230121011402">df -TH</strong></p>
<p id="evs_faq_0073__en-us_topic_0241810111_en-us_topic_0240716537_p1230181084010">Information similar to the following is displayed:</p>
<pre class="screen" id="evs_faq_0073__en-us_topic_0241810111_en-us_topic_0240716537_screen57432378403">[root@ecs-test ~]# 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.1M 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/vdb ext4 64G 55M 61G 1% /mnt/sdc</pre>
</p></li></ol>
</div>
<div class="section" id="evs_faq_0073__en-us_topic_0241810111_en-us_topic_0240716537_section1248016813484"><a name="evs_faq_0073__en-us_topic_0241810111_en-us_topic_0240716537_section1248016813484"></a><a name="en-us_topic_0241810111_en-us_topic_0240716537_section1248016813484"></a><h4 class="sectiontitle">Extending the XFS File System</h4><ol id="evs_faq_0073__en-us_topic_0241810111_en-us_topic_0240716537_ol029031516565"><li id="evs_faq_0073__en-us_topic_0241810111_en-us_topic_0240716537_li8244192405611"><span>Run the following command to extend the file system:</span><p><p id="evs_faq_0073__en-us_topic_0241810111_en-us_topic_0240716537_p7244162415616"><strong id="evs_faq_0073__en-us_topic_0241810111_en-us_topic_0240716537_b93875503566">xfs_growfs</strong> <em id="evs_faq_0073__en-us_topic_0241810111_en-us_topic_0240716537_i12244824115613">Disk name</em></p>
<p id="evs_faq_0073__en-us_topic_0241810111_en-us_topic_0240716537_p3244172495610">In this example, run the following command:</p>
<p id="evs_faq_0073__en-us_topic_0241810111_en-us_topic_0240716537_p19244172465617"><strong id="evs_faq_0073__en-us_topic_0241810111_en-us_topic_0240716537_b1280321725717">xfs_growfs</strong><strong id="evs_faq_0073__en-us_topic_0241810111_en-us_topic_0240716537_b12400248125716"> /dev/vdb</strong></p>
<p id="evs_faq_0073__en-us_topic_0241810111_en-us_topic_0240716537_p17244112410562">Information similar to the following is displayed:</p>
<pre class="screen" id="evs_faq_0073__en-us_topic_0241810111_en-us_topic_0240716537_screen48294102153">[root@ecs-test ~]# xfs_growfs /dev/vdb
meta-data=/dev/vdb isize=512 agcount=4, agsize=655360 blks
= sectsz=512 attr=2, projid32bit=1
= crc=1 finobt=0, spinodes=0
data = bsize=4096 blocks=2621440, imaxpct=25
= sunit=0 swidth=0 blks
naming =version2 bsize=4096 ascii-ci=0 ftype=1
log =internal bsize=4096 blocks=2560, version=2
= sectsz=512 sunit=0 blks, lazy-count=1
realtime =none extsz=4096 blocks=0, rtextents=0
data blocks changed from 2621440 to 15728640.</pre>
</p></li><li id="evs_faq_0073__en-us_topic_0241810111_en-us_topic_0240716537_li9186125812140"><span>Run the following command to view the result:</span><p><p id="evs_faq_0073__en-us_topic_0241810111_en-us_topic_0240716537_p365805110171"><strong id="evs_faq_0073__en-us_topic_0241810111_en-us_topic_0240716537_b17817117161811">df -TH</strong></p>
<p id="evs_faq_0073__en-us_topic_0241810111_en-us_topic_0240716537_p8792155319178">Information similar to the following is displayed:</p>
<pre class="screen" id="evs_faq_0073__en-us_topic_0241810111_en-us_topic_0240716537_screen521512014189">[root@ecs-test ~]# df -TH
Filesystem Type Size Used Avail Use% Mounted on
/dev/vda1 ext4 40G 2.3G 35G 7% /
devtmpfs devtmpfs 1.9G 0 1.9G 0% /dev
tmpfs tmpfs 1.9G 0 1.9G 0% /dev/shm
tmpfs tmpfs 1.9G 8.6M 1.9G 1% /run
tmpfs tmpfs 1.9G 0 1.9G 0% /sys/fs/cgroup
tmpfs tmpfs 379M 0 379M 0% /run/user/0
/dev/vdb xfs 60G 34M 60G 1% /mnt/sdc</pre>
</p></li></ol>
</div>
</div>
<div>
<div class="familylinks">
<div class="parentlink"><strong>Parent topic:</strong> <a href="evs_01_0077.html">Capacity Expansion</a></div>
</div>
</div>