当前位置:网站首页>[Day1] (Super detailed steps) Build a soft RAID disk array
[Day1] (Super detailed steps) Build a soft RAID disk array
2022-08-05 06:09:00 【Mingli Yui】
Table of Contents
(2) Prepare for RAIDPartitions of the array
(4) Create and mount a file system (temporary mount)
First add 4 SCSI hard disks to the linux server, use the mdadm software package to build a RAID5 disk array to improve the performance and reliability of disk storage.
First, build a disk array
(1) Install the mdadm tool
In the CentOS7.x system, the mdadm tool is provided by the mdadm-3.4-14.el7.x86_64 package. Execute the rpm-qa | grep mdadm command to check whether the mdadm tool is installed in the system.If the mdadm tool is not installed in the system, you can use RPM or YUM to install yum install mdadm -y

(2) Prepare partitions for RAID arrays
Add 4 SCSI hard drives to the Linux server.Use the fdisk tool to divide a 2GB partition, according to /dev/sdc1, /dev/sdd1, /dev/sde1, /dev/sdf1. (Because I have added a disk (sdb) before, and then add a disk tofrom sdc)
(How to add disk and disk partition in my previous blog)

(3) Create RAID device
Use the mdadm command to create a RAID, execute the following command to create a RAID5 named md0.
[[email protected] ~]# mdadm -Cv /dev/md0 -a yes -n4 -l5 /dev/sd[cdef]1

The functions of the parameters used in the above commands are as follows.
-C: Equivalent to create, which means new;
-v: Display the information during the creation process; /dev/md0: The name of the created RAID5;
-a: --auto, which means to inform mdadm whether to create a device file and assign an unused minor device number, followed by yes to automatically create a device file if it does not exist;
-n: Specify several hard disks to create RAID, n4 means use 4 hard disks to create RAID;
-l: Specify the RAID level, l5 means create RAID5; /dev/sd[bcde]1: Specify four disk partitions.View RAID5 creation results.
(4) Create and mount a file system (temporary mount)
[[email protected] ~]# mkfs -t xfs /dev/md0
[[email protected] ~]# mkdir /raidme
[[email protected] ~]# mount /dev/md0 /raidme/
[[email protected] ~]# df -hT

From the value in the result of the above df -hT command /dev/md0 has a capacity of 6G.4 pieces of 2G disk should be 8G, why the capacity only shows 6G?This is the characteristic of RAID5, and the part for storing parity data is not displayed.
边栏推荐
猜你喜欢
随机推荐
亲身实感十多年的面试官面试的题目
(oj)原地移除数组中所有的元素val、删除排序数组中的重复项、合并两个有序数组
framebuffer应用编程及文字显示(2)
UE4动画雨滴材质制作教程
Getting Started 11 Automatically add version numbers
C语言的一些小常识
spark算子-parallelize算子
电子产品量产工具(1)- 显示系统实现
C语言程序死循环问题解析——变量被修改
如何用UE5渲染一个可爱的茶壶屋?
入门文档07 分阶段输出
(C语言)strlen、strcpy、strcat、strcmp、strstr函数的模拟实现
添加新硬盘为什么扫描不上?如何解决?
D46_给刚体施加的力
Spark源码-任务提交流程之-6.1-sparkContext初始化-创建spark driver端执行环境SparkEnv
Cocos Creator小游戏案例《棍子士兵》
TCP/IP四层模型
Cocos Creator开发中的事件响应
LeetCode刷题之第23题
乘云科技受邀出席2022阿里云合作伙伴大会荣获“聚力行远奖”









