Esta página ainda não está disponível no idioma selecionado. Estamos trabalhando para adicionar mais opções de idiomas. Agradecemos sua compreensão.

Compute
Elastic Cloud Server
Huawei Cloud Flexus
Bare Metal Server
Auto Scaling
Image Management Service
Dedicated Host
FunctionGraph
Cloud Phone Host
Huawei Cloud EulerOS
Networking
Virtual Private Cloud
Elastic IP
Elastic Load Balance
NAT Gateway
Direct Connect
Virtual Private Network
VPC Endpoint
Cloud Connect
Enterprise Router
Enterprise Switch
Global Accelerator
Management & Governance
Cloud Eye
Identity and Access Management
Cloud Trace Service
Resource Formation Service
Tag Management Service
Log Tank Service
Config
OneAccess
Resource Access Manager
Simple Message Notification
Application Performance Management
Application Operations Management
Organizations
Optimization Advisor
IAM Identity Center
Cloud Operations Center
Resource Governance Center
Migration
Server Migration Service
Object Storage Migration Service
Cloud Data Migration
Migration Center
Cloud Ecosystem
KooGallery
Partner Center
User Support
My Account
Billing Center
Cost Center
Resource Center
Enterprise Management
Service Tickets
HUAWEI CLOUD (International) FAQs
ICP Filing
Support Plans
My Credentials
Customer Operation Capabilities
Partner Support Plans
Professional Services
Analytics
MapReduce Service
Data Lake Insight
CloudTable Service
Cloud Search Service
Data Lake Visualization
Data Ingestion Service
GaussDB(DWS)
DataArts Studio
Data Lake Factory
DataArts Lake Formation
IoT
IoT Device Access
Others
Product Pricing Details
System Permissions
Console Quick Start
Common FAQs
Instructions for Associating with a HUAWEI CLOUD Partner
Message Center
Security & Compliance
Security Technologies and Applications
Web Application Firewall
Host Security Service
Cloud Firewall
SecMaster
Anti-DDoS Service
Data Encryption Workshop
Database Security Service
Cloud Bastion Host
Data Security Center
Cloud Certificate Manager
Edge Security
Situation Awareness
Managed Threat Detection
Blockchain
Blockchain Service
Web3 Node Engine Service
Media Services
Media Processing Center
Video On Demand
Live
SparkRTC
MetaStudio
Storage
Object Storage Service
Elastic Volume Service
Cloud Backup and Recovery
Storage Disaster Recovery Service
Scalable File Service Turbo
Scalable File Service
Volume Backup Service
Cloud Server Backup Service
Data Express Service
Dedicated Distributed Storage Service
Containers
Cloud Container Engine
SoftWare Repository for Container
Application Service Mesh
Ubiquitous Cloud Native Service
Cloud Container Instance
Databases
Relational Database Service
Document Database Service
Data Admin Service
Data Replication Service
GeminiDB
GaussDB
Distributed Database Middleware
Database and Application Migration UGO
TaurusDB
Middleware
Distributed Cache Service
API Gateway
Distributed Message Service for Kafka
Distributed Message Service for RabbitMQ
Distributed Message Service for RocketMQ
Cloud Service Engine
Multi-Site High Availability Service
EventGrid
Dedicated Cloud
Dedicated Computing Cluster
Business Applications
Workspace
ROMA Connect
Message & SMS
Domain Name Service
Edge Data Center Management
Meeting
AI
Face Recognition Service
Graph Engine Service
Content Moderation
Image Recognition
Optical Character Recognition
ModelArts
ImageSearch
Conversational Bot Service
Speech Interaction Service
Huawei HiLens
Video Intelligent Analysis Service
Developer Tools
SDK Developer Guide
API Request Signing Guide
Terraform
Koo Command Line Interface
Content Delivery & Edge Computing
Content Delivery Network
Intelligent EdgeFabric
CloudPond
Intelligent EdgeCloud
Solutions
SAP Cloud
High Performance Computing
Developer Services
ServiceStage
CodeArts
CodeArts PerfTest
CodeArts Req
CodeArts Pipeline
CodeArts Build
CodeArts Deploy
CodeArts Artifact
CodeArts TestPlan
CodeArts Check
CodeArts Repo
Cloud Application Engine
MacroVerse aPaaS
KooMessage
KooPhone
KooDrive
Help Center/ Elastic Volume Service/ User Guide/ FAQ/ Capacity Expansion/ How Do I Extend the File System of an Unpartitioned Data Disk in Linux?

How Do I Extend the File System of an Unpartitioned Data Disk in Linux?

Updated on 2022-12-20 GMT+08:00

Scenarios

If no partition but only a file system is created on a data disk, extend the file system according to the following operations:

Run the lsblk command. Information similar to the following is displayed:

[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

In the command output, no partition but only a file system is created on data disk /dev/vdb.

In the following example, CentOS 7.4 64bit is used as the sample OS, data disk /dev/vdb has 10 GB, no partition but only a file system is created on the disk, and additional 50 GB has been added to this data disk on the management console. The following steps show how to extend this 50 GB to the file system.

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.

Extending the EXT* File System

  1. Run the following command to extend the file system:

    resize2fs Disk name

    In this example, run the following command:

    resize2fs /dev/vdb

    Information similar to the following is displayed:

    [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.

  2. Run the following command to view the result:

    df -TH

    Information similar to the following is displayed:

    [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

Extending the XFS File System

  1. Run the following command to extend the file system:

    xfs_growfs Disk name

    In this example, run the following command:

    xfs_growfs /dev/vdb

    Information similar to the following is displayed:

    [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.

  2. Run the following command to view the result:

    df -TH

    Information similar to the following is displayed:

    [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

Usamos cookies para aprimorar nosso site e sua experiência. Ao continuar a navegar em nosso site, você aceita nossa política de cookies. Saiba mais

Feedback

Feedback

Feedback

0/500

Selected Content

Submit selected content with the feedback