当前位置:网站首页>dev/mapper的解释
dev/mapper的解释
2022-06-25 14:33:00 【qq_42533216】
二、/dev/mapper目录的解释
为了方便叙述,假设一台服务器有三块硬盘分别为a,b,c,每块硬盘的容量为1T。在安装Linux的时候,先根据系统及自身的需要建立基本的分区,假设对硬盘a进行了分区,分出去了0.1T的空间挂载在/boot目录下,其他硬盘未进行分区。系统利用Device mapper机制建立了一个卷组(volume group,VG),你可以把VG当做一个资源池来看待,最后在VG上面再创建逻辑卷(logical volume,LV)。若要将硬盘a的剩余空间、硬盘b和硬盘c都加入到VG中,则硬盘a的剩余空间首先会被系统建立为一个物理卷(physical volume,PV),并且这个物理卷的大小就是0.9T,之后硬盘a的剩余的空间、硬盘b和硬盘c以PV的身份加入到VG这个资源池中,然后你需要多大的空间,就可以从VG中划出多大的空间(当然最大不能超过VG的容量)。比如此时池中的空间就是2.9T,此时你就可以建立一个1T以上的空间出来,而不像以前最大的容量空间只能为1T。
/dev/mapper/Volume-lv_root的意思是说你有一个VG (volume group卷组)叫作Volume, 这个Volume里面有一个LV叫作lv_root。其实这个/dev/mapper/Volume-lv_root文件是一个连接文件,是连接到/dev/dm-0的,你可以用命令ll /dev/mapper/Volume-lv_root进行查看。
其实在系统里/dev/Volume/lv_root 和 /dev/mapper/Volume-lv_root以及/dev/dm-0都是一个东西,都可当作一个分区来对待。
若要了解硬盘的具体情况,可通过fdisk或者pvdisplay命令进行查看。
若你想要重装系统到/dev/sda下,且安装时有些东西不想被格式化想转移到/dev/sdb下,但此时/dev/sda和/dev/sdb被放到VG中了,那该如何解决该问题呢?这种情况下,由于此时根本没办法确定数据在哪一个硬盘上,因为这两个硬盘就如同加到池里,被Device mapper管理,所以解决方案就是再建个逻辑卷出来,把数据移到新的卷里,这样你就可以重装系统时只删掉之前分区里的东西,而新的卷里的东西不动,就不会丢失了。
/vm_data/openstack/nova/instance/instance-000008a9]$ ll
total 216080
-rw-r--r-- 1 nova nova 28744 Jun 17 14:53 console.log
-rw-r--r-- 1 nova nova 221249536 Jun 23 10:39 disk
lrwxrwxrwx 1 nova nova 52 Jun 17 14:52 disk.local -> /dev/raidVG/eph_d03ab0ae-09b6-43e5-a9e0-2dc4acf4dfd8
-rw-r--r-- 1 nova nova 1790 Jun 17 14:52 libvirt.xml
/dev/mapper/ 目录下的内容
/dev/mapper]$ ll |grep d03ab0ae
lrwxrwxrwx 1 root root 8 Jun 22 18:14 raidVG-eph_d03ab0ae--09b6--43e5--a9e0--2dc4acf4dfd8 -> ../dm-18
lrwxrwxrwx 1 root root 8 Jun 17 14:52 raidVG-eph_d03ab0ae--09b6--43e5--a9e0--2dc4acf4dfd8--linear -> ../dm-20
lrwxrwxrwx 1 root root 8 Jun 17 14:52 raidVG-eph_d03ab0ae--09b6--43e5--a9e0--2dc4acf4dfd8--meta -> ../dm-19
lvdisplay
--- Logical volume ---
LV Path /dev/raidVG/eph_d03ab0ae-09b6-43e5-a9e0-2dc4acf4dfd8-meta
LV Name eph_d03ab0ae-09b6-43e5-a9e0-2dc4acf4dfd8-meta
VG Name raidVG
LV UUID HExptR-uUCG-rfdd-RUFz-p9y2-wPuQ-6df7Yo
LV Write Access read/write
LV Creation host, time qd01-cp-compute111007151.qd01.ksyun.com, 2022-06-17 14:52:10 +0800
LV Status available
# open 1
LV Size 4.00 MiB
Current LE 1
Segments 1
Allocation inherit
Read ahead sectors auto
- currently set to 256
Block device 253:19
边栏推荐
- The best screenshot tool in the world, color absorption tool snipaste
- Cool assembly tutorial - concise x86 assembly language tutorial (1)
- Get the parameters in the URL and the interchange between parameters and objects
- Stream竟然还有应用进阶学习?作为程序员的你知道吗
- Shell operator
- Common formatting methods for amount numbers
- Encapsulating functions and event handling
- Does stream even have application advanced learning? As a programmer, you know what
- [Ocean University of China] Data Sharing for retest of initial Examination
- Page 112 machine learning - review of fundamentals of mathematics pptx
猜你喜欢

Uniapp cloud packaging app

合宙Air32F103CBT6开发板上手报告

Shell string variable

Complete and detailed compilation of experimental reports

shell 内置命令

当了六年程序员第一次搞懂微服务架构的数据一致性,真不容易

英语中的九大词性与九大时态

"Mobile cloud Cup" computing power network application innovation competition is in hot registration!

China has made major breakthroughs in battery technology. Japan, South Korea and the United States are lagging behind. China has consolidated its leading edge

Summary of common functions in Oracle Database
随机推荐
Beego--- notes
‘nvidia-smi‘ 不是内部或外部命令,也不是可运行的程序或批处理文件
Today in history: Netease was founded; The first consumer electronics exhibition was held; The first webcast in the world
None of the MLIR Optimization Passes are enabled (registered 2)解决办法
Two common ways for orcale to clear table data
JGG | 河北大学杜会龙组综述植物泛基因组学研究
Complete and detailed compilation of experimental reports
Renix Perf: IP网络性能测试工具及测试用例参数详解
golang项目依赖管理工具go vendor,go mod
Les neuf caractéristiques de la parole et les neuf temps en anglais
TSDB在民机行业中的应用
分享自己平时使用的socket多客户端通信的代码技术点和软件使用
Deconstruction assignment of variables
重磅!国产 IDE 发布,由阿里研发,完全开源!(高性能+高定制性)
[untitled]
To make pytorch faster, you need to master these 17 methods
JS recursion and while
Shell string variable
What is the difference between escape, encodeuri and encodeuricomponent?
【中国海洋大学】考研初试复试资料分享