linux下xfs文件系统类型/目录扩容

广大2年前技术文章979


1、查看分区信息

[root@172-16-121-112 ~]# fdisk -l


Disk /dev/vda: 107.4 GB, 107374182400 bytes, 209715200 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 label type: dos

Disk identifier: 0x000a33e0


   Device Boot      Start         End      Blocks   Id  System

/dev/vda1   *        2048      411647      204800   83  Linux

/dev/vda2          411648   209715199   104651776   83  Linux


2、进行分区

[root@172-16-121-112 ~]# fdisk /dev/vda 

Welcome to fdisk (util-linux 2.23.2).


Changes will remain in memory only, until you decide to write them.

Be careful before using the write command.



Command (m for help): p


Disk /dev/vda: 107.4 GB, 107374182400 bytes, 209715200 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 label type: dos

Disk identifier: 0x000a33e0


   Device Boot      Start         End      Blocks   Id  System

/dev/vda1   *        2048      411647      204800   83  Linux

/dev/vda2          411648   209715199   104651776   83  Linux


Command (m for help): d

Partition number (1,2, default 2): 2

Partition 2 is deleted


Command (m for help): p


Disk /dev/vda: 107.4 GB, 107374182400 bytes, 209715200 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 label type: dos

Disk identifier: 0x000a33e0


   Device Boot      Start         End      Blocks   Id  System

/dev/vda1   *        2048      411647      204800   83  Linux


Command (m for help): n

Partition type:

   p   primary (1 primary, 0 extended, 3 free)

   e   extended

Select (default p): p

Partition number (2-4, default 2): 

First sector (411648-209715199, default 411648): 

Using default value 411648

Last sector, +sectors or +size{K,M,G} (411648-209715199, default 209715199): 

Using default value 209715199

Partition 2 of type Linux and of size 99.8 GiB is set


Command (m for help): w

The partition table has been altered!


Calling ioctl() to re-read partition table.


WARNING: Re-reading the partition table failed with error 16: Device or resource busy.

The kernel still uses the old table. The new table will be used at

the next reboot or after you run partprobe(8) or kpartx(8)

Syncing disks.


3、分区完成,使扩容生效

--进行查看文件系统类型

#df -TH

--重读分区表信息,fdisk分区可能不会立即生效,重读信息可以同步最新的设备信息

#partprobe 

--生效扩容的分区,在文件系统上显示。(xfs类型文件系统)

#xfs_growfs /dev/vda2 


4、查看扩容后目录生效:

[root@172-16-121-112 ~]# df -h

Filesystem      Size  Used Avail Use% Mounted on

devtmpfs        1.9G     0  1.9G   0% /dev

tmpfs           1.9G     0  1.9G   0% /dev/shm

tmpfs           1.9G   65M  1.8G   4% /run

tmpfs           1.9G     0  1.9G   0% /sys/fs/cgroup

/dev/vda2       100G  2.2G   98G   3% /

/dev/vda1       197M  120M   77M  61% /boot

tmpfs           379M     0  379M   0% /run/user/0


相关文章

Flink 运行架构简介

Flink 运行架构简介

一、Flink简介Apache Flink 是一个开源的分布式大数据处理引擎,可对有限数据流和无限数据流进行有状态计算。它具备强一致性的计算能力、大规模的扩展性,整体性能非常卓越,同时支持SQL、Ja...

Centos7 升级内核

1、查看当前内核版本$ uname -rsLinux 3.10.0-1160.45.1.el7.x86_642、安装 ELRepo# 载入公钥$ rpm --import https://www.el...

PG的统计信息(一)

一、统计信息1.1 PG统计信息概述pg的统计信息主要分为两种:第一类统计信息是是负载指标“统计信息”(Monitoring stats),通过stat collector进程进行实时采集更新的负载指...

ranger对接hbase 处理class not found

ranger对接hbase 处理class not found

hbase 2.1版本在配置ranger插件,重启hbase时,hmaster无法正常启动,日志显示meta region is in state OPENING此时查看regionserver 中日...

PG的多版本并发控制(一)

PG的多版本并发控制(一)

一、 表系统字段几个比较重要概念1.1  tupletuple表示表中的数据行,在MySQL中用row表示。在表数据页中,主要分为普通的数据元祖和TOAST元祖。以下是一个普通数据元祖的结构,主要由三...

Python 实现 Prometheus 自定义指标暴露

Python 实现 Prometheus 自定义指标暴露

虽然 Prometheus 已经拥有可直接使用的 exporter 可供使用,以满足收集不同的监控指标的需要。然而,如果我们需要收集一些自定义指标项,还是需要我们编写程序去暴露相关接口(/metric...

发表评论    

◎欢迎参与讨论,请在这里发表您的看法、交流您的观点。