• ubuntu 18 VMWare 如何 命令行 扩展磁盘


    ubuntu 18 VMWare 如何 命令行 扩展磁盘

    ubuntu 18 ,边下载,边编译yocto,导致 硬盘 全满了.
    然后 关机之后, 设置 扩展磁盘到500G.
    重启虚拟机,进入不了图形界面
    在这里插入图片描述

    这个时候,需要等一下,然后输入 cltr + alt +f2 进入控制台界面.
    然后在命令行执行 重新分区命令.

    参考1

    VMware虚拟机下ubuntu磁盘扩容(亲测有效)
    https://blog.csdn.net/pzslongyutianxia/article/details/119840433

    参考2

    https://blog.csdn.net/weixin_46222091/article/details/124443257
    fdisk扩展分区

    root@cmp:/home/cmp/Downloads# fdisk /dev/sda

    Welcome to fdisk (util-linux 2.34).
    Changes will remain in memory only, until you decide to write them.
    Be careful before using the write command.

    Command (m for help): p
    Disk /dev/sda: 100 GiB, 107374182400 bytes, 209715200 sectors
    Disk model: VMware Virtual S
    Units: sectors of 1 * 512 = 512 bytes
    Sector size (logical/physical): 512 bytes / 512 bytes
    I/O size (minimum/optimal): 512 bytes / 512 bytes
    Disklabel type: gpt
    Disk identifier: 3EDB8DA1-4B24-4EB9-B3E6-60F47A913588

    Device Start End Sectors Size Type
    /dev/sda1 2048 4095 2048 1M BIOS boot
    /dev/sda2 4096 104855551 104851456 50G Linux filesystem
    /dev/sda3 104855552 209715166 104859615 50G Linux filesystem

    Command (m for help): d
    Partition number (1-3, default 3):

    Partition 3 has been deleted.

    Command (m for help): p
    Disk /dev/sda: 100 GiB, 107374182400 bytes, 209715200 sectors
    Disk model: VMware Virtual S
    Units: sectors of 1 * 512 = 512 bytes
    Sector size (logical/physical): 512 bytes / 512 bytes
    I/O size (minimum/optimal): 512 bytes / 512 bytes
    Disklabel type: gpt
    Disk identifier: 3EDB8DA1-4B24-4EB9-B3E6-60F47A913588

    Device Start End Sectors Size Type
    /dev/sda1 2048 4095 2048 1M BIOS boot
    /dev/sda2 4096 104855551 104851456 50G Linux filesystem

    Command (m for help): d
    Partition number (1,2, default 2):

    Partition 2 has been deleted.

    Command (m for help): p
    Disk /dev/sda: 100 GiB, 107374182400 bytes, 209715200 sectors
    Disk model: VMware Virtual S
    Units: sectors of 1 * 512 = 512 bytes
    Sector size (logical/physical): 512 bytes / 512 bytes
    I/O size (minimum/optimal): 512 bytes / 512 bytes
    Disklabel type: gpt
    Disk identifier: 3EDB8DA1-4B24-4EB9-B3E6-60F47A913588

    Device Start End Sectors Size Type
    /dev/sda1 2048 4095 2048 1M BIOS boot

    Command (m for help): n
    Partition number (2-128, default 2):
    First sector (4096-209715166, default 4096):
    Last sector, +/-sectors or +/-size{K,M,G,T,P} (4096-209715166, default 209715166):

    Created a new partition 2 of type ‘Linux filesystem’ and of size 100 GiB.
    Partition #2 contains a ext4 signature.

    Do you want to remove the signature? [Y]es/[N]o: Y

    The signature will be removed by a write command.

    Command (m for help): p
    Disk /dev/sda: 100 GiB, 107374182400 bytes, 209715200 sectors
    Disk model: VMware Virtual S
    Units: sectors of 1 * 512 = 512 bytes
    Sector size (logical/physical): 512 bytes / 512 bytes
    I/O size (minimum/optimal): 512 bytes / 512 bytes
    Disklabel type: gpt
    Disk identifier: 3EDB8DA1-4B24-4EB9-B3E6-60F47A913588

    Device Start End Sectors Size Type
    /dev/sda1 2048 4095 2048 1M BIOS boot
    /dev/sda2 4096 209715166 209711071 100G Linux filesystem

    Filesystem/RAID signature on partition 2 will be wiped.

    Command (m for help): w
    The partition table has been altered.
    Syncing disks.

    resize2fs更新分区

    sudo resize2fs /dev/sda1

  • 相关阅读:
    DOM系列之动画函数封装
    【前端技巧】css篇
    c++ 之 socket udp与tcp client server实现
    怎么保护公司文件安全
    【设计模式】Java设计模式 - 命令模式
    Redis分布式锁
    html静态网页设计制作 HTML我的家乡沧州网页代码 dw静态网页成品模板素材网页 web前端网页设计与制作 div静态网页设计
    Scrum 实施过程的主要内容及5大常用工具
    windows提权
    去中心化数字身份为什么在元宇宙中这么重要
  • 原文地址:https://blog.csdn.net/wowocpp/article/details/126490093