逻辑卷管理器:PV、PE、VG、LV

21. LVM逻辑卷管理器——PV,VG,LV 物理卷就是指硬盘分区或从逻辑上与磁盘分区具有相同功能的设备(如RAID),是LVM的基本储存逻辑块,但和基本的物理储存介质(如分区,磁盘等)比较,却包含有与LVM相关的管理参数。LVM是Linux环境中对磁盘分区进行管理的一种机制,是建立在硬盘和分区之上,文件系统之下的一个逻辑层,可提高磁盘分区管理的灵活性。(4)LV LVM的逻辑卷类似于非LVM系统中的硬盘分区,在逻辑卷之上可以创建文件系统(比如/home 或/usr等)在同一个卷组中,LE的大小和PE是相同的,并且一一对应。....... 阅读详情
AI摘要

LVM是一种逻辑卷管理器,允许灵活调整文件系统的容量。它包括物理卷(PV),卷组(VG)和逻辑卷(LV)。PE是基本存储单位,LV的大小与PE数量相关。文章介绍了如何通过LVM进行磁盘扩展和缩减,包括vgcreate、lvcreate、lvresize等命令的使用,并提到了文件系统如xfs和ext4的扩容方法。

LVM:Logical Volume Manager,逻辑卷管理器。
重点:可以弹性的调整文件系统的容量,而不在于性能和数据安全上面,因此如果强调性能和备份,那么直接使用raid即可,不需要用到LVM。

LVM可以整合多个物理分区,让这些分区看起来就像是一个磁盘一样;而且,未来还可以在这个LVM管理的磁盘当中新增或者删除其他的物理分区。因此它的重点在于“可以弹性地调整文件系统的容量”

LVM各组件

LVM各组件的实现流程如上图,详细的组件介绍如下。

 物理卷(physical volume,PV,最底层的物理卷)

实际的分区需要调整系分区类型为8e00(使用gdisk分区工具,其实分区类型不设置成8e也没关系,不过某些LVM的检测命令可能会检测不到该分区),然后再经过pvcreate命令将它转化成LVM最底层的物理卷,之后才能使用这些pv。

卷组(volume group,VG)

LVM大磁盘就是将许多PV整合成VG,所以VG就是LVM组合起来的大磁盘。

物理扩展快(physical extent,PE)

PE是整个LVM最小的存储数据单位,即文件数据都是借由写入PE来完成的。简单的来说,这个PE有点像文件系统的block大小。因此调整PE会影响到LVM的最大容量。如果是32位的linux系统,LVM的逻辑卷LV最多65534个PE(lvm1的格式),因此默认的LVM,即使用4MB的PE数据块,最大的LV会有4MB*65534/(1024M/G)=256GB;但是在Centos 6.X之后,由于linux系统转为64位,并且PE使用了lvm2的各项格式功能,LV几乎没有啥容量限制了。

逻辑卷(logical volume,LV )

最终的卷组VG还会被切成逻辑卷LV,LV就是最后可以被格式化使用的东西了(类似分区)。逻辑卷LV的大小与LV内的物理扩展快PE数量有关,逻辑卷LV的设备文件名格式通常为【/dev/vgname/lvname】


如上图,VG内的PE会分给虚线部分的LV,如果未来这个卷组VG要扩充,加上其他的物理卷PV即可;如果逻辑卷LV要扩充的,加上卷组VG内没有使用的PE来扩充。在LV中,不再称为PE而是称为LE;PE是物理存储单元,LV是逻辑存储单元,即LV中的存储单元LE和PE的大小是一样的。

LVM可以弹性的调整文件系统的容量的实质:通过【交换PE】来进行数据转换,将原本LV内的PE转移到其他设备中来降低LV容量,或将其他设备的PE加入到此LV中以加大容量。

实践流程

 根据上图流程爱进行实验如下

物理parition阶段

根据磁盘分区表类型使用gdisk/fdisk工具,对磁盘分区并且类型设置为【8e00】,
磁盘状态如下:
sdb为1G的磁盘,划分了sdb1-3分区,1-2分区是用到的分区,3先保留下来不使用;sdc为2G的磁盘,全部划分为分区sdc1,并且使用;sdd为3G的磁盘,暂不进行分区使用。

PV、VG、LV介绍及常用命令 在逻辑卷管理中,PV、VG 和 LV 是三个重要概念,它们之间的关系如下:PV(Physical Volume):物理卷是存储设备或分区,如硬盘、固态硬盘或分区。PV 是 LVM 的基本组成单元,是用来扩展逻辑卷的物理存储单元。VG(Volume Group):卷组是由一个或多个物理卷组成的逻辑存储单元。VG 将多个 PV 组合在一起,可以提供更大的存储空间,并允许创建逻辑卷。LV(Logical Volume):逻辑卷是从卷组中划分出来的逻辑存储单元,类似于分区。 阅读详情

相关推荐

LVM逻辑卷操作(PV、VG、LV及XFS的扩容)-实验笔记

LVM作为操作非常灵活的磁盘操作模式,还是有必要熟练的。 ENV: [root@centos7 ~]# uname -r 3.10.0-514.el7.x86_64 [root@centos7 ~]# cat /etc/redhat-release CentOS Linux release 7.3.1611 (Core) [root@centos7 ~]# lsblk NAME ...

silent_ghost的专栏 4130

逻辑卷轴管理(PE,PV,VG,LV)

1.LVM 的重点在於可以弹性调整存储大小,而非性能和数据安全上 2.LVM 的全名是 Logical Volume Manager,中文可以翻译作逻辑卷轴管理

lileizhang的专栏 1791

第60章:LVM基础(PV、VG、LV)

LVM(Logical Volume Manager,逻辑卷管理器)是 Linux 系统中对磁盘存储进行灵活管理的技术。它在传统分区基础上,提供了动态调整磁盘空间大小、创建快照、跨多块磁盘管理卷组等高级功能。让存储管理更灵活,方便扩展和维护。

yumeiguo的博客 183

海康工业相机LabVIEW二次开发实战——参数配置优化与图像高效存储

本文详细介绍了海康工业相机在LabVIEW平台上的二次开发实战,重点解析了相机参数配置的优化方法与图像高效存储策略。通过剖析曝光、增益、触发模式等核心参数的设置逻辑,并结合生产者-消费者设计模式,指导开发者构建稳定、高效的图像采集与异步存储流程,有效提升工业视觉项目的开发效率与系统稳定性。

weixin_29306317的博客 228

Nginx反向代理MinIO私有桶签名失效?一招解决Host头校验问题

本文详细解析了Nginx反向代理MinIO私有桶时出现的签名失效问题,重点解决了Host头校验导致的"SignatureDoesNotMatch"错误。通过精准配置proxy_set_header保持Host头一致性,并提供了二级目录代理和调试指南,帮助开发者高效解决这一常见技术难题。

weixin_29201313的博客 327

想学嵌入式但没开发板?试试这个免费的STM32虚拟仿真平台(含LVGL界面教程)

本文介绍如何利用免费的STM32虚拟仿真平台学习嵌入式开发,特别适合预算有限或零硬件基础的学习者。通过详细的LVGL界面开发教程,展示虚拟仿真在嵌入式学习中的高效性和实用性,涵盖环境搭建、代码实现到实机迁移的全流程,助力快速掌握嵌入式开发核心技能。

weixin_29266647的博客 313

Transformer在CV里太耗算力?手把手拆解Restormer的MDTA与GDFN模块

本文深度解析了CVPR2022最佳论文提名作品Restormer的创新模块MDTA与GDFN,有效解决了Transformer在计算机视觉领域的高计算复杂度问题。通过通道注意力降维和门控前馈网络设计,Restormer在图像恢复重建任务中显著降低计算量,同时保持高性能,为实时图像处理提供了可行方案。

weixin_30258901的博客 449

数据预处理的分箱操作

数据分箱 介绍 我们在建立模型前,一般需要对特征变量进行离散化,特征离散化后,模型会更稳定,降低模型过拟合的风险。尤其是采用 logsitic 建立评分卡模型时,必须对连续变量进行离散化。而特征离散化处理通常采用的就是分箱法,数据分箱(也称为离散分箱或分段)是一种数据预处理技术,用于减少次要观察误差的影响,提高泛化性。 数据分箱又分为有监督分箱和无监督分箱,是否使用标签进行离散化(分箱)决定了有监督还是无监督的离散化方法。 知识点 无监督分箱 split 分箱 merge 分箱 无监督分箱 这里为了

随笔记 5341

数字设计实验:自动售货机

本文旨在介绍数字设计实验:自动售货机的设计思路和实现代码

2401_83740084的博客 2235

MetaERP 的管理单元在设计哲学和实现逻辑上,确实与 Oracle EBS 的业务实体(OU)一脉相承,你可以放心地在已知的 Oracle 多组织架构框架下进行理解。它并没有推翻这套经典的核算模型

MetaERP的管理单元设计继承了Oracle EBS业务实体(OU)的核心思想,并进行了现代技术重构。管理单元(MU)作为OU的超集,延续了业务数据隔离与流程执行边界的定位,但通过元数据驱动的多租户架构实现更灵活的数据隔离。MetaERP采用三层解耦设计(核算单元、自然科目、核算维度),解决了EBS科目组合爆炸问题,并实现事件驱动的实时核算。相较于EBS的批处理模式,MetaERP通过云原生架构和元数据驱动配置,显著提升了灵活性、实时性和扩展性,支持跨法人的业务统一管理视图。

金牌架构师 581

【Davinci开发】:CS接口创建及连接

AUTOSAR SWC之间添加CS-port :详细讲解step

2535

RU DOS版、EFI版32bit/64bit BIOS常用工具

DOS版、EFI版的RU工具,可用来查看IO、MEM、PCI、SMBIOS等资源。亲测在EFI SHELL下可用。

SAP B1中文培訓教材_SDK

公司内部培训资料,对开发工具 ,DIAPI, UIAPI,Add-ON有详细解说

Camera2Demo

在Camera2 的基础上进行封装,使得Camera2一堆初始化逻辑与Activity分离,降低耦合度,完成预览拍照并保存的操作

深度学习工具包 DeepLearningToolbox

深度学习工具包Deprecation notice.-----This toolbox is outdated and no longer maintained.There are much better tools available for deep learning than this toolbox, e.g. [Theano](http://deeplearning.net/software/theano/), [torch](http://torch.ch/) or [tensorflow](http://www.tensorflow.org/)I would suggest you use one of the tools mentioned above rather than use this toolbox.Best, Rasmus.DeepLearnToolbox================A Matlab toolbox for Deep Learning.Deep Learning is a new subfield of machine learning that focuses on learning deep hierarchical models of data.It is inspired by the human brain's apparent deep (layered, hierarchical) architecture.A good overview of the theory of Deep Learning theory is[Learning Deep Architectures for AI](http://www.iro.umontreal.ca/~bengioy/papers/ftml_book.pdf)For a more informal introduction, see the following videos by Geoffrey Hinton and Andrew Ng.* [The Next Generation of Neural Networks](http://www.youtube.com/watch?v=AyzOUbkUf3M) (Hinton, 2007)* [Recent Developments in Deep Learning](http://www.youtube.com/watch?v=VdIURAu1-aU) (Hinton, 2010)* [Unsupervised Feature Learning and Deep Learning](http://www.youtube.com/watch?v=ZmNOAtZIgIk) (Ng, 2011)If you use this toolbox in your research please cite [Prediction as a candidate for learning deep hierarchical models of data](http://www2.imm.dtu.dk/pubdb/views/publication_details.php?id=6284)```@MASTERSTHESIS\{IMM2012-06284, author = "R. B. Palm", title = "Prediction as a candidate for learning deep hierarchical models of data", year = "2012",}```Contact: rasmusbergpalm at gmail dot comDirectories included in the toolbox-----------------------------------`NN/` - A library for Feedforward Backpropagation Neural Networks`CNN/` - A library for Convolutional Neural Networks`DBN/` - A library for Deep Belief Networks`SAE/` - A library for Stacked Auto-Encoders`CAE/` - A library for Convolutional Auto-Encoders`util/` - Utility functions used by the libraries`data/` - Data used by the examples`tests/` - unit tests to verify toolbox is workingFor references on each library check REFS.mdSetup-----1. Download.2. addpath(genpath('DeepLearnToolbox'));Example: Deep Belief Network---------------------```matlabfunction test_example_DBNload mnist_uint8;train_x = double(train_x) / 255;test_x = double(test_x) / 255;train_y = double(train_y);test_y = double(test_y);%% ex1 train a 100 hidden unit RBM and visualize its weightsrand('state',0)dbn.sizes = [100];opts.numepochs = 1;opts.batchsize = 100;opts.momentum = 0;opts.alpha = 1;dbn = dbnsetup(dbn, train_x, opts);dbn = dbntrain(dbn, train_x, opts);figure; visualize(dbn.rbm{1}.W'); % Visualize the RBM weights%% ex2 train a 100-100 hidden unit DBN and use its weights to initialize a NNrand('state',0)%train dbndbn.sizes = [100 100];opts.numepochs = 1;opts.batchsize = 100;opts.momentum = 0;opts.alpha = 1;dbn = dbnsetup(dbn, train_x, opts);dbn = dbntrain(dbn, train_x, opts);%unfold dbn to nnnn = dbnunfoldtonn(dbn, 10);nn.activation_function = 'sigm';%train nnopts.numepochs = 1;opts.batchsize = 100;nn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.10, 'Too big error');```Example: Stacked Auto-Encoders---------------------```matlabfunction test_example_SAEload mnist_uint8;train_x = double(train_x)/255;test_x = double(test_x)/255;train_y = double(train_y);test_y = double(test_y);%% ex1 train a 100 hidden unit SDAE and use it to initialize a FFNN% Setup and train a stacked denoising autoencoder (SDAE)rand('state',0)sae = saesetup([784 100]);sae.ae{1}.activation_function = 'sigm';sae.ae{1}.learningRate = 1;sae.ae{1}.inputZeroMaskedFraction = 0.5;opts.numepochs = 1;opts.batchsize = 100;sae = saetrain(sae, train_x, opts);visualize(sae.ae{1}.W{1}(:,2:end)')% Use the SDAE to initialize a FFNNnn = nnsetup([784 100 10]);nn.activation_function = 'sigm';nn.learningRate = 1;nn.W{1} = sae.ae{1}.W{1};% Train the FFNNopts.numepochs = 1;opts.batchsize = 100;nn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.16, 'Too big error');```Example: Convolutional Neural Nets---------------------```matlabfunction test_example_CNNload mnist_uint8;train_x = double(reshape(train_x',28,28,60000))/255;test_x = double(reshape(test_x',28,28,10000))/255;train_y = double(train_y');test_y = double(test_y');%% ex1 Train a 6c-2s-12c-2s Convolutional neural network %will run 1 epoch in about 200 second and get around 11% error. %With 100 epochs you'll get around 1.2% errorrand('state',0)cnn.layers = { struct('type', 'i') %input layer struct('type', 'c', 'outputmaps', 6, 'kernelsize', 5) %convolution layer struct('type', 's', 'scale', 2) %sub sampling layer struct('type', 'c', 'outputmaps', 12, 'kernelsize', 5) %convolution layer struct('type', 's', 'scale', 2) %subsampling layer};cnn = cnnsetup(cnn, train_x, train_y);opts.alpha = 1;opts.batchsize = 50;opts.numepochs = 1;cnn = cnntrain(cnn, train_x, train_y, opts);[er, bad] = cnntest(cnn, test_x, test_y);%plot mean squared errorfigure; plot(cnn.rL);assert(er<0.12, 'Too big error');```Example: Neural Networks---------------------```matlabfunction test_example_NNload mnist_uint8;train_x = double(train_x) / 255;test_x = double(test_x) / 255;train_y = double(train_y);test_y = double(test_y);% normalize[train_x, mu, sigma] = zscore(train_x);test_x = normalize(test_x, mu, sigma);%% ex1 vanilla neural netrand('state',0)nn = nnsetup([784 100 10]);opts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samples[nn, L] = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.08, 'Too big error');%% ex2 neural net with L2 weight decayrand('state',0)nn = nnsetup([784 100 10]);nn.weightPenaltyL2 = 1e-4; % L2 weight decayopts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex3 neural net with dropoutrand('state',0)nn = nnsetup([784 100 10]);nn.dropoutFraction = 0.5; % Dropout fraction opts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex4 neural net with sigmoid activation functionrand('state',0)nn = nnsetup([784 100 10]);nn.activation_function = 'sigm'; % Sigmoid activation functionnn.learningRate = 1; % Sigm require a lower learning rateopts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex5 plotting functionalityrand('state',0)nn = nnsetup([784 20 10]);opts.numepochs = 5; % Number of full sweeps through datann.output = 'softmax'; % use softmax outputopts.batchsize = 1000; % Take a mean gradient step over this many samplesopts.plot = 1; % enable plottingnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex6 neural net with sigmoid activation and plotting of validation and training error% split training data into training and validation datavx = train_x(1:10000,:);tx = train_x(10001:end,:);vy = train_y(1:10000,:);ty = train_y(10001:end,:);rand('state',0)nn = nnsetup([784 20 10]); nn.output = 'softmax'; % use softmax outputopts.numepochs = 5; % Number of full sweeps through dataopts.batchsize = 1000; % Take a mean gradient step over this many samplesopts.plot = 1; % enable plottingnn = nntrain(nn, tx, ty, opts, vx, vy); % nntrain takes validation set as last two arguments (optionally)[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');```[![Bitdeli Badge](https://d2weczhvl823v0.cloudfront.net/rasmusbergpalm/deeplearntoolbox/trend.png)](https://bitdeli.com/free "Bitdeli Badge")

上一篇: Linux文件系统
下一篇: zeek集群简述
一只tobey
博客等级 码龄12年 328粉丝 317原创
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

当前余额3.43元 前往充值 >
需支付:10.00元
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付元
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值