raid0 raid1 raid5 raid10

本文详细介绍了在Linux环境下创建RAID0、RAID1、RAID5以及RAID10的过程,包括创建、分区、格式化和挂载步骤。通过实例展示了如何管理和维护RAID阵列,包括故障模拟、扩展和删除操作。
摘要由CSDN通过智能技术生成

创建md0并查看
[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.
[root@localhost ~]# cat /proc/mdstat
Personalities : [raid0]
md0 : active raid0 sdb2[1] sdb1[0]
2095104 blocks super 1.2 512k chunks

unused devices:
[root@localhost ~]# mdadm -Ds
ARRAY /dev/md0 metadata=1.2 name=localhost.localdomain:0 UUID=b195df76:d76765bb:76913700:12c0c475
[root@localhost ~]# mdadm -D /dev/md0
/dev/md0:
Version : 1.2
Creation Time : Tue Dec 29 17:30:19 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 17:30:19 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 : b195df76:d76765bb:76913700:12c0c475
     Events : 0

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

给md0分区
[root@localhost ~]# fdisk /dev/md0
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 0x841f585b.

Command (m for help): n
Partition type:
p primary (0 primary, 0 extended, 4 free)
e extended
Select (default p):
Using default response p
Partition number (1-4, default 1):
First sector (2048-4190207, default 2048):
Using default value 2048
Last sector, +sectors or +size{K,M,G} (2048-4190207, default 4190207): +1G
Partition 1 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.

格式化并挂载
[root@localhost ~]# mkfs.ext4 /dev/md0p1
mke2fs 1.42.9 (28-Dec-2013)
Filesystem label=
OS type: Linux
Block size=4096 (log=2)
Fragment size=4096 (log=2)
Stride=128 blocks, Stripe width=256 blocks
65536 inodes, 262144 blocks
13107 blocks (5.00%) reserved for the super user
First data block=0
Maximum filesystem blocks=268435456
8 block groups
32768 blocks per group, 32768 fragments per group
8192 inodes per group
Superblock backups stored on blocks:
32768, 98304, 163840, 229376

Allocating group tables: done
Writing inode tables: done
Creating journal (8192 blocks): done
Writing superblocks and filesystem accounting information: done

[root@localhost ~]# mkdir /opt/md0
[root@localhost ~]# mount /dev/md0p1 /opt/md0
[root@localhost ~]# df -h
Filesystem Size Used

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值