==================================== Create a production environment partition for raid
[[Email protected] _ 168_11_203 TMP] # Cat/proc/mdstat
Personalities: [raid1]
Md0: Active raid1 SDC [1] SDB [0]
998891520 blocks super 1.2 [2/2] [UU]
Bitmap: 2/8 pages [8 KB], 65536kb chunk
Unused devices: <none>
[[Email protected] _ 168_11_203 ~] # Fdisk-l
Disk/dev/SDB: 1023.0 GB, 1022999134208 bytes
Disk/dev/SDC: 1023.0 GB, 1022999134208 bytes
Disk/dev/SDD: 899.0 GB, 898999779328 bytes
Disk/dev/SDE: 899.0 GB, 898999779328 bytes
Disk/dev/SDA: 299.0 GB, 298999349248 bytes
Disk/dev/md0: 1022.9 GB, 1022864916480 bytes
[[Email protected] _ 168_11_203 ~] # DF-H
Filesystem size used avail use % mounted on
/Dev/sda2 30g 4.8g 24g 17%/
Tmpfs 64g 4.0 K 64g 1%/dev/SHM
/Dev/sda1 190 m 47 M 133 m 27%/boot
/Dev/md0p1 938g 132g 759g 15%/Data <---/dev/md0: 1022.9 GB
/Dev/sdd1 824g 73 m 783g 1%/backup <---/dev/SDD: 899.0 GB
/Dev/sde1 824G 11g 773g 2%/logs <---/dev/SDE: 899.0 GB
[[Email protected] _ 168_11_203 ~] # Cat/etc/fstab
/Dev/md0p1/Data ext4 defaults 0 0
/Dev/sdd1/backup ext4 defaults 0 0
/Dev/sde1/logs ext4 defaults 0 0
################## Create a soft RAID 0
### Partition
Fdisk/dev/SDB
N/P/1/+ 50 m/w
Fdisk/dev/SDC
N/P/1/+ 50 m/w
### Install the soft RAID Tool
Download mdadm
Http://download.chinaunix.net/down.php? Id = 28095 & resourceid = 6641 & Site = 1
Tar jxf mdadm-3.0.tar.bz2
Make
Make install
### Perform soft RAID
Mdadm-c -- verbose/dev/md0 -- level = 1 -- raid-devices = 2/dev/sdb2/dev/sdc2
Y
### Check whether/dev/md0 exists
Fdisk-l
### Format
Mkfs. ext4/dev/md0
### View raid Information
Mdadm-D/dev/md0
CAT/proc/mdstat
### Mount
Mkdir/mdata
Mount/dev/md0/mdata
### DF-H View
/Dev/md0 80 m 1.6 m 74 m 3%/mdata
================================ Generate a case
[[Email protected]/] # fdisk-l
Disk/dev/SDA: 300.0 GB, 300000000000 bytes
255 heads, 63 sectors/track, 36472 Cylinders
Units = cylinders of 16065*512 = 8225280 bytes
Sector size (logical/physical): 512 bytes/512 bytes
I/O size (minimum/optimal): 512 bytes/512 bytes
Disk identifier: 0xe2b2e2b2
Device boot start end blocks ID system
/Dev/sda1 × 1 26 204800 83 Linux
Partition 1 does not end on cylinder boundary.
/Dev/sda2 26 3942 31457280 83 Linux
/Dev/sda3 3942 4465 4194304 82 Linux swap/Solaris
Disk/dev/SDC: 1000.2 GB, 1000204886016 bytes
255 heads, 63 sectors/track, 121601 Cylinders
Units = cylinders of 16065*512 = 8225280 bytes
Sector size (logical/physical): 512 bytes/512 bytes
I/O size (minimum/optimal): 512 bytes/512 bytes
Disk identifier: 0x00000000
Disk/dev/SDB: 1000.2 GB, 1000204886016 bytes
255 heads, 63 sectors/track, 121601 Cylinders
Units = cylinders of 16065*512 = 8225280 bytes
Sector size (logical/physical): 512 bytes/512 bytes
I/O size (minimum/optimal): 512 bytes/512 bytes
Disk identifier: 0x00000000
Disk/dev/md0: 1000.1 GB, 1000070447104 bytes
2 heads, 4 Sectors/track, 244157824 Cylinders
Units = cylinders of 8*512 = 4096 bytes
Sector size (logical/physical): 512 bytes/512 bytes
I/O size (minimum/optimal): 524288 Bytes/524288 bytes
Disk identifier: 0xfa2f1e15
[[Email protected]/] # mdadm-C/dev/md0-c512-L1-N2/dev/SD [B-c] -- Auto = Yes
[[Email protected]/] # Cat/proc/mdstat
Personalities: [raid6] [RAID5] [raid4]
Md0: Active RAID5 SDC [2] SDB [0]
976631296 blocks super 1.2 Level 5,512 K chunk, algorithm 2 [2/1] [U _]
[================>...] Recovery = 74.4% (727073492/976631296) finish = 46.4 min speed = 89539 K/sec
Bitmap: 0/8 pages [0 KB], 65536kb chunk
Unused devices: <none>
[[Email protected]/] # mdadm-D/dev/md0
/Dev/md0:
Version: 1.2
Creation Time: Fri May 20 16:41:57 2016
Raid level: RAID5
Array size: 976631296 (931.39 gib 1000.07 GB)
Used Dev size: 976631296 (931.39 gib 1000.07 GB)
Raid devices: 2
Total devices: 2
Persistence: superblock is persistent
Intent bitmap: Internal
Update Time: Fri May 20 18:49:25 2016
State: clean, degraded, recovering
Active devices: 1
Working devices: 2
Failed devices: 0
Spare devices: 1
Layout: left-lateral ric
Chunk Size: 512 K
Rebuild status: 81% complete
Name: oth-bj-119-090-062-013: 0 (Local to host oth-bj-119-090-062-013)
UUID: 5e3e97cc: 441c6a7e: 5adc8f88: f21ec830
Events: 1553
Number major minor raiddevice state
0 8 16 0 Active Sync/dev/SDB
2 8 32 1 spare rebuilding/dev/SDC
Partitioning-formatting-attaching a disk-disk array