mdadm linux 做軟磁碟陣列 raid0
我虛擬機器已經新增好三塊盤
[root@oracle ~]# fdisk -l
Disk /dev/sde: 1073 MB, 1073741824 bytes
255 heads, 63 sectors/track, 130 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/sdf: 1073 MB, 1073741824 bytes
255 heads, 63 sectors/track, 130 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/sdg: 1073 MB, 1073741824 bytes
255 heads, 63 sectors/track, 130 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
[root@oracle ~]# fdisk /dev/sde
Device contains neither a valid DOS partition table, nor Sun, SGI or OSF disklabel
Building a new DOS disklabel with disk identifier 0x382d838f.
Changes will remain in memory only, until you decide to write them.
After that, of course, the previous content won't be recoverable.
Warning: invalid flag 0x0000 of partition table 4 will be corrected by w(rite)
WARNING: DOS-compatible mode is deprecated. It's strongly recommended to
switch off the mode (command 'c') and change display units to
sectors (command 'u').
Command (m for help): n
Command action
e extended
p primary partition (1-4)
p
Partition number (1-4): 1
First cylinder (1-130, default 1):
Using default value 1
Last cylinder, +cylinders or +size{K,M,G} (1-130, default 130):
Using default value 130
Command (m for help): t
Selected partition 1
Hex code (type L to list codes): fd
Changed system type of partition 1 to fd (Linux raid autodetect)
Command (m for help): w
The partition table has been altered!
Calling ioctl() to re-read partition table.
Syncing disks.
其它兩塊盤做同樣的分割槽和標記
3第三步建立raid組
mdadm --create --verbose /dev/md0 --level=0 --raid-devices=3 /dev/sde1 /dev/sdf1 /dev/sdg1
第四步 配置檔案
echo DEVICE /dev/sd{e,f,g}1 >> /etc/mdadm.conf
mdadm - -detail - -scan >> /etc/mdadm.conf
第五步 穿件檔案系統
剛才建立的/dev/md0 現在可以做為一個磁碟裝置來使用
#mkfs.ext4 /dev/md0
mke2fs 1.41.12 (17-May-2010)
Filesystem label=
OS type: Linux
Block size=4096 (log=2)
Fragment size=4096 (log=2)
Stride=128 blocks, Stripe width=384 blocks
195840 inodes, 782976 blocks
39148 blocks (5.00%) reserved for the super user
First data block=0
Maximum filesystem blocks=805306368
24 block groups
32768 blocks per group, 32768 fragments per group
8160 inodes per group
Superblock backups stored on blocks:
32768, 98304, 163840, 229376, 294912
Writing inode tables: done
Creating journal (16384 blocks): done
Writing superblocks and filesystem accounting information: done
This filesystem will be automatically checked every 26 mounts or
180 days, whichever comes first. Use tune2fs -c or -i to override.
mkdir /raid0test
mount /dev/md0 /raid0test
第七步 隨機啟動自掛載磁碟
將mount /dev/md0 /raid0test 命令寫入 /dev/rc.local 中
echo mount /dev/md0 /raid0test >>/dev/rc.local
第八步 檢視raid 資訊
[root@oracle ~]# cat /proc/mdstat
Personalities : [raid0]
md0 : active raid0 sdg1[2] sdf1[1] sde1[0]
3131904 blocks super 1.2 512k chunks
unused devices:
[root@oracle ~]# mdadm --detail /dev/md0
/dev/md0:
Version : 1.2
Creation Time : Wed Feb 11 14:37:20 2015
Raid Level : raid0
Array Size : 3131904 (2.99 GiB 3.21 GB)
Raid Devices : 3
Total Devices : 3
Persistence : Superblock is persistent
Update Time : Wed Feb 11 14:37:20 2015
State : clean
Active Devices : 3
Working Devices : 3
Failed Devices : 0
Spare Devices : 0
Chunk Size : 512K
Name : oracle:0 (local to host oracle)
UUID : 2a4adf15:7f218c31:3f5fe32b:d27b7ca9
Events : 0
Number Major Minor RaidDevice State
0 8 65 0 active sync /dev/sde1
1 8 81 1 active sync /dev/sdf1
2 8 97 2 active sync /dev/sdg1
這裡使用的是一個mdadm 做的軟raid
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/26764973/viewspace-1435969/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- 如何使用linux程式mdadm建立軟體RAID1軟陣列LinuxAI陣列
- 伺服器磁碟陣列raid0資料恢復伺服器陣列AI資料恢復
- Linux--PAID磁碟陣列與陣列卡LinuxAI陣列
- 伺服器做磁碟陣列的好處伺服器陣列
- 磁碟陣列陣列
- Raid0/raid1/raid5磁碟陣列資料恢復思路AI陣列資料恢復
- 磁碟陣列配置陣列
- 磁碟陣列關於Raid0,Raid1,Raid5,Raid10陣列AI
- RAID磁碟陣列AI陣列
- 磁碟陣列RAID陣列AI
- MegaCli管理磁碟陣列陣列
- 磁碟陣列(Disk array)原理陣列
- 磁碟陣列RAID概述陣列AI
- Linux下RAID磁碟陣列的原理與搭建LinuxAI陣列
- RAID磁碟陣列與配置AI陣列
- 組磁碟陣列的主要作用陣列
- 廉價冗餘磁碟陣列陣列
- 認識RAID磁碟陣列AI陣列
- RAID磁碟陣列應用AI陣列
- 磁碟陣列操作手冊陣列
- 磁碟陣列(Disk array)原理(轉)陣列
- linux RAID10磁碟陣列損壞的修復LinuxAI陣列
- linux下用mdadm命令實現軟raid(zt)LinuxAI
- 磁碟陣列檢視命令 RAID陣列AI
- RAID 磁碟陣列的應用AI陣列
- 磁碟陣列可靠度的計算陣列
- 開源運維軟體 WGCLOUD 可以監控磁碟陣列嗎運維GCCloud陣列
- Linux Cluster 將磁碟做mirrorLinux
- Linux 陣列Linux陣列
- 磁碟陣列RAID工具:SoftRaid for Mac陣列AIMac
- 伺服器各種磁碟陣列詳解伺服器陣列
- 磁碟陣列,雙機熱備,負載均衡陣列負載
- 教程:RAID-5磁碟陣列故障分析AI陣列
- 【AIX】AIX系統下檢視磁碟陣列AI陣列
- CentOS8中配置RAID磁碟陣列CentOSAI陣列
- 組磁碟陣列的主要作用是什麼呢?陣列
- IBM EXP300磁碟陣列配置教程IBM陣列
- 二維陣列傳參做形參陣列