knowledge/docs/linux/阿里云centos磁盘扩容.md

48 lines
652 B
Markdown
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# 阿里云CentOS7磁盘扩容
## 场景
在阿里云控制台对主机云盘成功完成磁盘扩容操作。
## centos系统内操作
查看磁盘和分区
```bash
fdisk -l
```
结果有可能会看到有一个名为/dev/vda的磁盘同时有一个名为/dev/vda1的分区而且/dev/vda的磁盘容量已经是扩容后的容量了。
查看分区大小
```bash
df -h
```
结果可以看到分区大小还是扩容前的大小。
为分区扩容
```bash
growpart /dev/vda 1
```
语法
```sh
growpart [DeviceName] [PartionNumber]
```
扩容文件系统
```bash
resize2fs /dev/vda1
```
语法
```sh
resize2fs [PartitionName]
```