Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Detailed steps for LVM creation

2025-03-04 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/02 Report--

LVM creation steps

1. Create Partition

two。 Create PV

3. Create VG

4. Create LV

5. Formatting and mounting

Create Partition

Use partition tools (such as fdisk, etc.) to create a LVM partition, but identify the partition as partition type 8e of LVM.

[root@kauai] # fdisk-l. Device Boot Start End Blocks Id System/dev/sdb1 2048 20971519 10484736 5 Extended/dev/sdb5 4096 2101247 1048576 8e Linux LVM/dev/sdb6 2103296 4200447 1048576 8e Linux LVM create PV create PV [root@kauai ~] # pvcreate / dev/sdb5 # convert each partition to PV Physical volume "/ dev/sdb5" successfully created [root@kauai ~ ] # pvcreate / dev/sdb6 Physical volume "/ dev/sdb6" successfully created View and verify [root@kauai ~] # pvdisplay. Create VG create VG [root@kauai ~] # vgcreate-s 16m vg01 / dev/sdb5 / dev/sdb6 / dev/sdb7# create a VG group named vg01, and modify PE to 16m Volume group "vg01" successfully created to view and verify

Note: LVM defaults to the PE block of 4MB, so the default LVM VG will have 4M*65534/ (1024M/G) = 256g.

Create LV

5.1 create LVS [/ erji]

[root@kauai] # lvcreate-L 1g-n lv01 vg01 Logical volume "lv01" created. Check and verify [root@kauai ~] # lvdisplay format and mount format [root@kauai ~] # mkfs.xfs / dev/vg01/lv01 # format to the corresponding format meta-data=/dev/vg01/lv01 isize=256 agcount=4, agsize=65536 blks = sectsz=512 attr=2 Projid32bit=1 = crc=0 finobt=0data = bsize=4096 blocks=262144, imaxpct=25 = sunit=0 swidth=0 blksnaming = version 2 bsize=4096 ascii-ci=0 ftype=0log = internal log bsize=4096 blocks=2560, version=2 = sectsz=512 sunit=0 blks, lazy-count=1realtime = none extsz=4096 blocks=0 Rtextents=0 mount [root@kauai ~] # mkdir / root/mylv01 # create a directory for mounting [root@kauai ~] # mount / dev/vg01/lv01 / root/mylv01/ # mount to the corresponding directory [root@kauai ~] # df-h # View and verify Filesystem Size Used Avail Use% Mounted on... / dev/mapper/vg01-lv01 1014M 33M 982M 4% / root/mylv01 boot mount [root@kauai] # vi / etc/fstab/dev/vg01/lv01 / root/mylv01 xfs defaults 0 0 # modified to boot mount

Original address: https://www.linuxprobe.com/lvm-create.html

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report