当前位置:网站首页>[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.
边栏推荐
猜你喜欢
随机推荐
专有宿主机CDH
你要找的cocos面试答案都在这里了!
成功的独立开发者应对失败&冒名顶替综
每日一题-正则表达式匹配-0715
入门文档05-2 使用return指示当前任务已完成
Spark源码-任务提交流程之-6.2-sparkContext初始化-TaskScheduler任务调度器
D41_缓冲池
PVE 直通硬盘到TrueNAS
什么是阿里云·速成美站?
(oj)原地移除数组中所有的元素val、删除排序数组中的重复项、合并两个有序数组
入门文档09 独立的watch
亲身实感十多年的面试官面试的题目
【Day1】VMware软件安装
浅谈遇到的小问题
每日一题-三数之和-0716(2)
什么是全栈设计师?
入门文档01 series按顺序执行
小度 小度 在呢!
framebuffer应用编程及文字显示(2)
Getting Started Documentation 10 Resource Mapping








