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

The disk is mounted on LVM.

2025-01-17 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

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

1. Check disk status: fdisk -l

2. Partitioning disk sdb:

Command: fdisk /dev/sdb

If you don't know what to do with fdisk, type m to help. The most common is n (new) d (delete) p (print) q (exit) t (modify system identifier) w (write and exit)

Create a new partition:

Enter p to print existing partitions (no partitions yet)

Enter n New partition

Enter p to create the main partition (p is after n, not print)

Enter 1 to create the first primary partition

Enter p to print the partition and find that a partition/dev/sdb1 has been created, but this partition is in Linux format

Change system identifier:

Enter t to change the properties of partition 1

Type L to see if there is a command corresponding to an attribute

Enter 8e to change partition 1 to Linux LVM format

Enter p to print the partition and find that the partition/dev/sdb1 is in Linux LVM format

3. Create PV:

Scanning system PV: pvscan

Create PV: pvcreate /dev/sdb1

View PV: pvdisplay

4. Create VG:

Scan system VG: vgscan

Create VG: vgcreate vg_test /dev/sdb1

View VG: vgdisplay

5. Create LV:

Scan system LV: lvscan

Create LV: lvcreate -l 1274 -n lv_test vg_test (1274 is the number of PEs in VG)

View LV: lvdisplay

6. Format the LV you just created

Command: mkfs -t ext4 /dev/vg_test/lv_test

7. Create directory and mount

Create directory: mkdir /test

Mount: mount /dev/vg_test/lv_test /test

View: df -h

8. There is also a final step, setting the boot mount.

Write/dev/mapper/vg_test-lv_test /test ext4 defaults 1 2 to/etc/fstab

So far, it's done.

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