linux raid 0 raid 1 raid 10
1、首先分出兩個磁碟區
fdisk /dev/cciss/c0d0
Command (m for help): n
First cylinder (10978-36468, default 10978):
Using default value 10978
Last cylinder or +size or +sizeM or +sizeK (10978-36468, default 36468): 29212
Command (m for help): n
First cylinder (29213-36468, default 29213):
Using default value 29213
Last cylinder or +size or +sizeM or +sizeK (10978-36468, default 36468): 36468
Command (m for help): t
Partition number (1-6): 5
Hex code (type L to list codes): fd -----系統型別
Changed system type of partition 5 to fd (Linux raid autodetect)
Command (m for help): t
Partition number (1-6): 6
Hex code (type L to list codes): fd -----系統型別
Changed system type of partition 6 to fd (Linux raid autodetect)
這兩個系統型別一定要一樣的
系統型別分為以下幾百種:
0 Empty 1e Hidden W95 FAT1 80 Old Minix bf Solaris
1 FAT12 24 NEC DOS 81 Minix / old Lin c1 DRDOS/sec (FAT-
2 XENIX root 39 Plan 9 82 Linux swap / So c4 DRDOS/sec (FAT-
3 XENIX usr 3c PartitionMagic 83 Linux c6 DRDOS/sec (FAT-
4 FAT16 <32M 40 Venix 80286 84 OS/2 hidden C: c7 Syrinx
5 Extended 41 PPC PReP Boot 85 Linux extended da Non-FS data
6 FAT16 42 SFS 86 NTFS volume set db CP/M / CTOS / .
7 HPFS/NTFS 4d QNX4.x 87 NTFS volume set de Dell Utility
8 AIX 4e QNX4.x 2nd part 88 Linux plaintext df BootIt
9 AIX bootable 4f QNX4.x 3rd part 8e Linux LVM e1 DOS access
a OS/2 Boot Manag 50 OnTrack DM 93 Amoeba e3 DOS R/O
b W95 FAT32 51 OnTrack DM6 Aux 94 Amoeba BBT e4 SpeedStor
c W95 FAT32 (LBA) 52 CP/M 9f BSD/OS eb BeOS fs
e W95 FAT16 (LBA) 53 OnTrack DM6 Aux a0 IBM Thinkpad hi ee EFI GPT
f W95 Ext'd (LBA) 54 OnTrackDM6 a5 FreeBSD ef EFI (FAT-12/16/
10 OPUS 55 EZ-Drive a6 OpenBSD f0 Linux/PA-RISC b
11 Hidden FAT12 56 Golden Bow a7 NeXTSTEP f1 SpeedStor
12 Compaq diagnost 5c Priam Edisk a8 Darwin UFS f4 SpeedStor
14 Hidden FAT16 <3 61 SpeedStor a9 NetBSD f2 DOS secondary
16 Hidden FAT16 63 GNU HURD or Sys ab Darwin boot fb VMware VMFS
17 Hidden HPFS/NTF 64 Novell Netware b7 BSDI fs fc VMware VMKCORE
18 AST SmartSleep 65 Novell Netware b8 BSDI swap fd Linux raid auto
1b Hidden W95 FAT3 70 DiskSecure Mult bb Boot Wizard hid fe LANstep
1c Hidden W95 FAT3 75 PC/IX be Solaris boot ff BBT
2、格式化分割槽
partprobe
mkfs.ext3 /dev/cciss/c0d0p5
mkfs.ext3 /dev/cciss/c0d0p6
mkfs.ext3 /dev/cciss/c0d0p7
mkfs.ext3 /dev/cciss/c0d0p8
[root@localhost ~]# mkfs.ext3 /dev/cciss/c0d0p5
mke2fs 1.39 (29-May-2006)
Filesystem label=
OS type: Linux
Block size=4096 (log=2)
Fragment size=4096 (log=2)
18317312 inodes, 36618151 blocks
1830907 blocks (5.00%) reserved for the super user
First data block=0
Maximum filesystem blocks=4294967296
1118 block groups
32768 blocks per group, 32768 fragments per group
16384 inodes per group
Superblock backups stored on blocks:
32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632, 2654208,
4096000, 7962624, 11239424, 20480000, 23887872
Writing inode tables: done
Creating journal (32768 blocks): done
Writing superblocks and filesystem accounting information: done
This filesystem will be automatically checked every 27 mounts or
180 days, whichever comes first. Use tune2fs -c or -i to override.
mkfs.ext3 /dev/cciss/c0d0p6 類似與c0d0p5
3、建立軟RAID 0
mdadm -C /dev/md0 -a yes -l 0 -n 2 /dev/sda5 /dev/sda6
建立軟RAID 1
mdadm -C /dev/md1 -a yes -l 1 -n 2 /dev/cciss/c0d0p5 /dev/cciss/c0d0p6
建立軟RAID 10
mdadm -C /dev/md0 -a yes -l 0 -n 2 /dev/cciss/c0d0p5 /dev/cciss/c0d0p6
mdadm -C /dev/md1 -a yes -l 1 -n 2 /dev/cciss/c0d0p7 /dev/cciss/c0d0p8
mdadm -C /dev/md10 -a yes -l 10 -n 2 /dev/md0 /dev/md1
mdadm -detail /dev/md0
[root@localhost ~]# mdadm -C /dev/md1 -a yes -l 1 -n 2 /dev/cciss/c0d0p5 /dev/cciss/c0d0p6
mdadm: /dev/cciss/c0d0p5 appears to contain an ext2fs file system
size=146472604K mtime=Thu Jan 1 08:00:00 1970
mdadm: /dev/cciss/c0d0p6 appears to contain an ext2fs file system
size=58283788K mtime=Thu Jan 1 08:00:00 1970
mdadm: largest drive (/dev/cciss/c0d0p5) exceed size (58283712K) by more than 1%
4、建立完之後對整個格式化,因為此時這兩個分割槽已經在邏輯上屬於一個硬碟了。
mkfs.ext3 /dev/md1
[root@localhost ~]# mkfs.ext3 /dev/md1
mke2fs 1.39 (29-May-2006)
Filesystem label=
OS type: Linux
Block size=4096 (log=2)
Fragment size=4096 (log=2)
7290880 inodes, 14570928 blocks
728546 blocks (5.00%) reserved for the super user
First data block=0
Maximum filesystem blocks=4294967296
445 block groups
32768 blocks per group, 32768 fragments per group
16384 inodes per group
Superblock backups stored on blocks:
32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632, 2654208,
4096000, 7962624, 11239424
Writing inode tables: done
Writing superblocks and filesystem accounting information: done
This filesystem will be automatically checked every 20 mounts or
180 days, whichever comes first. Use tune2fs -c or -i to override.
more /proc/mdstat
[root@localhost ~]# more /proc/mdstat
Personalities : [raid1]
md1 : active raid1 cciss/c0d0p6[1] cciss/c0d0p5[0]
58283712 blocks [2/2] [UU]
[>....................] resync = 4.9% (2862080/58283712) finish=32.9min speed=28030K/sec
unused devices:
5、規定讀資料塊的大小
mkfs.ext3 -b 2048 -E stride=32 /dev/md0
mkfs.ext3 /dev/md10
6、下面可以直接掛載
建立目錄:/home
mount /dev/md10 /home
mdadm -D /dev/md1可以檢視詳細資訊
mdadm -D --scan /dev/md10 > /etc/mdadm.conf ----儲存資訊
mdadm -A --scan直接掛載
umount /home
mdadm -S /dev/md1
raid 10
mdadm -Ds > /etc/mdadm.conf-----正確的
mdadm -S /dev/md10
fdisk /dev/cciss/c0d0
Command (m for help): n
First cylinder (10978-36468, default 10978):
Using default value 10978
Last cylinder or +size or +sizeM or +sizeK (10978-36468, default 36468): 29212
Command (m for help): n
First cylinder (29213-36468, default 29213):
Using default value 29213
Last cylinder or +size or +sizeM or +sizeK (10978-36468, default 36468): 36468
Command (m for help): t
Partition number (1-6): 5
Hex code (type L to list codes): fd -----系統型別
Changed system type of partition 5 to fd (Linux raid autodetect)
Command (m for help): t
Partition number (1-6): 6
Hex code (type L to list codes): fd -----系統型別
Changed system type of partition 6 to fd (Linux raid autodetect)
這兩個系統型別一定要一樣的
系統型別分為以下幾百種:
0 Empty 1e Hidden W95 FAT1 80 Old Minix bf Solaris
1 FAT12 24 NEC DOS 81 Minix / old Lin c1 DRDOS/sec (FAT-
2 XENIX root 39 Plan 9 82 Linux swap / So c4 DRDOS/sec (FAT-
3 XENIX usr 3c PartitionMagic 83 Linux c6 DRDOS/sec (FAT-
4 FAT16 <32M 40 Venix 80286 84 OS/2 hidden C: c7 Syrinx
5 Extended 41 PPC PReP Boot 85 Linux extended da Non-FS data
6 FAT16 42 SFS 86 NTFS volume set db CP/M / CTOS / .
7 HPFS/NTFS 4d QNX4.x 87 NTFS volume set de Dell Utility
8 AIX 4e QNX4.x 2nd part 88 Linux plaintext df BootIt
9 AIX bootable 4f QNX4.x 3rd part 8e Linux LVM e1 DOS access
a OS/2 Boot Manag 50 OnTrack DM 93 Amoeba e3 DOS R/O
b W95 FAT32 51 OnTrack DM6 Aux 94 Amoeba BBT e4 SpeedStor
c W95 FAT32 (LBA) 52 CP/M 9f BSD/OS eb BeOS fs
e W95 FAT16 (LBA) 53 OnTrack DM6 Aux a0 IBM Thinkpad hi ee EFI GPT
f W95 Ext'd (LBA) 54 OnTrackDM6 a5 FreeBSD ef EFI (FAT-12/16/
10 OPUS 55 EZ-Drive a6 OpenBSD f0 Linux/PA-RISC b
11 Hidden FAT12 56 Golden Bow a7 NeXTSTEP f1 SpeedStor
12 Compaq diagnost 5c Priam Edisk a8 Darwin UFS f4 SpeedStor
14 Hidden FAT16 <3 61 SpeedStor a9 NetBSD f2 DOS secondary
16 Hidden FAT16 63 GNU HURD or Sys ab Darwin boot fb VMware VMFS
17 Hidden HPFS/NTF 64 Novell Netware b7 BSDI fs fc VMware VMKCORE
18 AST SmartSleep 65 Novell Netware b8 BSDI swap fd Linux raid auto
1b Hidden W95 FAT3 70 DiskSecure Mult bb Boot Wizard hid fe LANstep
1c Hidden W95 FAT3 75 PC/IX be Solaris boot ff BBT
2、格式化分割槽
partprobe
mkfs.ext3 /dev/cciss/c0d0p5
mkfs.ext3 /dev/cciss/c0d0p6
mkfs.ext3 /dev/cciss/c0d0p7
mkfs.ext3 /dev/cciss/c0d0p8
[root@localhost ~]# mkfs.ext3 /dev/cciss/c0d0p5
mke2fs 1.39 (29-May-2006)
Filesystem label=
OS type: Linux
Block size=4096 (log=2)
Fragment size=4096 (log=2)
18317312 inodes, 36618151 blocks
1830907 blocks (5.00%) reserved for the super user
First data block=0
Maximum filesystem blocks=4294967296
1118 block groups
32768 blocks per group, 32768 fragments per group
16384 inodes per group
Superblock backups stored on blocks:
32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632, 2654208,
4096000, 7962624, 11239424, 20480000, 23887872
Writing inode tables: done
Creating journal (32768 blocks): done
Writing superblocks and filesystem accounting information: done
This filesystem will be automatically checked every 27 mounts or
180 days, whichever comes first. Use tune2fs -c or -i to override.
mkfs.ext3 /dev/cciss/c0d0p6 類似與c0d0p5
3、建立軟RAID 0
mdadm -C /dev/md0 -a yes -l 0 -n 2 /dev/sda5 /dev/sda6
建立軟RAID 1
mdadm -C /dev/md1 -a yes -l 1 -n 2 /dev/cciss/c0d0p5 /dev/cciss/c0d0p6
建立軟RAID 10
mdadm -C /dev/md0 -a yes -l 0 -n 2 /dev/cciss/c0d0p5 /dev/cciss/c0d0p6
mdadm -C /dev/md1 -a yes -l 1 -n 2 /dev/cciss/c0d0p7 /dev/cciss/c0d0p8
mdadm -C /dev/md10 -a yes -l 10 -n 2 /dev/md0 /dev/md1
mdadm -detail /dev/md0
[root@localhost ~]# mdadm -C /dev/md1 -a yes -l 1 -n 2 /dev/cciss/c0d0p5 /dev/cciss/c0d0p6
mdadm: /dev/cciss/c0d0p5 appears to contain an ext2fs file system
size=146472604K mtime=Thu Jan 1 08:00:00 1970
mdadm: /dev/cciss/c0d0p6 appears to contain an ext2fs file system
size=58283788K mtime=Thu Jan 1 08:00:00 1970
mdadm: largest drive (/dev/cciss/c0d0p5) exceed size (58283712K) by more than 1%
4、建立完之後對整個格式化,因為此時這兩個分割槽已經在邏輯上屬於一個硬碟了。
mkfs.ext3 /dev/md1
[root@localhost ~]# mkfs.ext3 /dev/md1
mke2fs 1.39 (29-May-2006)
Filesystem label=
OS type: Linux
Block size=4096 (log=2)
Fragment size=4096 (log=2)
7290880 inodes, 14570928 blocks
728546 blocks (5.00%) reserved for the super user
First data block=0
Maximum filesystem blocks=4294967296
445 block groups
32768 blocks per group, 32768 fragments per group
16384 inodes per group
Superblock backups stored on blocks:
32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632, 2654208,
4096000, 7962624, 11239424
Writing inode tables: done
Writing superblocks and filesystem accounting information: done
This filesystem will be automatically checked every 20 mounts or
180 days, whichever comes first. Use tune2fs -c or -i to override.
more /proc/mdstat
[root@localhost ~]# more /proc/mdstat
Personalities : [raid1]
md1 : active raid1 cciss/c0d0p6[1] cciss/c0d0p5[0]
58283712 blocks [2/2] [UU]
[>....................] resync = 4.9% (2862080/58283712) finish=32.9min speed=28030K/sec
unused devices:
5、規定讀資料塊的大小
mkfs.ext3 -b 2048 -E stride=32 /dev/md0
mkfs.ext3 /dev/md10
6、下面可以直接掛載
建立目錄:/home
mount /dev/md10 /home
mdadm -D /dev/md1可以檢視詳細資訊
mdadm -D --scan /dev/md10 > /etc/mdadm.conf ----儲存資訊
mdadm -A --scan直接掛載
umount /home
mdadm -S /dev/md1
raid 10
mdadm -Ds > /etc/mdadm.conf-----正確的
mdadm -S /dev/md10
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/23205405/viewspace-775699/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- Raid Raid0 Raid1 Raid5 Raid0+1 Raid1+0AI
- raid1+0 and raid0+1AI
- RAID0、RAID1、RAID0+1、RAID5原理介紹AI
- 磁碟陣列關於Raid0,Raid1,Raid5,Raid10陣列AI
- 掃盲:Raid0、Raid1、Raid5及Raid10的區別AI
- RAID 1+0和RAID 0+1的區別AI
- Raid1 Raid2 Raid5 Raid6 Raid10如何選擇使用AI
- raid 0 1 5 概述AI
- sysbench fileio 壓測磁碟raid 5 raid 1 raid10 raid 50 情況AI
- Raid0/raid1/raid5磁碟陣列資料恢復思路AI陣列資料恢復
- RAID0+1介紹AI
- raid1 raid2 raid5 raid6 raid10的優缺點和做各自raid需要幾塊硬碟AI硬碟
- 以一起資料災難談RAID0+1及RAID1+0AI
- 一起資料災難談RAID0+1及RAID1+0轉載AI
- Raid0建立AI
- 在 Linux 下使用 RAID(三):用兩塊磁碟建立 RAID 1(映象)LinuxAI
- 轉載:RAID5和RAID10,哪種RAID更適合你AI
- RAIDAI
- oracle orion 壓測磁碟效能raid10 raid5 raid50 資料OracleAI
- RAID10與RAID5的異同比較AI
- Linux的軟RAIDLinuxAI
- 關於RAID10和RAID5的認識AI
- RAID卡AI
- 磁碟RAIDAI
- 伺服器RAID0+1資料恢復伺服器AI資料恢復
- 在 Linux 下配置 RAIDLinuxAI
- Linux RAID卡優化LinuxAI優化
- Linux Software RAID step by stepLinuxAI
- 在 Linux 下使用 RAID(一):介紹 RAID 的級別和概念LinuxAI
- mdadm linux 做軟磁碟陣列 raid0Linux陣列AI
- Raid詳解AI
- raid簡介AI
- RAID選項AI
- RAID技術AI
- raid問題AI
- raid與lunAI
- 配置RAID/修復RAID詳細文件,全程圖文(附lsi raid 卡模擬器)AI
- SOLARIS磁碟鏡象(RAID1)AI