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

广大2年前技术文章902


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


相关文章

MySQL运维实战(1.1)安装部署:使用RPM进行安装部署

MySQL运维实战(1.1)安装部署:使用RPM进行安装部署

我们在生产环境部署mysql时,一般很少使用rpm。用rpm或或者其他包管理器安装mysql,好处是安装简单,而且很多系统可能都自带了某个版本的mysql。但是使用RPM安装也存在一些缺点:1、rpm...

MySQL启动优化

MySQL启动优化

安装后优化1.1 数据库启动问题因为是我们自己配置的参数文件所以启动时需要进行参数文件指定,但是很显然这样会很麻烦,所以我们把它加入到systemctl启动的服务中具体操作如下:[root@mysql...

ES运维(六)_segment合并使用原理及场景

ES运维(六)_segment合并使用原理及场景

一、背景简介ES中,每个index(索引)都包含若干个Shard(分片),每个分片底层又是一个个Segment文件(段),每次数据的读写底层就是与一个个段文件的交互,因此ES调优常用的一块就是对段文件...

MySQL运维实战之ProxySQL(9.10)proxysql监控

MySQL运维实战之ProxySQL(9.10)proxysql监控

stats数据库从stats数据库中可以查到proxysql一些内部组件的状态,如内存使用情况、连接池信息、会话信息、SQL执行状态等。mysql> show tables&...

MySQL性能优化(六)优化or条件

MySQL性能优化(六)优化or条件

优化器是数据库中非常核心,又非常复杂的一个组件。有的SQL,优化器选择的执行计划并不是最优的,通过改写SQL,可以帮助优化器找到最优的执行计划。where条件中的or子句,是比较容易出问题的一个场景。...

TCP短连接和长连接

TCP短连接和长连接

     当网络通信时采用TCP协议时,在真正的读写操作之前,server与client之间必须建立一个连接,当读写操作完成后,双方不再需要这个连接时它们可以释放这个连接,连接的建立是需要三次握手的,...

发表评论    

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