zoukankan      html  css  js  c++  java
  • 阿里云在线扩容

    1、下载阿里扩展工具

    yum install -y cloud-utils-growpart
    2、查看现有硬盘大小
    fdisk -l 可以看到最上面的是 200GB
    [root@root /]# fdisk -l
    
    Disk /dev/vda: 200 GB, 200018364800 bytes, 402430400 sectors
    Units = sectors of 1 * 512 = 512 bytes
    Sector size (logical/physical): 512 bytes / 512 bytes
    I/O size (minimum/optimal): 512 bytes / 512 bytes
    Disk label type: dos
    Disk identifier: 0x0008d73a
    
       Device Boot      Start         End      Blocks   Id  System
    /dev/vda1   *        2048   419428351   209713152   83  Linux
    

      3、实际上用df -lh 查看的是 100GB

    [root@root /]# df -h
    Filesystem                       Size  Used Avail Use% Mounted on
    devtmpfs                         7.8G     0  7.8G   0% /dev
    tmpfs                            7.8G     0  7.8G   0% /dev/shm
    tmpfs                            7.8G  1.5M  7.8G   1% /run
    tmpfs                            7.8G     0  7.8G   0% /sys/fs/cgroup
    /dev/vda1                        100G   95G    5G  95% /
    tmpfs                            1.6G     0  1.6G   0% /run/user/0
    

      4、使用

    运行 growpart <DeviceName> <PartionNumber> 命令,调用 growpart 为需要扩容的云盘和对应的第几个分区扩容。

    growpart /dev/vda 1 ,表示为系统盘的第一个分区(/dev/vda1)扩容。

    [root@root /]# growpart /dev/vda 1
    CHANGED: partition=1 start=2048 old: size=104855519 end=104857567 new: size=402230400 end=402430400
    

      5、重设分区大小

    [root@root /]# resize2fs /dev/vda1
    resize2fs 1.42.9 (28-Dec-2013)
    Filesystem at /dev/vda1 is mounted on /; on-line resizing required
    old_desc_blocks = 3, new_desc_blocks = 4
    The filesystem on /dev/vda1 is now 13106939 blocks long.
    

      6、打完收工

  • 相关阅读:
    第一次个人编程作业
    第一次博客作业
    动态规划 01背包学习中
    学习dijk最短路径中
    蓝桥杯 小盆友排队
    蓝桥杯 地宫取宝
    简单的BFS学习笔记
    C趣味100道之58.拉丁方的一些想法。
    蓝桥杯 错误票据--!偶然间发现,然后呵呵!
    函数实现计算标准差
  • 原文地址:https://www.cnblogs.com/bfyang5130/p/13231690.html
Copyright © 2011-2022 走看看