1.RHEL5 默认就是支持RAID的
2.用 fdisk 分区,并设置为 FD 类型的。
# fdisk /dev/sdb
The number of cylinders for this disk is set to 1044.
There is nothing wrong with that, but this is larger than 1024,
and could in certain setups cause problems with:
1) software that runs at boot time (e.g., old versions of LILO)
2) booting and partitioning software from other OSs
(e.g., DOS FDISK, OS/2 FDISK)
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、使用mdadm 命令来建立一个 RAID 0 阵列/dev/md0.
# mdadm -C /dev/md0 --level=0 --raid-devices=2 /dev/sdb1 /dev/sdc1
mdadm: array /dev/md0 started.
4.使用mdadm -D命令查看/dev/md0
# mdadm -D /dev/md0
/dev/md0:
Version : 00.90.03
Creation Time : Mon Apr 14 19:52:42 2008
Raid Level : raid0
Array Size : 16771584 (15.99 GiB 17.17 GB)
Raid Devices : 2
Total Devices : 2
Preferred Minor : 0
Persistence : Superblock is persistent
Update Time : Mon Apr 14 19:52:42 2008
State : clean
Active Devices : 2
Working Devices : 2
Failed Devices : 0
Spare Devices : 0
Chunk Size : 64K
UUID : e1e0b8d2:8dce8ddf:62bd1034:37f666ee
Events : 0.1
Number Major Minor RaidDevice State
0 8 17 0 active sync /dev/sdb1
1 8 33 1 active sync /dev/sdc1
5.格式化raid
# mkfs.ext3 /dev/md0
mke2fs 1.39 (29-May-2006)
Filesystem label=
OS type: Linux
Block size=4096 (log=2)
Fragment size=4096 (log=2)
2097152 inodes, 4192896 blocks
209644 blocks (5.00%) reserved for the super user
First data block=0
Maximum filesystem blocks=0
128 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
Writing inode tables: done
Creating journal (32768 blocks): 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.
6.挂载RAID
# mount /dev/md0 /share/
# df -h
Filesystem Size Used Avail Use% Mounted on
/dev/sdd1 5.7G 2.0G 3.5G 36% /
tmpfs 125M 0 125M 0% /dev/shm
/dev/md0 16G 173M 15G 2% /share
#
# cat /proc/mdstat
Personalities : [raid6] [raid5] [raid4] [raid10] [raid1] [raid0]
md0 : active raid0 sdc1[1] sdb1[0]
16771584 blocks 64k chunks
unused devices:
阅读(2290) | 评论(0) | 转发(0) |