当前位置: 首页 > article >正文

扩充vmware磁盘大小以及分区

扩充vmware磁盘大小以及分区

扩充vmware磁盘大小

分区

目前使用vmware版本为17.5.2

gparted

fdisk

cxq@ubuntu:~$ sudo fdisk -l
Disk /dev/loop0: 219 MiB, 229638144 bytes, 448512 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 /dev/loop1: 55.45 MiB, 58130432 bytes, 113536 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 /dev/loop2: 65.1 MiB, 68259840 bytes, 133320 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 /dev/loop3: 50.98 MiB, 53432320 bytes, 104360 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 /dev/loop5: 55.37 MiB, 58052608 bytes, 113384 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 /dev/loop6: 44.3 MiB, 46448640 bytes, 90720 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 /dev/loop7: 4 KiB, 4096 bytes, 8 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 /dev/sda: 40 GiB, 42949672960 bytes, 83886080 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: dos
Disk identifier: 0x6b58acd8

Device     Boot   Start      End  Sectors  Size Id Type
/dev/sda1  *       2048  1050623  1048576  512M  b W95 FAT32
/dev/sda2       1052670 41940991 40888322 19.5G  5 Extended
/dev/sda5       1052672 41940991 40888320 19.5G 83 Linux


Disk /dev/loop8: 218.4 MiB, 228999168 bytes, 447264 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 /dev/loop9: 91.7 MiB, 96141312 bytes, 187776 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

在这里插入图片描述

查看当前分区

cxq@ubuntu:~$ ls /dev/sd* 
/dev/sda  /dev/sda1  /dev/sda2  /dev/sda5

在这里插入图片描述

通过gparted软件将扩展的20G分了7.32G给/dev/sda3

在这里插入图片描述

通过ls /dev/sd* 可以发现多了刚刚分配的 /dev/sda3

cxq@ubuntu:~$ ls /dev/sd* 
/dev/sda  /dev/sda1  /dev/sda2  /dev/sda3  /dev/sda5

fdisk 将能够打开 /dev/sda3 并允许用户进行分区操作

cxq@ubuntu:~$ sudo fdisk /dev/sda3  
[sudo] password for cxq: 

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.

The old ext4 signature will be removed by a write command.

Device does not contain a recognized partition table.
Created a new DOS disklabel with disk identifier 0x0021fe8e.

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
   n   add a new partition
   p   print the partition table
   t   change a partition type
   v   verify the partition table
   i   print information about a partition

  Misc
   m   print this menu
   u   change display/entry units
   x   extra functionality (experts only)

  Script
   I   load disk layout from sfdisk script file
   O   dump disk layout to sfdisk script file

  Save & Exit
   w   write table to disk and exit
   q   quit without saving changes

  Create a new label
   g   create a new empty GPT partition table
   G   create a new empty SGI (IRIX) partition table
   o   create a new empty DOS partition table
   s   create a new empty Sun partition table

Command (m for help): n
Partition type
   p   primary (0 primary, 0 extended, 4 free)
   e   extended (container for logical partitions)
Select (default p): p
Partition number (1-4, default 1): 1
First sector (2048-15351807, default 2048): 2048
Last sector, +/-sectors or +/-size{K,M,G,T,P} (2048-15351807, default 15351807): +5G

Created a new partition 1 of type 'Linux' and of size 5 GiB.

Command (m for help): p

Disk /dev/sda3: 7.33 GiB, 7860125696 bytes, 15351808 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
Disklabel type: dos
Disk identifier: 0x0021fe8e

Device      Boot Start      End  Sectors Size Id Type
/dev/sda3p1       2048 10487807 10485760   5G 83 Linux

在这里插入图片描述

此时

partprobe 刷新

root@ubuntu:/home/cxq# ll /dev/sd*
brw-rw---- 1 root disk 8, 0 Jan  1 07:12 /dev/sda
brw-rw---- 1 root disk 8, 1 Jan  1 07:12 /dev/sda1
brw-rw---- 1 root disk 8, 2 Jan  1 07:12 /dev/sda2
brw-rw---- 1 root disk 8, 3 Jan  1 07:12 /dev/sda3
brw-rw---- 1 root disk 8, 5 Jan  1 07:12 /dev/sda5
root@ubuntu:/home/cxq# partprobe /dev/sda3 

将/dev/sda3 挂载到根目录上

root@ubuntu:/home/cxq# mount /dev/sda3   / 

用于显示文件系统的磁盘空间使用情况

cxq@ubuntu:~$ df -h 
Filesystem      Size  Used Avail Use% Mounted on
udev            1.9G     0  1.9G   0% /dev
tmpfs           388M  1.8M  386M   1% /run
/dev/sda5        20G  6.9G   12G  38% /
tmpfs           1.9G     0  1.9G   0% /dev/shm
tmpfs           5.0M  4.0K  5.0M   1% /run/lock
tmpfs           1.9G     0  1.9G   0% /sys/fs/cgroup
/dev/loop0      128K  128K     0 100% /snap/bare/5
/dev/loop1       56M   56M     0 100% /snap/core18/2128
/dev/loop2      219M  219M     0 100% /snap/gnome-3-34-1804/93
/dev/loop3       56M   56M     0 100% /snap/core18/2846
/dev/loop4      219M  219M     0 100% /snap/gnome-3-34-1804/72
/dev/loop5       66M   66M     0 100% /snap/gtk-common-themes/1515
/dev/loop6       92M   92M     0 100% /snap/gtk-common-themes/1535
/dev/loop7       51M   51M     0 100% /snap/snap-store/547
/dev/loop8       45M   45M     0 100% /snap/snapd/23258
/dev/sda1       511M  4.0K  511M   1% /boot/efi
tmpfs           388M   20K  388M   1% /run/user/1000


http://www.kler.cn/a/463149.html

相关文章:

  • 启航数据结构算法之雅舟,悠游C++智慧之旅——线性艺术:顺序表之细腻探索
  • 分析服务器 systemctl 启动gozero项目报错的解决方案
  • 【开源项目】数字孪生立交~东湖高新区互通式立交数字孪生可视化项目——开源工程及源码
  • 树莓派 Pico RP2040 教程点灯 双核编程案例
  • 单元测试3.0+ @RunWith(JMockit.class)+mock+injectable+Expectations
  • 【可实战】需求分析-测试计划↓-测试设计-测试执行-测试总结↓(包含测试计划、测试总结模板,以公司要求为准)
  • 细讲前端工程化
  • 使用SDL2搭建简易LVGL模拟器
  • 香港 GPU 服务器托管引领 AI 创新,助力 AI 发展
  • Ubuntu 上高效实现 Texlive 安装和管理
  • 关于flinkCDC监控mysql binlog时,datetime类型自动转换成时间戳类型问题
  • Kali 自动化换源脚本编写与使用
  • Mac M2 Pro安装MySQL 8.4.3
  • Django中创建自定义命令发送钉钉通知
  • ARM架构服务器安装部署KVM虚拟化环境
  • LLaMA 2开放基础和微调聊天模型
  • 自定义luacheck校验规则
  • spring boot通过文件配置yaml里面的属性
  • 从数据映射到文件生成:一个R语言实践案例
  • 自己电脑搭建个人知识库,一般电脑也能玩(支持通义千问、GPT等)。
  • VSCode 插件开发实战(十六):详解插件生命周期
  • selenium(三)
  • Midjourney技术浅析(三):文本编码
  • .NET | 详解通过Win32函数实现本地提权
  • 计算机网络—————考研复试
  • WOFOST作物模型(2.1):模型参数介绍