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

Implementation Code of Linux hard disk merging

2025-02-23 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

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

Purpose

Merge two empty hard drives into "one" and mount them to the specified directory to achieve the effect of using all the space of 2 hard drives in one directory.

Conditions

Hard disk 1 / dev/sdb hard disk 2 / dev/sdc

Method

Create pv

Pvcreate / dev/sdb / / hard disk 1pvcreate / dev/sdc / / hard disk 2

Create vg

/ / vgcreate [Custom LVM name] [device] / / create vg:LVMvgcreate LVM / dev/sdb using hard disk 1 first

Extended vg

/ / vgextend [Custom vg name] [device] / / extend vgvgextend LVM / dev/sdc with hard disk 2

Create lv

/ / lvcreate-L [Custom Partition size]-n [Custom Partition name] [vg name] / / * Partition size cannot exceed the sum of hard disk capacity * lvcreate-L5.0T-nDB_DATA LVM

Format Partition

/ / mkfs-t [file system] [partition location] mkfs-t ext4 / dev/LVM/DB_DATA

Mount partition

/ / mount [partition location] [directory address] mount / dev/LVM/DB_DATA / root/DB_DATA

Set boot load

Add the following line at the end of the / etc/fstab file.

/ dev/LVM/DB_DATA / root/DB_DATA ext4 defaults 1 2

The above is the whole content of this article, I hope it will be helpful to your study, and I also hope that you will support it.

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