2个方法:虚拟机VMware容量扩展,无vg分组的linux无损磁盘扩容

目的是:将虚拟机的容量从20G扩大到25G

编辑虚拟机设置 :

在这里插入图片描述
硬盘 - 扩展磁盘容量 :
在这里插入图片描述
填入扩容后大小:
在这里插入图片描述

以下在ubuntu/linux里操作:

查看当前分区情况:

biren@ubuntu:~$ df -Th
Filesystem     Type      Size  Used Avail Use% Mounted on
udev           devtmpfs  955M     0  955M   0% /dev
tmpfs          tmpfs     196M  1.8M  195M   1% /run
/dev/sda1      ext4       20G   19G  498M  98% /      只剩下542M空间,ext4格式
tmpfs          tmpfs     980M     0  980M   0% /dev/shm
tmpfs          tmpfs     5.0M  4.0K  5.0M   1% /run/lock
tmpfs          tmpfs     980M     0  980M   0% /sys/fs/cgroup
/dev/loop0     squashfs  768K  768K     0 100% /snap/gnome-characters/741
......
biren@ubuntu:~/crossbuild$ sudo fdisk -l

Disk /dev/sda: 25 GiB, 26843545600 bytes, 52428800 sectors  共25G空间
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: dos
Disk identifier: 0x305e1b1e

Device     Boot Start      End  Sectors Size Id Type
/dev/sda1  *     2048 41940991 41938944  20G 83 Linux    第一块磁盘的第一分区
其它略...

可以看到/dev/sda共25G,实际使用的还是20G(/dev/sda1)

新增分区:

命令: sudo fdisk /dev/sda

biren@ubuntu:~/crossbuild$ sudo fdisk /dev/sda
[sudo] password for biren: 

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

Command (m for help): m      查看帮助

Help:
  DOS (MBR)
   a   toggle a bootable flag  设置启动标记
   b   edit nested BSD disklabel
   c   toggle the dos compatibility flag

  Generic
   d   delete a partition    删除分区
   F   list free unpartitioned space
   l   list known partition types  列出分区类型,如 83/8e
   n   add a new partition           增加分区
   p   print the partition table
   t   change a partition type      改变分区类型, 83为linux, 8e为lvm, 82为swap交换分区, 6为fat16, 7为nfs
   v   verify the partition table
评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

知行电子

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值