RAID 0,1,5,10 的基础学习

RAID 0 :读写速度块但安全性不高

1.添加硬盘 1个5G

2.分区 2个 1G的分区

3.配置本地yum源
[root@localhost ~]# cat /etc/yum.repos.d/local.repo
[cnetos]
name=centos
baseurl=file:///opt/centos
gpgcheck=0
enabled=1

4.挂载
[root@localhost ~]# mkdir /opt/centos
[root@localhost ~]# mount /dev/cdrom /opt/centos
mount: /dev/sr0 is write-protected, mounting read-only

5.下载 mdadm

[root@localhost ~]# yum install mdadm -y

6.帮助文档

[root@localhost ~]# mdadm --help-options

Any parameter that does not start with ‘-’ is treated as a device name
or, for --examine-bitmap, a file name.
The first such name is often the name of an md device. Subsequent
names are often names of component devices.

Some common options are:
–help -h : General help message or, after above option,
mode specific help message
–help-options : This help message
–version -V : Print version information for mdadm
–verbose -v : Be more verbose about what is happening
–quiet -q : Don’t print un-necessary messages
–brief -b : Be less verbose, more brief
–export -Y : With --detail, --detail-platform or --examine use
key=value format for easy import into environment
–force -f : Override normal checks and be more forceful

–assemble -A : Assemble an array
–build -B : Build an array without metadata

--create      -C   : Create a new array

–detail -D : Display details of an array
–examine -E : Examine superblock on an array component
–examine-bitmap -X: Display the detail of a bitmap file
–examine-badblocks: Display list of known bad blocks on device
–monitor -F : monitor (follow) some arrays
–grow -G : resize/ reshape and array
–incremental -I : add/remove a single device to/from an array as appropriate
–query -Q : Display general information about how a
device relates to the md driver
–auto-detect : Start arrays auto-detected by the kernel

[root@localhost ~]# mdadm -C --help

–level= -l : raid level: 0,1,4,5,6,10,linear,multipath and synonyms
–raid-devices= -n : number of active devices in array

7.创建 mdadm

[root@localhost ~]# mdadm -C /dev/md0 -l 0 -n 2 /dev/sdb[1-2]
mdadm: Defaulting to version 1.2 metadata
mdadm: array /dev/md0 started.

-C /dev/。。 raid名称
-l  raid等级
-n 磁盘数量

8.查询
(1)查看所有运行的RAID阵列的状态

[root@localhost ~]# cat /proc/mdstat

Personalities : [raid0]
md0 : active raid0 sdb2[1] sdb1[0]
2095104 blocks super 1.2 512k chunks

unused devices:
(2)查询此raid盘的详情信息

[root@localhost ~]# mdadm -D /dev/md0

/dev/md0:
Version : 1.2
Creation Time : Tue Dec 29 01:14:34 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:14:34 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 : 290ea952:19e9d34d:403013e1:b9119c5f
Events : 0

Number Major Minor RaidDevice State
0 8 17 0 active sync /dev/sdb1
1 8 18 1 active sync /dev/sdb2

(3)查询uuid

[root@localhost ~]# mdadm -Ds

ARRAY /dev/md0 metadata=1.2 name=localhost.localdomain:0 UUID=290ea952:19e9d34d:403013e1:b9119c5f

9.给raid0分区,格式化并挂载

(1)分区 1G

[root@localhost ~]# fdisk /dev/md0

(2)格式化

[root@localhost ~]# mkfs.ext4 /dev/md0p1

mke2fs 1.42.9 (28-Dec-2013)
Filesystem label=
OS type: Linux
Block size=4096 (log=2)

  • 1
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值