Chinaunix

标题: redhat soft RAID overview reference guide [打印本页]

作者: shinelian    时间: 2006-07-01 10:47
标题: redhat soft RAID overview reference guide
mdadm --create /dev/md0 --chunk=64 -l0 -n 2 /dev/sda5 /dev/sda6
mdadm -C /dev/md1 -l1 -n 2 /dev/sda7 /dev/sda8 -x 1 /dev/sda9
mdadm -C /dev/md0 -c 128 -l5 -n 2 /dev/sda5 /dev/sda6  -x 1 /dev/sda7
mdadm --detail /dev/md0

RAID0
[/url]
[root@localhost ~]# mdadm --stop /dev/md0
mdadm: fail to stop array /dev/md0: Device or resource busy
[root@localhost ~]# umount /dev/md0
[root@localhost ~]# mdadm --detail /dev/md0
/dev/md0:
        Version : 00.90.01
  Creation Time : Tue Jul  4 01:10:49 2006
     Raid Level : raid0
     Array Size : 208640 (203.75 MiB 213.65 MB)
   Raid Devices : 2
  Total Devices : 2
Preferred Minor : 0
    Persistence : Superblock is persistent

    Update Time : Tue Jul  4 01:10:49 2006
          State : clean
Active Devices : 2
Working Devices : 2
Failed Devices : 0
  Spare Devices : 0

     Chunk Size : 64K

    Number   Major   Minor   RaidDevice State
       0       8        5        0      active sync   /dev/sda5
       1       8        6        1      active sync   /dev/sda6
           UUID : 9a8b7859:803d9470:d09f745b:2a6d4c72
         Events : 0.1
[root@localhost ~]# cat /proc/mdstat
Personalities : [raid0] [raid1]
md1 : active raid1 sda9[2] sda8[1] sda7[0]
      104320 blocks [2/2] [UU]
      
md0 : active raid0 sda6[1] sda5[0]
      208640 blocks 64k chunks
      
unused devices:
[root@localhost ~]# mdadm --stop /dev/md0
[root@localhost ~]# cat /proc/mdstat
Personalities : [raid0] [raid1]
md1 : active raid1 sda9[2] sda8[1] sda7[0]
      104320 blocks [2/2] [UU]
      
unused devices:
[root@localhost ~]# mdadm --detail /dev/md0
mdadm: md device /dev/md0 does not appear to be active.
[root@localhost ~]#








RAID 1
[root@localhost ~]# mdadm --fail /dev/md1 /dev/sda8
mdadm: set /dev/sda8 faulty in /dev/md1
[root@localhost ~]# cat /proc/mdstat
Personalities : [raid0] [raid1]
md1 : active raid1 sda9[2] sda8[3](F) sda7[0]
      104320 blocks [2/1] [U_]
      [============>........]  recovery = 61.7% (65024/104320) finish=0.0min speed=65024K/sec
unused devices:
[root@localhost ~]# cat /proc/mdstat
Personalities : [raid0] [raid1]
md1 : active raid1 sda9[1] sda8[2](F) sda7[0]
      104320 blocks [2/2] [UU]
      
unused devices:
[root@localhost ~]# mdadm --remove /dev/sda8
mdadm: /dev/sda8 does not appear to be an md device
[root@localhost ~]# mdadm --remove /dev/md1 /dev/sda8
mdadm: hot removed /dev/sda8
[root@localhost ~]# cat /proc/mdstat
Personalities : [raid0] [raid1]
md1 : active raid1 sda9[1] sda7[0]
      104320 blocks [2/2] [UU]
      
unused devices:
[root@localhost ~]# mdadm --detail /dev/md1
/dev/md1:
        Version : 00.90.01
  Creation Time : Tue Jul  4 01:28:00 2006
     Raid Level : raid1
     Array Size : 104320 (101.88 MiB 106.82 MB)
    Device Size : 104320 (101.88 MiB 106.82 MB)
   Raid Devices : 2
  Total Devices : 2
Preferred Minor : 1
    Persistence : Superblock is persistent

    Update Time : Tue Jul  4 01:55:28 2006
          State : clean
Active Devices : 2
Working Devices : 2
Failed Devices : 0
  Spare Devices : 0


    Number   Major   Minor   RaidDevice State
       0       8        7        0      active sync   /dev/sda7
       1       8        9        1      active sync   /dev/sda9
           UUID : 43a5d28f:8da05b26:5cdc4a9f:bc67ae7f
         Events : 0.7
[root@localhost ~]# mdadm --add /dev/md1 /dev/sda10
mdadm: hot added /dev/sda10
[root@localhost ~]# mdadm --detail /dev/md1
/dev/md1:
        Version : 00.90.01
  Creation Time : Tue Jul  4 01:28:00 2006
     Raid Level : raid1
     Array Size : 104320 (101.88 MiB 106.82 MB)
    Device Size : 104320 (101.88 MiB 106.82 MB)
   Raid Devices : 2
  Total Devices : 3
Preferred Minor : 1
    Persistence : Superblock is persistent

    Update Time : Tue Jul  4 01:57:24 2006
          State : clean
Active Devices : 2
Working Devices : 3
Failed Devices : 0
  Spare Devices : 1


    Number   Major   Minor   RaidDevice State
       0       8        7        0      active sync   /dev/sda7
       1       8        9        1      active sync   /dev/sda9
       2       8       10       -1      spare   /dev/sda10
           UUID : 43a5d28f:8da05b26:5cdc4a9f:bc67ae7f
         Events : 0.8
[root@localhost ~]#

remove RAID
mdadm --stop  /dev/md0 /dev/md1
mdadm --zero-superblock /dev/sda[5-10]


[url=http://unthought.net/Software-RAID.HOWTO/Software-RAID.HOWTO.html#toc10]http://unthought.net/Software-RAID.HOWTO/Software-RAID.HOWTO.html#toc10

http://www.devil-linux.org/documentation/1.0.x/ch01s05.html
base on el4
http://kbase.redhat.com/faq/FAQ_80_3656.shtm


本文来自ChinaUnix博客,如果查看原文请点:http://blog.chinaunix.net/u/7198/showart_135083.html




欢迎光临 Chinaunix (http://bbs.chinaunix.net/) Powered by Discuz! X3.2