raid0
至少需要两块
读写速度快,但安全性不高
1.添加硬盘
[root@localhost ~]# lsblk
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
sda 8:0 0 20G 0 disk
├─sda1 8:1 0 500M 0 part /boot
└─sda2 8:2 0 19.5G 0 part
├─centos-root
253:0 0 17.5G 0 lvm /
└─centos-swap
253:1 0 2G 0 lvm [SWAP]
sdb 8:16 0 5G 0 disk
sdc 8:32 0 5G 0 disk
sdd 8:48 0 5G 0 disk
sr0 11:0 1 4G 0 rom
2.安装
[root@localhost ~]# yum instll mdadm -y
3.帮助文档的查找
[root@localhost ~]# mdadm --help-options
4.磁盘分区
[root@localhost ~]# fdisk /dev/sdb
Welcome to fdisk (util-linux 2.23.2).
Changes will remain in memory only, until you decide to write them.
Be careful before using the write command.
Device does not contain a recognized partition table
Building a new DOS disklabel with disk identifier 0xf7afde69.
Command (m for help): n
Partition type:
p primary (0 primary, 0 extended, 4 free)
e extended
Select (default p): p
Partition number (1-4, default 1):
First sector (2048-10485759, default 2048):
Using default value 2048
Last sector, +sectors or +size{K,M,G} (2048-10485759, default 10485759): +1G
Partition 1 of type Linux and of size 1 GiB is set
Command (m for help): n
Partition type:
p primary (1 primary, 0 extended, 3 free)
e extended
Select (default p): p
Partition number (2-4, default 2):
First sector (2099200-10485759, default 2099200):
Using default value 2099200
Last sector, +sectors or +size{K,M,G} (2099200-10485759, default 10485759): +1G
Partition 2 of type Linux and of size 1 GiB is set
Command (m for help): w
The partition table has been altered!
Calling ioctl() to re-read partition table.
Syncing disks.
5.创建
[root@localhost ~]# mdadm -C /dev/md0 -l 0 -n 2 /dev/sdb1 /dev/sdb2
mdadm: Defaulting to version 1.2 metadata
mdadm: array /dev/md0 started.
-C /dev/命名
-l 等级
-n 数量
6.查看所有运行的RAID阵列的状态
[root@localhost ~]# cat /proc/mdstat
Personalities : [raid0]
md0 : active raid0 sdb2[1] sdb1[0]
2095104 blocks super 1.2 512k chunks
unused devices: <none>
查询uuid
[root@localhost ~]# mdadm -Ds
ARRAY /dev/md0 metadata=1.2 name=localhost.localdomain:0 UUID=20f1b3d2:257a15a9:d1d930c7:d33d2e84
查询详细信息
[root@localhost ~]# mdadm -D /dev/md0
/dev/md0:
Version : 1.2
Creation Time : Tue Dec 29 01:37:22 2020
Raid Level : raid0
Array Size : 2095104 (2046.34 MiB 2145.39 MB)
Raid Devices : 2
Total Devices : 2
Persistence : Superblock is persistent
Update Time : Tue Dec 29 01:37:22 2020
State : clean
Active Devices : 2
Working Devices : 2
Failed Devices : 0
Spare Devices : 0
Chunk Size : 512K
Name : localhost.localdomain:0 (local to host localhost.localdomain)
UUID : 20f1b3d2:257a15a9:d1d930c7:d33d2e84
Events : 0
Number Major Minor RaidDevice State
0 8 17 0 active sync /dev/sdb1
1 8 18 1 active sync /dev/sdb2
给raid0分区
[root@localhost ~]# fdisk /dev/md0
格式化
[root@localhost ~]# mkfs.ext4 /dev/md0p1
创建目录
[root@localhost ~]# mkdir /opt/md0
挂载
[root@localhost ~]# mount /dev/md0p1 /opt/md0/
查看
[root@localhost ~]# df -h
/dev/md0p1 976M 2.6M 907M 1% /opt/md0
本文介绍了RAID0的特点,至少需两块硬盘,读写速度快但安全性不高。还详细说明了其配置过程,包括添加硬盘、安装、查找帮助文档、磁盘分区、创建RAID0、查看状态、分区、格式化、创建目录及挂载等操作。
2107

被折叠的 条评论
为什么被折叠?



