raid0
1 先给sdb磁盘和sdc磁盘分区
[root@localhost ~]# fdisk /dev/sdb
Command (m for help): n
Command action
e extended
p primary partition (1-4)
p
Partition number (1-4): 1
First cylinder (1-26108, default 1):
Last cylinder, +cylinders or +size{K,M,G} (1-26108, default 26108): +2G
Command (m for help): t
Selected partition 1
Hex code (type L to list codes): L
Hex code (type L to list codes): fd
磁盘 sdc的按如上步骤分区。
2 同步磁盘
[root@localhost ~]# partx -a /dev/sdb
[root@localhost ~]# partx -a /dev/sdc
3 新建raid
[root@localhost ~]# mdadm -C /dev/md0 -a yes -l 0 -n 2 /dev/sd{b,c}1
4 格式化
[root@localhost ~]# mkfs.ext4 /dev/md0
5 挂载 /dev/md0
[root@localhost ~]# mount /dev/md0 /mnt/raid0
6 更新 /etc/fstab
#
# /etc/fstab
# Created by anaconda on Tue Apr 25 15:26:09 2017
#
# Accessible filesystems, by reference, are maintained under ‘/dev/disk’
# See man pages fstab(5), findfs(8), mount(8) and/or blkid(8) for more info
#
UUID=9341e6da-5470-4df8-89c5-bfbc3a689d8d / ext4 defaults 1 1
UUID=12c88f0f-aa56-4be1-9c87-eaf0cf524e75 /app ext4 defaults 1 2
UUID=20192758-4252-4bf6-83d4-52da93ffdab4 /boot ext4 defaults 1 2
UUID=567c9b8b-5207-4a4c-8548-9f5b6ee49c3a /home ext4 defaults 1 2
UUID=3ac9cd7c-8d23-43a6-a550-9f93df25f5cf swap swap defaults 0 0
tmpfs /dev/shm tmpfs defaults 0 0
devpts /dev/pts devpts gid=5,mode=620 0 0
sysfs /sys sysfs defaults 0 0
proc /proc proc defaults 0 0
UUID=”f8326b71-00b6-4f6b-92e1-5d5a852538ae” /mnt/raid0 ext4 defaults 0 0
7 测试读写速度
读取速度测试
[root@localhost ~]# dd if=/dev/md0 of=file bs=1M count=1024
1024+0 records in
1024+0 records out
1073741824 bytes (1.1 GB) copied, 37.2231 s, 28.8 MB/s
写速度测试
[root@localhost ~]# dd if=file of=/dev/md0 bs=1M count=1024
1024+0 records in
1024+0 records out
1073741824 bytes (1.1 GB) copied, 47.4734 s, 22.6 MB/s
原创文章,作者:fsy,如若转载,请注明出处:http://www.178linux.com/74237