Vmware Linux磁盘空间扩容(超简单)

您所在的位置:网站首页 虚拟机nas硬盘扩容教程视频 Vmware Linux磁盘空间扩容(超简单)

Vmware Linux磁盘空间扩容(超简单)

2024-07-16 12:39:29| 来源: 网络整理| 查看: 265

目录

VMware虚拟机中配置Linux中设置

 

引言

在配置大数据节点的过程中,node03节点由于安装了图形化界面,以及IDEA等工具,导致/根分区只有几百兆了,因此需要对根分区进行扩容,本文是在参考如下博文(https://www.jianshu.com/p/9db2df60fd0a)的基础上完成的,感谢被引用的博主,这里也记录一下。

VMware虚拟机中配置

(1)进入虚拟机设置界面,选择扩展磁盘容量。

在这里插入图片描述

(2) 本次是在原来30G的基础上扩展为50G。

在这里插入图片描述

(3)成功后发现提示,必须从客户机操作系统内部对磁盘重新进行分区和扩展文件系统,因此需要进入linux系统继续进行配置,这里配置是不会生效的。

在这里插入图片描述

Linux中设置

进入Linux系统,使用命令fdisk -l查看,发现实际大小为50G,但是系统已挂载的加起来是修改之前的30G。

在这里插入图片描述

(1) 可以看出sda3是根分区,下面按照博客提示,先删除sda3根分区,然后重新创建sda3根分区,具体参考注释。

1 [root@node03 ~]# fdisk /dev/sda 2 Welcome to fdisk (util-linux 2.23.2). 3 4 Changes will remain in memory only, until you decide to write them. 5 Be careful before using the write command. 6 7 8 Command (m for help): m 9 Command action 10 a toggle a bootable flag 11 b edit bsd disklabel 12 c toggle the dos compatibility flag 13 d delete a partition 14 g create a new empty GPT partition table 15 G create an IRIX (SGI) partition table 16 l list known partition types 17 m print this menu 18 n add a new partition 19 o create a new empty DOS partition table 20 p print the partition table 21 q quit without saving changes 22 s create a new empty Sun disklabel 23 t change a partition's system id 24 u change display/entry units 25 v verify the partition table 26 w write table to disk and exit 27 x extra functionality (experts only) 28 29 Command (m for help): d ##删除分区 30 Partition number (1-3, default 3): 3 ##临时先删除sda3分区 31 Partition 3 is deleted 32 33 Command (m for help): n #添加一个新的分区 34 Partition type: 35 p primary (2 primary, 0 extended, 2 free) 36 e extended 37 Select (default p): p #添加主分区 38 Partition number (3,4, default 3): 3 #指定分区号3,重新创建sda3分区 39 First sector (17303552-104857599, default 17303552): #回车 40 Using default value 17303552 41 Last sector, +sectors or +size{K,M,G} (17303552-104857599, default 104857599): #回车 42 Using default value 104857599 43 Partition 3 of type Linux and of size 41.8 GiB is set #提示OK 44 45 Command (m for help): w #按w保存退出 46 The partition table has been altered! #提示OK

(2)重启系统

重启当前系统,可以选择systemctl reboot或者init 6来执行。

(3)扩容文件系统,使用命令 xfs_growfs /dev/sda3,可以看到成功扩展分区,根分区已扩容20G。

1 [root@node03 ~]# xfs_growfs /dev/sda3 2 meta-data=/dev/sda3 isize=512 agcount=8, agsize=769984 blks 3 = sectsz=512 attr=2, projid32bit=1 4 = crc=1 finobt=0 spinodes=0 5 data = bsize=4096 blocks=5701376, imaxpct=25 6 = sunit=0 swidth=0 blks 7 naming =version 2 bsize=4096 ascii-ci=0 ftype=1 8 log =internal bsize=4096 blocks=2560, version=2 9 = sectsz=512 sunit=0 blks, lazy-count=1 10 realtime =none extsz=4096 blocks=0, rtextents=0 11 data blocks changed from 5701376 to 10944256 12 [root@node03 ~]# df -h 13 Filesystem Size Used Avail Use% Mounted on 14 /dev/sda3 42G 11G 32G 25% / 15 devtmpfs 2.9G 0 2.9G 0% /dev 16 tmpfs 3.0G 0 3.0G 0% /dev/shm 17 tmpfs 3.0G 13M 2.9G 1% /run 18 tmpfs 3.0G 0 3.0G 0% /sys/fs/cgroup 19 /dev/sda1 253M 153M 101M 61% /boot 20 tmpfs 595M 8.0K 595M 1% /run/user/990 21 tmpfs 595M 0 595M 0% /run/user/0 22 You have new mail in /var/spool/mail/root

扩容结果展示。

在这里插入图片描述

以上为参考博文执行的结果,且当前执行成功的系统为Centos7.6,根分区文件类型为xfs,并且系统不是LVM分区,可作为参考。 

 

参考博文:

(1)

https://www.cnblogs.com/youngchaolin/p/11478740.html


【本文地址】

公司简介

联系我们

今日新闻


点击排行

实验室常用的仪器、试剂和
说到实验室常用到的东西,主要就分为仪器、试剂和耗
不用再找了,全球10大实验
01、赛默飞世尔科技(热电)Thermo Fisher Scientif
三代水柜的量产巅峰T-72坦
作者:寞寒最近,西边闹腾挺大,本来小寞以为忙完这
通风柜跟实验室通风系统有
说到通风柜跟实验室通风,不少人都纠结二者到底是不
集消毒杀菌、烘干收纳为一
厨房是家里细菌较多的地方,潮湿的环境、没有完全密
实验室设备之全钢实验台如
全钢实验台是实验室家具中较为重要的家具之一,很多

推荐新闻


图片新闻

实验室药品柜的特性有哪些
实验室药品柜是实验室家具的重要组成部分之一,主要
小学科学实验中有哪些教学
计算机 计算器 一般 打孔器 打气筒 仪器车 显微镜
实验室各种仪器原理动图讲
1.紫外分光光谱UV分析原理:吸收紫外光能量,引起分
高中化学常见仪器及实验装
1、可加热仪器:2、计量仪器:(1)仪器A的名称:量
微生物操作主要设备和器具
今天盘点一下微生物操作主要设备和器具,别嫌我啰嗦
浅谈通风柜使用基本常识
 众所周知,通风柜功能中最主要的就是排气功能。在

专题文章

    CopyRight 2018-2019 实验室设备网 版权所有 win10的实时保护怎么永久关闭