當前位置:
首頁 >
原有磁盘上创建lvm_Linux 系统管理及服务配置实战-第12章 磁盘管理3(连载)
發布時間:2025/3/15
28
豆豆
生活随笔
收集整理的這篇文章主要介紹了
原有磁盘上创建lvm_Linux 系统管理及服务配置实战-第12章 磁盘管理3(连载)
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
存儲管理Ⅱ
1.邏輯卷LVM
1.1.LVM管理
在線擴容 online
數據遷移 online
創建LVM VG擴展/縮小 LV擴容 文件系統擴容
基本分區(MBR|GPT) ----> Filesystem ----> mount
邏輯卷LVM ----> Filesystem ----> mount
PE: Physical extent 物理擴展 4M 8M 16M 32M 64M 創建VG時指定 -s 8M
LE: Logical extent 邏輯擴展
1.2.創建LVM
準備物理磁盤 可以是: /dev/sdb /dev/sdc1
[root@server0 ~]# ll /dev/vd{c,d,e} ? brw-rw----. 1 root disk 253, 32 Jun 6 17:38 /dev/vdc ? brw-rw----. 1 root disk 253, 48 Jun 6 17:38 /dev/vdd ? brw-rw----. 1 root disk 253, 64 Jun 6 17:38 /dev/vde1.3.創建.pv
[root@server0 ~]# pvcreate /dev/vdd Physical volume "/dev/vdd" successfully created [root@server0 ~]# pvscan PV /dev/vdd lvm2 [2.00 GiB] Total: 1 [2.00 GiB] / in use: 0 [0 ] / in no VG: 1 [2.00 GiB] [root@server0 ~]# pvs PV VG Fmt Attr PSize PFree /dev/vdd lvm2 a-- 2.00g 2.00g1.4.創建vg
[root@server0 ~]# vgcreate vg1 /dev/vdd Volume group "vg1" successfully created [root@server0 ~]# vgs VG #PV #LV #SN Attr VSize VFree vg1 1 0 0 wz--n- 2.00g 2.00g [root@server0 ~]# vgscan Reading all physical volumes. This may take a while... Found volume group "vg1" using metadata type lvm2 [root@server0 ~]# vgdisplay --- Volume group --- VG Name vg1 System ID Format lvm2 Metadata Areas 1 Metadata Sequence No 1 VG Access read/write VG Status resizable MAX LV 0 Cur LV 0 Open LV 0 Max PV 0 Cur PV 1 Act PV 1 VG Size 2.00 GiB PE Size 4.00 MiB Total PE 511 Alloc PE / Size 0 / 0 Free PE / Size 511 / 2.00 GiB VG UUID 7E4tlj-l0a2-ph52-OytH-eaq7-58K6-2S4n8Vhttp://1.5.lv
[root@server0 ~]# lvcreate -l 10 -n lv1 vg1 [root@server0 ~]# lvcreate -L 200M -n lv2 vg1 [root@server0 ~]# lvscan ACTIVE '/dev/vg1/lv1' [640.00 MiB] inherit ACTIVE '/dev/vg1/lv2' [256.00 MiB] inherit創建文件系統并掛載
[root@server0 ~]# mkfs.xfs /dev/vg1/lv1 [root@server0 ~]# mkfs.ext4 /dev/vg1/lv2 ? [root@server0 ~]# mkdir /mnt/lv1 /mnt/lv2 ? [root@server0 ~]# vim /etc/fstab /dev/vg1/lv1 /mnt/lv1 xfs defaults 0 0 /dev/vg1/lv2 /mnt/lv2 ext4 defaults 0 0 ? [root@server0 ~]# mount -a [root@server0 ~]# df Filesystem 1K-blocks Used Available Use% Mounted on /dev/mapper/vg1-lv1 651948 32928 619020 6% /mnt/lv1 /dev/mapper/vg1-lv2 245671 2062 226406 1% /mnt/lv2結語:至此LVM管理的基本方式已經完成。用戶得到LVM的磁盤分區,可以用于存儲數據。
Linux 系統管理及服務配置實戰-第12章 磁盤管理3 配套視頻教程地址: 鏈接:https://pan.baidu.com/s/1ZJ5w_ckqaCCxoQFV43MzLw 提取碼:lbvo總結
以上是生活随笔為你收集整理的原有磁盘上创建lvm_Linux 系统管理及服务配置实战-第12章 磁盘管理3(连载)的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: c++语言的设计与演化 pdf_天津大学
- 下一篇: 信奥中的数学:群论