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

广大9个月前技术文章406


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 中的状态1、由一个任务维护,并且用来计算某个结果的所有数据,都属于这个任务的状态 2、可以认为状态就是一个本地变量,可以被任务的业务逻辑访问 3、Flink 会进行状态管理,包括状...

image.png

VMware Vsphere创建虚拟机

一、上传系统镜像打开数据中心 2、新建文件夹,存放镜像3、点击上传文件按钮    4、找到本地镜像上传二、安装虚拟机1、创建虚拟机 2、选择创建类型 3、为虚拟机命名并选择虚拟机安装的所在位置4、选择...

Helm部署

Helm部署

1、helm介绍在没使用helm之前,向Kubernetes部署应用,需要依次部署deployment、svc等,步骤教繁琐,况且随着很多项目微服务化,复杂的应用在容器中部署以及管理显得较为复杂,he...

HDFS核心参数

HDFS核心参数

1.NameNode内存生产配置(1)NameNode内存计算,每个文件块大概占用150byte,一台服务器128G内存为例,能存储9.1亿个文件128 * 1024 * 1024 * 1024  /...

Kubernetes日志收集

Kubernetes日志收集

关于容器日志Docker的日志分为两类,一类是Docker引擎日志;另一类是容器日志。引擎日志一般都交给了系统日志,不同的操作系统会放在不同的位置。本文主要介绍容器日志,容器日志可以理解是运行在容器内...

prometheus黑盒监控

prometheus黑盒监控

黑盒监控即以用户的身份测试服务的外部可见性,常见的黑盒监控包括 HTTP探针、TCP探针、Dns、Icmp等用于检测站点、服务的可访问性、服务的连通性,以及访问效率等。prometheus提供了bla...

发表评论    

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