|
软RAID+LVM实现 Author:atyu30 (iopenbsd # gmail.com) 实验环境:
/dev/sda2 2 1044 8377897+ fd Linux raid autodetect Disk /dev/sdb: 8589 MB, 8589934592 bytes /dev/sdb1 * 1 1044 8385898+ fd Linux raid autodetect Disk /dev/sdc: 8589 MB, 8589934592 bytes /dev/sdc1 * 1 1044 8385898+ fd Linux raid autodetect
目的:实现RAID5 +LVM
大体流程: 建RAID5->建LVM(建PV->建VG->建LV)->格式化->使用 操作步骤:
1.创建raid5 # mdadm -C /dev/md0 --level=5 --raid-devices=3 /dev/sdb1 /dev/sdc1 /dev/sda2 mdadm: /dev/sdb1 appears to contain an ext2fs file system size=16771584K mtime=Mon Apr 14 19:59:29 2008 mdadm: /dev/sdb1 appears to be part of a raid array: level=raid0 devices=2 ctime=Mon Apr 14 19:52:42 2008 mdadm: /dev/sdc1 appears to be part of a raid array: level=raid0 devices=2 ctime=Mon Apr 14 19:52:42 2008 Continue creating array? Continue creating array? (y/n) y mdadm: array /dev/md0 started. # mdadm -D /dev/md0 /dev/md0: Version : 00.90.03 Creation Time : Mon Apr 14 21:29:00 2008 Raid Level : raid5 Array Size : 16755584 (15.98 GiB 17.16 GB) Device Size : 8377792 (7.99 GiB 8.58 GB) Raid Devices : 3 Total Devices : 3 Preferred Minor : 0 Persistence : Superblock is persistent
Update Time : Mon Apr 14 21:29:00 2008 State : clean, degraded, recovering Active Devices : 2 Working Devices : 3 Failed Devices : 0 Spare Devices : 1
Layout : left-symmetric Chunk Size : 64K
Rebuild Status : 6% complete
UUID : f19189bd:d760fee1:b1a384ad:f82cd785 Events : 0.1
Number Major Minor RaidDevice State 0 8 17 0 active sync /dev/sdb1 1 8 33 1 active sync /dev/sdc1 3 8 2 2 spare rebuilding /dev/sda2
2.创建lvm
2.1.创建pv
#pvcreate /dev/md0
2.2.创建vg
#vgscan
#vgcreate atyu30 /dev/md0
#vgdisplay atyu30
2.3.创建lv
#lvcreate -n data -l 125 atyu30
#lvcreate -n home -l 125 atyu30
3.格式化
#mkfs.ext3 /dev/atyu30/data
#mkfs.ext3 /dev/atyu30/home
4.使用RAID 5 + LVM # mount /dev/atyu30/data /share/ # mount /dev/atyu30/home /home/
|