---
title: "CenOS扩容跟磁盘"
author: "tomhat"
date: "2020-09-21T18:54:20Z"
tags: []
categories: ["操作系统"]
slug: "cenos"
draft: false
lastmod: "2020-09-21T18:54:20Z"
id: 2516871
url: "https://tomhat.iteye.com/blog/2516871"
---

一、使用背景
Linux根目录磁盘空间不够用了，当修改了虚拟机模版增加磁盘大小或者插入了一块新硬盘，但是发现系统里的大小还是没改变。
产生的原因是没有给磁盘格式化，没有增加分区。

二、操作方法
查看磁盘空间大小，使用df -h 命令

增加磁盘空间，例如下图使用VM虚拟机增加的方式。
![](https://images.gitee.com/uploads/images/2020/0102/192017_0011a150_132614.png)

具体操作请查看<https://gitee.com/tomhat/sources/blob/master/Linux/CentOS/%E6%89%A9%E5%AE%B9%E8%B7%9F%E7%A3%81%E7%9B%98.md>