1. 创建新分区

[root@localhost ~]# fdisk -l

Disk /dev/sda: 32.2 GB,  bytes,  sectors
Units = sectors of * = bytes
Sector size (logical/physical): bytes / bytes
I/O size (minimum/optimal): bytes / bytes
Disk label type: dos
Disk identifier: 0x000a8293 Device Boot Start End Blocks Id System
/dev/sda1 * Linux
/dev/sda2 8e Linux LVM Disk /dev/mapper/cl-root: MB, bytes, sectors
Units = sectors of * = bytes
Sector size (logical/physical): bytes / bytes
I/O size (minimum/optimal): bytes / bytes Disk /dev/mapper/cl-swap: MB, bytes, sectors
Units = sectors of * = bytes
Sector size (logical/physical): bytes / bytes
I/O size (minimum/optimal): bytes / bytes [root@localhost ~]# fdisk /dev/sda
Welcome to fdisk (util-linux 2.23.). Changes will remain in memory only, until you decide to write them.
Be careful before using the write command. Command (m for help): n
Partition type:
p primary ( primary, extended, free)
e extended
Select (default p): p
Partition number (,, default ):
First sector (-, default ):
Using default value
Last sector, +sectors or +size{K,M,G} (-, default ): +2G
Partition of type Linux and of size GiB is set Command (m for help): p Disk /dev/sda: 32.2 GB, bytes, sectors
Units = sectors of * = bytes
Sector size (logical/physical): bytes / bytes
I/O size (minimum/optimal): bytes / bytes
Disk label type: dos
Disk identifier: 0x000a8293 Device Boot Start End Blocks Id System
/dev/sda1 * Linux
/dev/sda2 8e Linux LVM
/dev/sda3 Linux Command (m for help): t   # 修改文件系统类型
Partition number (-, default ):
Hex code (type L to list all codes): 8e
Changed type of partition 'Linux' to 'Linux LVM' Command (m for help): p Disk /dev/sda: 32.2 GB, bytes, sectors
Units = sectors of * = bytes
Sector size (logical/physical): bytes / bytes
I/O size (minimum/optimal): bytes / bytes
Disk label type: dos
Disk identifier: 0x000a8293 Device Boot Start End Blocks Id System
/dev/sda1 * Linux
/dev/sda2 8e Linux LVM
/dev/sda3 8e Linux LVM Command (m for help): w
The partition table has been altered!

2. partprobe

[root@localhost named]# partprobe

3. 创建 pv

[root@localhost ~]# pvcreate /dev/sda3
Physical volume "/dev/sda3" successfully created.
[root@localhost ~]# pvdisplay   
--- Physical volume ---
PV Name /dev/sda2
VG Name cl
PV Size 9.80 GiB / not usable 3.00 MiB
Allocatable yes (but full)
PE Size 4.00 MiB
Total PE
Free PE
Allocated PE
PV UUID vBCY0m-syaR-HKNJ-FNlW-G7Ql-2eru-4ccPC6 "/dev/sda3" is a new physical volume of "2.00 GiB"
--- NEW Physical volume ---
PV Name /dev/sda3
VG Name
PV Size 2.00 GiB
Allocatable NO
PE Size
Total PE
Free PE
Allocated PE
PV UUID kRvof2-gzMz-raeu-njD7-vujG-N45B-yJemBd

4. 将 pv 添加到 vg

[root@localhost ~]# vgextend cl /dev/sda3
Volume group "cl" successfully extended
[root@localhost ~]# vgs
VG #PV #LV #SN Attr VSize VFree
cl wz--n- .80g .00g
[root@localhost ~]# pvs
PV VG Fmt Attr PSize PFree
/dev/sda2 cl lvm2 a-- .80g
/dev/sda3 cl lvm2 a-- .00g .00g

5. 扩展 lv

[root@localhost ~]# lvextend /dev/cl/root /dev/sda3
Size of logical volume cl/root changed from 7.80 GiB ( extents) to 9.80 GiB ( extents).
Logical volume cl/root successfully resized.

6. 扩展文件系统的逻辑边界

[root@localhost ~]# xfs_growfs /dev/cl/root
meta-data=/dev/mapper/cl-root isize= agcount=, agsize= blks
= sectsz= attr=, projid32bit=
= crc= finobt= spinodes=
data = bsize= blocks=, imaxpct=
= sunit= swidth= blks
naming =version bsize= ascii-ci= ftype=
log =internal bsize= blocks=, version=
= sectsz= sunit= blks, lazy-count=
realtime =none extsz= blocks=, rtextents=
data blocks changed from to
[root@localhost ~]# df -h
Filesystem Size Used Avail Use% Mounted on
/dev/mapper/cl-root .8G 1021M .8G % /
devtmpfs .9G .9G % /dev
tmpfs .9G .9G % /dev/shm
tmpfs .9G 8.6M .9G % /run
tmpfs .9G .9G % /sys/fs/cgroup
/dev/sda1 197M 117M 81M % /boot
tmpfs 378M 378M % /run/user/
[root@localhost ~]#

linux 扩展文件系统的更多相关文章

  1. 如何扩展Linux虚拟内存文件系统

    由于ArcGIS GeoAnalystics Server和Raster Analytics Server大数据分析平台都是基于Spark分析平台的,其部署服务器除了要求具有高内存特点外,也需要确保相 ...

  2. chattr - 修改文件在Linux第二扩展文件系统(E2fs)上的特有属性

    SYNOPSIS(总览) chattr [ -RV ] [ -v version ] [ mode ] files... DESCRIPTION(描述) chattr 修改文件在Linux第二扩展文件 ...

  3. lsattr - 显示文件在Linux第二扩展文件系统上的特有属性

    SYNOPSIS(总览) lsattr [ -RVadv ] [ files... ] DESCRIPTION(描述) lsattr 显示文件在Linux第二扩展文件系统上的特有属性 OPTIONS( ...

  4. Linux及文件系统基本介绍

    Linux及文件系统基本介绍 1   互联网行业现状 在服务器端市场: 超级计算机 2014年11月的数据显示前500系统中的485个系统都在运行着 Linux 的发布系统,而仅仅只有一台运行着 Wi ...

  5. linux ext2 文件系统学习

    Linux  ext2文件系统理解 硬盘组成: 硬盘由多个圆形硬盘片组成.按照硬盘片能够容纳的数据量分为单盘和多盘.硬盘的数据读取主要靠机械手臂上的磁头,在机械手臂上有多个磁头.机械手臂不动硬盘旋转一 ...

  6. linux下文件系统类型的学习

    1. 以超级用户权限登陆Linux,进入  /lib/modules/2.6.32--504.el6.x86_64/kernel/fs目录执行 ls 命令(不同Linux发行版本的Fs目录有些不同你可 ...

  7. linux的文件系统及节点表

    linux的文件系统及节点表 一  linux的文件系统1 我们都知道当我们安装linux时会首先给系统分区,然后我们会把分区格式化成EXT3格式的文件系统.那么在linux系统中还有没有其他的文件系 ...

  8. linux分区,文件系统,目录结构概述

    1.Linux中如何表示硬盘,分区 Linux内核读取光驱,硬盘等资源时均通过“设备文件”的形式进行,因此在linux系统中,将硬 盘和分区表示为不同的文件.具体表述形式如下: 硬盘:对于IDE接口的 ...

  9. 比起Windows,怎样解读Linux的文件系统与目录结构?

    比起Windows,怎样解读Linux的文件系统与目录结构? Linux 和Windows的文件系统有些不同,在学习使用 Linux 之前,若能够了解这些不同,会有助于后续学习. 本文先对Window ...

随机推荐

  1. 数据仓库中的Inmon与Kimball架构

    对于数据仓库体系结构的最佳问题,始终存在许多不同的看法,甚至有人把Inmon和Kimball之争称之为数据仓库界的“宗教战争”,那么本文就通过对两位提倡的数据仓库体系和市场流行的另一种体系做简单描述和 ...

  2. 输入、输出与Mad Libs 游戏。

    name1=input('请输入一个名字:') name2=input('再输入一个名字:') time1=input('请输入一段时间:') print('{},是傻子,{},{}吃不了鸡'.for ...

  3. laravel整合vue 多入口解决

    2018年8月10日23:10:29 其实整合是挺简单,因为laravel本身就准备的挺好了 laravel 版本5.6   注意php cli是web是不一样的 这个需要设置环境变量 ,php需要7 ...

  4. ASP.NET Core 问题排查:Request.EnableRewind 后第一次读取不到 Request.Body

    实际应用场景是将用户上传的文件依次保存到阿里云 OSS 与腾讯云 COS ,实现方式是在启用 Request.EnableRewind() 的情况下通过 Request.Body 读取流,并依次通过 ...

  5. Html转义字符列表

    Symbol Code Entity Name ™ ™   €   € Space   ! !   " " " # #   $ $   % %   & & ...

  6. StarUML[3.1.0]官方安装破解版[app.asar]

    StarUml 3.1.0 自注册破解版 安装完毕在注册界面随便输入一个 License 即可. 安装包方式可以选择从官方下,如果下载过慢,也可以选择分享包中的原版安装文件: 不放心的可以去校验MD5 ...

  7. sizeof操作符的一些例子

    例一: #include <iostream> using namespace std; class A { public: char c; }; class B { public: in ...

  8. 天梯赛练习题L2-006. 树的遍历

    题目链接 已知一棵树的后序遍历顺序和中序遍历顺序,求层次遍历的顺序: 树的四种遍历: 先序遍历:先访问根节点,再访问左子树,最后访问右子树 中序遍历:先访问左子树,再访问根节点,最后访问右子树 后序遍 ...

  9. vue中用ajax上传文件

    直接上代码 <input class="file-btn" type="file" @change="uploadCompany($event) ...

  10. 初学node.js,安装nodemon,学习debug模式,安装cpu-stat

    1.运行node  文件     node .\01.js      文件内容   console.log('aaaa'); 2.因为每次更新文件都需要重新,所以安装nodemon    npm i ...