• 亚马逊EC2根硬盘空间扩容


    买的系统盘为32G,结果发现只使用了8G,剩下的都未分配

    lsblk 
    NAME    MAJ:MIN RM  SIZE RO TYPE MOUNTPOINT
    xvda    202:0    0   32G  0 disk 
    └─xvda1 202:1    0    8G  0 part /
    
    fdisk -u /dev/xvda
    Command (m for help): p
    
    Disk /dev/xvda: 34.4 GB, 34359738368 bytes, 67108864 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: 0x000998ac
    
        Device Boot      Start         End      Blocks   Id  System
    /dev/xvda1   *        2048    16777215     8387584   83  Linux
    
    Command (m for help): d
    Selected partition 1
    Partition 1 is deleted
    
    Command (m for help): n
    Partition type:
       p   primary (0 primary, 0 extended, 4 free)
       e   extended
    Select (default p): p
    Partition number (1-4, default 1): 1
    First sector (2048-67108863, default 2048): 
    Using default value 2048
    Last sector, +sectors or +size{K,M,G} (2048-67108863, default 67108863): 
    Using default value 67108863
    Partition 1 of type Linux and of size 32 GiB is set
    
    Command (m for help): p
    
    Disk /dev/xvda: 34.4 GB, 34359738368 bytes, 67108864 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: 0x000998ac
    
        Device Boot      Start         End      Blocks   Id  System
    /dev/xvda1            2048    67108863    33553408   83  Linux
    Command (m for help): w
    The partition table has been altered!
    
    reboot
    
    
    lsblk 
    NAME    MAJ:MIN RM  SIZE RO TYPE MOUNTPOINT
    xvda    202:0    0   32G  0 disk 
    └─xvda1 202:1    0   32G  0 part /
    
    df -h
    Filesystem      Size  Used Avail Use% Mounted on
    /dev/xvda1      8.0G  1.3G  6.8G  16% /
    
    ext格式调整大小
    resize2fs /dev/xvda1
    xfs格式调整大小
    xfs_growfs /dev/xvda1
    
    
    df -h
    Filesystem      Size  Used Avail Use% Mounted on
    /dev/xvda1       32G  1.3G   31G   4% /

    到此扩容完毕

  • 相关阅读:
    python的模块future用法实例解析
    strcmp函数和memcmp函数的用法区别及联系
    esp8266 smartconfig-智能配网分析和使用及注意事项
    ubuntu 18.04 安装并配置adb
    Markdown的常用方法总结
    mac下使用minicom几个注意事项
    最强Linux shell工具Oh My Zsh 指南
    ESP8266源码分析--打印的基本用法
    atom 在Ubuntu 18.04 上安装及基本使用
    ubuntu 查看端口被占用并删除端口
  • 原文地址:https://www.cnblogs.com/cainiaoit/p/8708918.html
Copyright © 2020-2023  润新知