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. js之promise讲解

    1 Promise概述 Promise对象是CommonJS工作组提出的一种规范,目的是为异步操作提供统一接口. 那么,什么是Promises? 首先,它是一个对象,也就是说与其他JavaScript ...

  2. Java_泛型

    转自博客HappyCorn https://www.cnblogs.com/lwbqqyumidi/p/3837629.html 什么是泛型? 泛型,即“参数化类型”.一提到参数,最熟悉的就是定义方法 ...

  3. jQuery (01) 浏览器的事件模型

    浏览器的事件模型 由网景公司引入的 DOM0 级事件模型 把事件处理程序绑定到 DOM 元素的属性上: ele.onclick(); ele.onDOMContentLoad(); ele.onloa ...

  4. php的imagick模块扩展

    imagick模块介绍       ImageMagick是一个用于查看.编辑位图文件以及进行图像格式转换的开放源代码软件套装.它可以读取.编辑超过100种图象格式,可用来替换GD库. 安装 在加载模 ...

  5. [LeetCode] Flatten a Multilevel Doubly Linked List 压平一个多层的双向链表

    You are given a doubly linked list which in addition to the next and previous pointers, it could hav ...

  6. JavaScript继承的几种模式

    原型链 让一个类的原型对象指向另一个类的实例

  7. Python基础之集合

    一.定义: 二.基本操作: 三.运算: 交集&, 并集|, 补集-, 对称补集^, 子集<   超集> 四.集合推导式: 五.固定集合 frozenset 六.基本代码: # 1. ...

  8. 课堂笔记及知识点----栈和队列(2018/10/24(am))

    栈: Stack<int>  xt=new Stack<int>() ; 先进后出,后进先出,水杯结构,顺序表类似 常用方法:   .pop---->出栈,弹栈     ...

  9. esyui datagrid 水平方向下方出来滚动条的原因是因为使用了同一列名

    esyui datagrid 水平方向下方出来滚动条的原因是因为使用了同一列名

  10. Windows10 正式企业版激活

    一.镜像 https://www.landiannews.com/archives/51102.html 二.ISO镜像文件比对SHA1值,判定文件是否被篡改 https://msdn.itellyo ...