- 浏览: 2870671 次
- 性别:
- 来自: 上海
文章分类
- 全部博客 (2529)
- finance (1459)
- technology (218)
- life (343)
- play (150)
- technology-component (0)
- idea (6)
- house (74)
- health (75)
- work (32)
- joke (23)
- blog (1)
- amazing (13)
- important (22)
- study (13)
- Alternative (0)
- funny (8)
- stock_technology (12)
- business (16)
- car (21)
- decorate (4)
- basketball (2)
- English (16)
- banker (1)
- TheBest (1)
- sample (2)
- love (13)
- management (4)
最新评论
-
zhongmin2012:
BSM确实需要实践,标准ITIL服务流程支持,要做好,需要花费 ...
BSM实施之前做什么 -
shw340518:
提示楼主,有时间逻辑bug:是你妈二十那年写的 那会儿连你爹都 ...
80后辣妈给未来儿子的信~我的儿,你也给我记住了~~~ -
guoapeng:
有相关的文档吗?
it项目管理表格(包含146个DOC文档模板) -
solomon:
看到的都是 这种 CTRL+C 和 CTRL+V 的文章, ...
Designing a website with InfoGlue components -
wendal:
恩, 不错. 有参考价值
Designing a website with InfoGlue components
http://blog.csdn.net/chinalinuxzend/archive/2007/10/29/1854279.aspx
http://blog.csdn.net/sense5/archive/2007/10/17/1828868.aspx
mdadm使用详解及RAID 5简单分析
< src="http://blog.csdn.net/count.aspx?ID=1828868&Type=Rank"
type="text/javascript">
RAID Calculator ( en | ch ) & RAID Summary Comparison ( en | ch ) beta @ my googlepage
★什么是mdadm?
★为什么选择mdadm?
mdadm 和 raidtools 主要有以下几点不同 :
- mdadm能够诊断、监控和收集详细的阵列信息
- mdadm是一个单独集成化的程序而不是一些分散程序的集合,因此对不同RAID管理命令有共通的语法
- mdadm能够执行几乎所有的功能而不需要配置文件(也没有默认的配置文件)
- 当然,如果需要一个配置文件,mdadm将帮助管理它的内容
★准备工作
★下载、安装mdadm
安装步骤如下:
eric4ever@192.168.254.30's password:
Last login: Thu May 24 10:59:06 2007 from 192.168.254.1
[root@localhost eric4ever]# ls -lh
total 208K
-rw-r--r-- 1 root root 201K May 24 11:01 LATEST.tgz
[root@localhost eric4ever]# tar zxvf LATEST.tgz
mdadm-2.6.2/
mdadm-2.6.2/mdadm.conf-example
mdadm-2.6.2/misc/
mdadm-2.6.2/misc/syslog-events
mdadm-2.6.2/md_u.h
mdadm-2.6.2/TODO
mdadm-2.6.2/ANNOUNCE-2.0
mdadm-2.6.2/kernel-patch-2.6.18
mdadm-2.6.2/Query.c
mdadm-2.6.2/ReadMe.c
mdadm-2.6.2/super0.c
mdadm-2.6.2/SHA1.c
mdadm-2.6.2/ANNOUNCE-2.6
mdadm-2.6.2/ANNOUNCE-2.6.1
mdadm-2.6.2/Monitor.c
mdadm-2.6.2/md_p.h
mdadm-2.6.2/mdassemble.c
mdadm-2.6.2/mdadm.h
mdadm-2.6.2/mdadm.spec
mdadm-2.6.2/mdadm.c
mdadm-2.6.2/Assemble.c
mdadm-2.6.2/Kill.c
mdadm-2.6.2/ANNOUNCE-2.1
mdadm-2.6.2/pwgr.c
mdadm-2.6.2/Incremental.c
mdadm-2.6.2/mapfile.c
mdadm-2.6.2/Grow.c
mdadm-2.6.2/tests/
mdadm-2.6.2/tests/00raid4
mdadm-2.6.2/tests/05r6-bitmapfile
mdadm-2.6.2/tests/02r6grow
mdadm-2.6.2/tests/03r5assem
mdadm-2.6.2/tests/07testreshape5
mdadm-2.6.2/tests/05r1-internalbitmap-v1c
mdadm-2.6.2/tests/02r5grow
mdadm-2.6.2/tests/05r1-re-add
mdadm-2.6.2/tests/00raid6
mdadm-2.6.2/tests/01r5fail
mdadm-2.6.2/tests/06update-uuid
mdadm-2.6.2/tests/05r1-bitmapfile
mdadm-2.6.2/tests/02r1grow
mdadm-2.6.2/tests/05r1-n3-bitmapfile
mdadm-2.6.2/tests/06wrmostly
mdadm-2.6.2/tests/05r1-re-add-nosuper
mdadm-2.6.2/tests/00raid5
mdadm-2.6.2/tests/03r5assemV1
mdadm-2.6.2/tests/00multipath
mdadm-2.6.2/tests/05r1-internalbitmap-v1b
mdadm-2.6.2/tests/06name
mdadm-2.6.2/tests/05r1-grow-internal-1
mdadm-2.6.2/tests/01r1fail
mdadm-2.6.2/tests/00raid0
mdadm-2.6.2/tests/05r1-grow-external
mdadm-2.6.2/tests/06r5swap
mdadm-2.6.2/tests/07autodetect
mdadm-2.6.2/tests/05r1-internalbitmap
mdadm-2.6.2/tests/02lineargrow
mdadm-2.6.2/tests/00raid1
mdadm-2.6.2/tests/testdev
mdadm-2.6.2/tests/05r5-internalbitmap
mdadm-2.6.2/tests/00raid10
mdadm-2.6.2/tests/ToTest
mdadm-2.6.2/tests/05r5-bitmapfile
mdadm-2.6.2/tests/04r0update
mdadm-2.6.2/tests/02r1add
mdadm-2.6.2/tests/03r0assem
mdadm-2.6.2/tests/check
mdadm-2.6.2/tests/06sysfs
mdadm-2.6.2/tests/05r1-grow-internal
mdadm-2.6.2/tests/04r1update
mdadm-2.6.2/tests/00linear
mdadm-2.6.2/tests/05r1-internalbitmap-v1a
mdadm-2.6.2/mdassemble.8
mdadm-2.6.2/restripe.c
mdadm-2.6.2/Manage.c
mdadm-2.6.2/md.4
mdadm-2.6.2/ANNOUNCE-2.5
mdadm-2.6.2/ChangeLog
mdadm-2.6.2/Examine.c
mdadm-2.6.2/ANNOUNCE-2.5.1
mdadm-2.6.2/sha1.h
mdadm-2.6.2/inventory
mdadm-2.6.2/ANNOUNCE-2.3
mdadm-2.6.2/sha1.c
mdadm-2.6.2/raid5extend.c
mdadm-2.6.2/bitmap.c
mdadm-2.6.2/ANNOUNCE-2.6.2
mdadm-2.6.2/ANNOUNCE-2.5.3
mdadm-2.6.2/dlink.c
mdadm-2.6.2/md5.h
mdadm-2.6.2/config.c
mdadm-2.6.2/mdadm.conf.5
mdadm-2.6.2/mkinitramfs
mdadm-2.6.2/swap_super.c
mdadm-2.6.2/bitmap.h
mdadm-2.6.2/test
mdadm-2.6.2/mdopen.c
mdadm-2.6.2/ANNOUNCE-2.5.5
mdadm-2.6.2/Create.c
mdadm-2.6.2/kernel-patch-2.6.19
mdadm-2.6.2/mdadm.8
mdadm-2.6.2/ANNOUNCE-2.2
mdadm-2.6.2/ANNOUNCE-2.5.4
mdadm-2.6.2/COPYING
mdadm-2.6.2/sysfs.c
mdadm-2.6.2/super1.c
mdadm-2.6.2/Makefile
mdadm-2.6.2/util.c
mdadm-2.6.2/INSTALL
mdadm-2.6.2/mdstat.c
mdadm-2.6.2/ANNOUNCE-2.4.1
mdadm-2.6.2/dlink.h
mdadm-2.6.2/ANNOUNCE-2.5.6
mdadm-2.6.2/ANNOUNCE-2.3.1
mdadm-2.6.2/makedist
mdadm-2.6.2/kernel-patch-2.6.18.6
mdadm-2.6.2/ANNOUNCE-2.5.2
mdadm-2.6.2/ANNOUNCE-2.4-pre1
mdadm-2.6.2/Detail.c
mdadm-2.6.2/README.initramfs
mdadm-2.6.2/ANNOUNCE-2.4
mdadm-2.6.2/Build.c
[root@localhost eric4ever]# ls -lh
total 212K
-rw-r--r-- 1 root root 201K May 24 11:01 LATEST.tgz
drwxr-xr-x 4 1000 1000 4.0K May 21 12:25 mdadm-2.6.2
[root@localhost eric4ever]# cd mdadm-2.6.2/
[root@localhost mdadm-2.6.2]# make install
/usr/bin/install
-D -m 644 mdadm.8 /usr/share/man/man8/mdadm.8 |
[root@localhost mdadm-2.6.2]#
你也可以使用基于RPM的发布包,你可以从这里 下载,不过最新的RPM为2.6-1 版本:
★mdadm简介
基 本语法 :
目前支持 :
模式(7种):
- Assemble:加入一个以前定义的阵列
- Build:创建一个没有超级块的阵列
- Create:创建一个新的阵列,每个设备具有超级块
- Manage: 管理阵列(如添加和删除)
- Misc:允许单独对阵列中的某个设备进行操作(如停止阵列)
- Follow or Monitor:监控RAID的状态
- Grow:改变RAID的容量或阵列中的设备数目
选项:
-A, --assemble:加入一个以前定义的阵列
-B, --build:创建一个没有超级块的阵列(Build a legacy array without superblocks.)
-C, --create:创建一个新的阵列
-F, --follow, --monitor:选择监控(Monitor)模式
-G, --grow:改变激活阵列的大小或形态
-I, --incremental:添加一个单独的设备到合适的阵列,并可能启动阵列
--auto- detect:请求内核启动任何自动检测到的阵列
-h, --help:帮助信息,用在以上选项后,则显示该选项信息
--help- options:显示更详细的帮助
-V, --version:打印mdadm的版本信息
-v, --verbose:显示细节
-b, --brief:较少的细节。用于 --detail 和 --examine 选项
-Q, --query:查看一个device,判断它为一个 md device 或是 一个 md 阵列的一部分
-D, --detail:打印一个或多个 md device 的详细信息
-E, --examine:打印 device 上的 md superblock 的内容
-c, --config= :指定配置文件,缺省为 /etc/mdadm.conf
-s, --scan:扫描配置文件或 /proc/mdstat以搜寻丢失的信息。配置文件/etc/mdadm.conf
★使用mdadm创建RAID5
Usage: mdadm --create device -chunk=X --level=Y --raid-devices=Z devices
This usage will initialise a new md array, associate some
devices with it, and activate the array. In order to create an
array with some devices missing, use the special word 'missing' in
place of the relevant device name.
Before devices are added, they are checked to see if they already contain
raid superblocks or filesystems. They are also checked to see if
the variance in device size exceeds 1%.
If any discrepancy is found, the user will be prompted for confirmation
before the array is created. The presence of a '--run' can override this
caution.
If the --size option is given then only that many kilobytes of each
device is used, no matter how big each device is.
If no --size is given, the apparent size of the smallest drive given
is used for raid level 1 and greater, and the full device is used for
other levels.
Options that are valid with --create (-C) are:
--bitmap= : Create a bitmap for the array with the given filename
--chunk= -c : chunk size of kibibytes
--rounding= : rounding factor for linear array (==chunk size)
--level= -l : raid level: 0,1,4,5,6,linear,multipath and synonyms
--parity= -p : raid5/6 parity algorithm: {left,right}-{,a}symmetric
--layout= : same as --parity
--raid-devices= -n : number of active devices in array
--spare-devices= -x: number of spares (eXtras) devices in initial array
--size= -z : Size (in K) of each drive in RAID1/4/5/6/10 - optional
--force -f : Honour devices as listed on command line. Don't
: insert a missing drive for RAID5.
--run -R : insist of running the array even if not all
: devices are present or some look odd.
--readonly -o : start the array readonly - not supported yet.
--name= -N : Textual name for array - max 32 characters
--bitmap-chunk= : bitmap chunksize in Kilobytes.
--delay= -d : bitmap update delay in seconds.
接下来我们使用mdadm 创建在/dev/md0上创建一个由sdb、sdc、sdd 3块盘组成(另外1块盘sde 为 热备)的RAID5:
mdadm: layout defaults to left-symmetric
mdadm: chunk size defaults to 64K
mdadm: size set to 8388544K
mdadm: array /dev/md0 started.
每个mdadm 的选项都有一个缩 写 的形式,例如,上面我们创建RAID 5的命令可以使用下列的缩写形式:
二者的效果是相同的。
★查看RAID状态
Every 10s: cat /proc/mdstat Thu May 24 11:53:46 2007
Personalities : [raid5]
read_ahead 1024 sectors
md0 : active raid5 sdd[4] sde[3] sdc[1] sdb[0]
16777088 blocks level 5, 64k chunk, algorithm 2 [3/2] [UU_]
[====>................] recovery = 24.0% (2016364/8388544) finish=10.2min
speed=10324K/sec
unused devices: <none>
[root@localhost mdadm-2.6.2]#
接下来我们为阵列创建文件系统:
mke2fs 1.34 (25-Jul-2003)
Filesystem label=
OS type: Linux
Block size=4096 (log=2)
Fragment size=4096 (log=2)
2097152 inodes, 4194272 blocks
209713 blocks (5.00%) reserved for the super user
First data block=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 (8192 blocks): done
Writing superblocks and filesystem accounting information: done
This filesystem will be automatically checked every 34 mounts or
180 days, whichever comes first. Use tune2fs -c or -i to override.
You have new mail in /var/spool/mail/root
我们尝试向RAID中写入一个test2文件:
copy succeed!
eric@tlf
[url]http://eric4ever.googlepages.com/[/url]
done!
[root@localhost eric4ever]# ls
LATEST.tgz mdadm-2.6.2 test2
[root@localhost eric4ever]# mount /dev/md0 /mnt/md0
[root@localhost eric4ever]# df -lh
Filesystem Size Used Avail Use% Mounted on
/dev/sda1 2.9G 1.8G 1.1G 63% /
/dev/sda3 4.6G 33M 4.3G 1% /opt
none 125M 0 125M 0% /dev/shm
/dev/md0 16G 33M 15G 1% /mnt/md0
[root@localhost eric4ever]# ls /mnt/md0
lost+found
[root@localhost eric4ever]# cp ./test2 /mnt/md0
[root@localhost eric4ever]# ls /mnt/md0
lost+found test2
[root@localhost eric4ever]# ls -lh /mnt/md0
total 20K
drwx------ 2 root root 16K May 24 11:55 lost+found
-rw-r--r-- 1 root root 63 May 24 11:56 test2
使用mdadm --detail /dev/md0 (或mdadm -D /dev/md0 )命令以及cat /proc/mdstat 命令可以查看RAID设备的状态:
/dev/md0:
Version : 00.90.00
Creation Time : Thu May 24 13:45:35 2007
Raid Level : raid5
Array Size : 16777088 (16.00 GiB 17.18 GB)
Used Dev Size : 8388544 (8.00 GiB 8.59 GB)
Raid Devices : 3
Total Devices : 5
Preferred Minor : 0
Persistence : Superblock is persistent
Update Time : Thu May 24 13:45:36 2007
State : active, degraded, recovering
Active Devices : 2
Working Devices : 4
Failed Devices : 1
Spare Devices : 2
Layout : left-symmetric
Chunk Size : 64K
Rebuild Status : 16% complete
UUID : 4b15050e:7d0c477d:98ed7d00:0f3c29e4
Events : 0.2
Number Major Minor RaidDevice State
0 8 16 0 active sync /dev/sdb
1 8 32 1 active sync /dev/sdc
2 0 0 2 removed
3 8 64 3 spare /dev/sde
4 8 48 4 spare /dev/sdd
通过mdadm -D 命令,我们可以查看RAID的版本、创建的时间、RAID级别、阵列容量、可用空间、设备数量、超级块、更新时间、各个设备的状态、RAID算法以及 块大小 等信息,通过上面的信息我们可以看到目前RAID正处于重建 过程之中, 进度为16% ,其中/dev/sdb 和/dev/sdc 两块盘已经同步 。使用watch 命令每个30秒刷新一下查看的进度:
Every 30s: cat /proc/mdstat Thu May 24 13:55:56 2007
Personalities : [raid5]
read_ahead 1024 sectors
md0 : active raid5 sdd[4] sde[3] sdc[1] sdb[0]
16777088 blocks level 5, 64k chunk, algorithm 2 [3/2] [UU_]
[==============>......] recovery = 72.3% (6067444/8388544) finish=3.7min
speed=10324K/sec
unused devices: <none>
当进度进行到100% 时,显示如下:
Personalities : [raid5]
read_ahead 1024 sectors
md0 : active raid5 sdd[2] sde[3] sdc[1] sdb[0]
16777088 blocks level 5, 64k chunk, algorithm 2 [3/3] [UUU]
unused devices: <none>
这是我们再使用mdadm -D 命令查看一下:
/dev/md0:
Version : 00.90.00
Creation Time : Thu May 24 13:45:35 2007
Raid Level : raid5
Array Size : 16777088 (16.00 GiB 17.18 GB)
Used Dev Size : 8388544 (8.00 GiB 8.59 GB)
Raid Devices : 3
Total Devices : 5
Preferred Minor : 0
Persistence : Superblock is persistent
Update Time : Thu May 24 13:59:48 2007
State : active
Active Devices : 3
Working Devices : 4
Failed Devices : 1
Spare Devices : 1
Layout : left-symmetric
Chunk Size : 64K
UUID : 4b15050e:7d0c477d:98ed7d00:0f3c29e4
Events : 0.3
Number Major Minor RaidDevice State
0 8 16 0 active sync /dev/sdb
1 8 32 1 active sync /dev/sdc
2 8 48 2 active sync /dev/sdd
3 8 64 3 spare /dev/sde
这时我们可以发现sdb、sdc、sdd 三块盘均已经同步。
一 般来说,一个新阵列被创建后我们最好创建一个/etc/mdadm.conf文件。没有该文件在激活阵列时我们就得指定更详细的信息,为方便,我们使用下 列命令:
ARRAY /dev/md0 level=raid5 num-devices=3 spares=1 UUID=4b15050e:7d0c477d:98ed7d00:0f3c29e4
[root@localhost eric4ever]# mdadm --detail --scan >> /etc/mdadm.conf
[root@localhost eric4ever]# cat /etc/mdadm.conf
ARRAY /dev/md0 level=raid5 num-devices=3 spares=1 UUID=4b15050e:7d0c477d:98ed7d00:0f3c29e4
★ 启动停止RAID
[root@localhost eric4ever]# mdadm -S /dev/md0 (或mdadm --stop /dev/md0)
mdadm: stopped /dev/md0
重新启动可以使用:
mdadm: /dev/md0 has been started with 3 drives and 1 spare.
★模拟故障
Usage: mdadm arraydevice options component devices...
This usage is for managing the component devices within an array.
The --manage option is not needed and is assumed if the first argument
is a device name or a management option.
The first device listed will be taken to be an md array device, and
subsequent devices are (potential) components of that array.
Options that are valid with management mode are:
--add -a : hotadd subsequent devices to the array
--remove -r : remove subsequent devices, which must not be active
--fail -f : mark subsequent devices a faulty
--set-faulty : same as --fail
--run -R : start a partially built array
--stop -S : deactivate array, releasing all resources
--readonly -o : mark array as readonly
--readwrite -w : mark array as readwrite
[root@localhost eric4ever]# mdadm --fail --help
Usage: mdadm arraydevice options component devices...
This usage is for managing the component devices within an array.
The --manage option is not needed and is assumed if the first argument
is a device name or a management option.
The first device listed will be taken to be an md array device, and
subsequent devices are (potential) components of that array.
Options that are valid with management mode are:
--add -a : hotadd subsequent devices to the array
--remove -r : remove subsequent devices, which must not be active
--fail -f : mark subsequent devices a faulty
--set-faulty : same as --fail
--run -R : start a partially built array
--stop -S : deactivate array, releasing all resources
--readonly -o : mark array as readonly
--readwrite -w : mark array as readwrite
接下来我们模拟/dev/sdb 故障:
mdadm: set /dev/sdb faulty in /dev/md0
查看一下系统日志,如果你配置了冗余磁盘,可能会显示如下信息:
kernel: md0: resyncing spare disk sde to replace failed disk
检查/proc/mdstat ,如果配置的冗余磁盘可用,阵列可能已经开始 重建。
首先我们使用mdadm --detail /dev/md0 命令来 查看一下RAID的状态:
/dev/md0:
Version : 00.90.00
Creation Time : Thu May 24 13:45:35 2007
Raid Level : raid5
Array Size : 16777088 (16.00 GiB 17.18 GB)
Used Dev Size : 8388544 (8.00 GiB 8.59 GB)
Raid Devices : 3
Total Devices : 5
Preferred Minor : 0
Persistence : Superblock is persistent
Update Time : Thu May 24 14:07:55 2007
State : active, degraded, recovering
Active Devices : 2
Working Devices : 3
Failed Devices : 2
Spare Devices : 1
Layout : left-symmetric
Chunk Size : 64K
Rebuild Status : 3% complete
UUID : 4b15050e:7d0c477d:98ed7d00:0f3c29e4
Events : 0.6
Number Major Minor RaidDevice State
0 8 16 0 faulty spare /dev/sdb
1 8 32 1 active sync /dev/sdc
2 8 48 2 active sync /dev/sdd
3 8 64 3 spare rebuilding /dev/sde
查看/proc/mdstat :
Personalities : [raid5]
read_ahead 1024 sectors
md0 : active raid5 sdb[4] sde[3] sdd[2] sdc[1]
16777088 blocks level 5, 64k chunk, algorithm 2 [3/2] [_UU]
[==>..................] recovery = 10.2% (858824/8388544) finish=12.4min speed=10076K/sec
unused devices: <none>
再查看一下RAID状态:
/dev/md0:
Version : 00.90.00
Creation Time : Thu May 24 13:45:35 2007
Raid Level : raid5
Array Size : 16777088 (16.00 GiB 17.18 GB)
Used Dev Size : 8388544 (8.00 GiB 8.59 GB)
Raid Devices : 3
Total Devices : 5
Preferred Minor : 0
Persistence : Superblock is persistent
Update Time : Thu May 24 14:08:27 2007
State : active, degraded, recovering
Active Devices : 2
Working Devices : 4
Failed Devices : 1
Spare Devices : 2
Layout : left-symmetric
Chunk Size : 64K
Rebuild Status : 11% complete
UUID : 4b15050e:7d0c477d:98ed7d00:0f3c29e4
Events : 0.8
Number Major Minor RaidDevice State
0 0 0 0 removed
1 8 32 1 active sync /dev/sdc
2 8 48 2 active sync /dev/sdd
3 8 64 3 spare /dev/sde
4 8 16 4 spare /dev/sdb
已经完成到11% 了。查看一下日志消息:
May 24 14:08:27 localhost kernel: --- rd:3 wd:2 fd:1
May 24 14:08:27 localhost kernel: disk 0, s:0, o:0, n:0 rd:0 us:0 dev:[dev 00:00]
May 24 14:08:27 localhost kernel: disk 1, s:0, o:1, n:1 rd:1 us:1 dev:sdc
May 24 14:08:27 localhost kernel: disk 2, s:0, o:1, n:2 rd:2 us:1 dev:sdd
May 24 14:08:27 localhost kernel: RAID5 conf printout:
May 24 14:08:27 localhost kernel: --- rd:3 wd:2 fd:1
May 24 14:08:27 localhost kernel: disk 0, s:0, o:0, n:0 rd:0 us:0 dev:[dev 00:00]
May 24 14:08:27 localhost kernel: disk 1, s:0, o:1, n:1 rd:1 us:1 dev:sdc
May 24 14:08:27 localhost kernel: disk 2, s:0, o:1, n:2 rd:2 us:1 dev:sdd
May 24 14:08:27 localhost kernel: md: cannot remove active disk sde from md0 ...
使用mdadm -E 命令查看一下/dev/sdb 的情况:
/dev/sdb:
Magic : a92b4efc
Version : 00.90.00
UUID : 4b15050e:7d0c477d:98ed7d00:0f3c29e4
Creation Time : Thu May 24 13:45:35 2007
Raid Level : raid5
Used Dev Size : 8388544 (8.00 GiB 8.59 GB)
Array Size : 16777088 (16.00 GiB 17.18 GB)
Raid Devices : 3
Total Devices : 5
Preferred Minor : 0
Update Time : Thu May 24 14:08:27 2007
State : active
Active Devices : 2
Working Devices : 4
Failed Devices : 1
Spare Devices : 2
Checksum : a6a19662 - correct
Events : 0.8
Layout : left-symmetric
Chunk Size : 64K
Number Major Minor RaidDevice State
this 4 8 16 4 spare /dev/sdb
0 0 0 0 0 faulty removed
1 1 8 32 1 active sync /dev/sdc
2 2 8 48 2 active sync /dev/sdd
3 3 8 64 3 spare /dev/sde
4 4 8 16 4 spare /dev/sdb
自动修复完成后,我们再查看一下RAID的状态:
/dev/md0:
Version : 00.90.00
Creation Time : Thu May 24 13:45:35 2007
Raid Level : raid5
Array Size : 16777088 (16.00 GiB 17.18 GB)
Used Dev Size : 8388544 (8.00 GiB 8.59 GB)
Raid Devices : 3
Total Devices : 5
Preferred Minor : 0
Persistence : Superblock is persistent
Update Time : Thu May 24 14:21:54 2007
State : active
Active Devices : 3
Working Devices : 4
Failed Devices : 1
Spare Devices : 1
Layout : left-symmetric
Chunk Size : 64K
UUID : 4b15050e:7d0c477d:98ed7d00:0f3c29e4
Events : 0.9
Number Major Minor RaidDevice State
0 8 64 0 active sync /dev/sde
1 8 32 1 active sync /dev/sdc
2 8 48 2 active sync /dev/sdd
4 8 16 4 spare /dev/sdb
[root@localhost eric4ever]# cat /proc/mdstat
Personalities : [raid5]
read_ahead 1024 sectors
md0 : active raid5 sdb[4] sde[0] sdd[2] sdc[1]
16777088 blocks level 5, 64k chunk, algorithm 2 [3/3] [UUU]
unused devices: <none>
我们可以看到/dev/sde 已经替换了/dev/sdb 。看看系统的日志消息:
May 24 14:21:54 localhost kernel: --- rd:3 wd:3 fd:0
May 24 14:21:54 localhost kernel: disk 0, s:0, o:1, n:0 rd:0 us:1 dev:sde
May 24 14:21:54 localhost kernel: disk 1, s:0, o:1, n:1 rd:1 us:1 dev:sdc
May 24 14:21:54 localhost kernel: disk 2, s:0, o:1, n:2 rd:2 us:1 dev:sdd
May 24 14:21:54 localhost kernel: md: updating md0 RAID superblock on device
May 24 14:21:54 localhost kernel: md: sdb [events: 00000009]<6>(write) sdb's sb offset: 8388544
May 24 14:21:54 localhost kernel: md: sde [events: 00000009]<6>(write) sde's sb offset: 8388544
May 24 14:21:54 localhost kernel: md: sdd [events: 00000009]<6>(write) sdd's sb offset: 8388544
May 24 14:21:54 localhost kernel: md: sdc [events: 00000009]<6>(write) sdc's sb offset: 8388544
May 24 14:21:54 localhost kernel: md: recovery thread got woken up ...
recovery thread got woken up ...
这 时我们可以从/dev/md0 中移除/dev/sdb 设 备:
mdadm: hot removed /dev/sdb
类似地,我们可以使用下列命令向/dev/md0 中添加一个设备:
★监控RAID
当使用监控模式时,mdadm不会退出,你可以使用下列命令:
[1] 3113
[root@localhost eric4ever]# nohup: appending output to `nohup.out'
Trackback: http://tb.blog.csdn.net/TrackBack.aspx?PostId=1828868
发表评论
-
New Enterprise Security Solutions
2011-09-13 15:46 0<!-- [if !mso]> <styl ... -
ES Announces Enterprise Security Solutions
2011-09-13 15:40 0<!-- [if !mso]> <styl ... -
linux下如何将文件打包、压缩并分割成制定大小?
2010-09-15 18:52 3266将大文件或目录打包、 ... -
rhel4 yum安装, 使用
2010-09-07 16:37 0第一种方法: yum源来自chinalinuxpub.com ... -
Windows: 远程自动安装程序
2010-08-26 15:48 1033问题的提出 作为 ... -
Oracle体系结构
2010-08-07 09:53 964Oracle体系结构 Oracle Server包括Oracl ... -
ocp sesson 3
2010-07-31 14:39 0show parameter undo 只有 默认情况下服务 ... -
ocp session 2
2010-07-25 17:00 0/home/oracle/raInventory/orains ... -
ocp session 1
2010-07-24 13:02 0ocp first lesson D:\oracle_cou ... -
Python的xmlrpc调试
2010-07-19 23:55 2065Python的xmlrpc 调 试 ----------- ... -
Linux的lvm的基本配置步骤
2010-07-11 14:53 12401.增加硬件 增加的ide硬盘前缀为hd,scs ... -
OCP study material
2010-07-11 13:52 0\\192.168.1.105watch -n 1 'stat ... -
apache+python+mod_python+django 编译安装指南
2010-06-24 17:25 14371、本文将知道你在 linux 下使用源码包安装 ... -
在ubuntu下配置apache运行python脚本
2010-06-22 16:11 2230常用的简单命令 sudo apt ... -
Python 2.5 Quick Reference
2010-06-21 11:18 1407... -
shell 面试题汇集
2010-06-10 19:50 1000利用 top 取某个进程的 CPU 的脚本 : ... -
shell程序面试题
2010-06-10 19:48 27611.要求分析Apache访问日志,找出里面数量在前面100位的 ... -
EMC技术支持工程师笔试部分试题回忆
2010-06-07 15:16 1591要查看更多EMC公司笔经相关信息,请访问EMC公司校园招聘CL ... -
linux shell 条件语句
2010-06-03 23:29 1729... -
删除所有表的所有记录(MSSQL)
2010-05-25 14:20 1529昨天对一测试库要删除所有记录后生成一个备份 ...
相关推荐
详细说明mdadm在RAID中各种命令的作用
使用mdadm创建软RAID的具体操作步骤
mdadm建立软RAID
基于linux的mdadm4.1的源码,支持嵌入式移植。
在 RAID 5 中,数据条带化后存储在分布式奇偶校验的多个磁盘上。分布式奇偶校验的条带 化意味着它将奇偶校验信息和条带化数据分布在多个磁盘上,这样会有很好的数据冗余。
mdadm raid 创建阵列 管理阵列 linux阵列的使用与管理
目前市场上有多种备份解决方案,其中大部分都是采用快照的策略。换句话说,大多数系统在数据恢复时,都只能恢复到上次备份时的状态。...本文将为大家讲述如何利用mdadm工具在Linux中创建和管理RAID磁盘阵列。
在UBUNTU14.04LTS中使用mdadm配置软RAID,使用iozone测试软RAID性能 华中科技大学研究生课程计算机系统设计实验课
Linux 磁盘向光、raid 学习mdadm 学习,转被人的。分享
debian6.0下mdadm纯软Raid的部署;亲测可用!
本文档基于深度15.2服务器版本操作系统,通过mdadm工具实现将两块系统SSD组建成软raid。希望能给大家提供帮助。
mdadm是multiple devices admin的简称,它是Linux下的一款标准的软件 RAID 管理工具。 mdadm能够诊断、监控和收集详细的阵列信息。 mdadm是一个单独集成化的程序而不是一些分散程序的集合,因此对不同RAID管理命令...
关于红帽子的RAID管理
不用说你也应该知道备份的重要性。不过虽然大多数人都知道备份是非常重要的,但是我们实际对数据的备份次数却要少于理论上的最佳值。本文讲述如何利用mdadm工具在Linux中创建和管理RAID磁盘阵列。
基于linux的mdadm和hdparm工具的源码移植,在zynqmp芯片上测试通过。其中mdadm工具用于组建raid盘,hdparm用于测试磁盘速度。
文章目录什么是RAIDThe level of RAIDRAID的实现软件磁盘列阵的建立(Ubuntu下的操作)关于mdadm用法的详解(友链) 什么是RAID 磁盘列阵(Redundant Arrays of Independent Disks,RAID),即独立磁盘冗余阵列。 是把...
管理 Linux 软件 RAID 阵列的mdadm util 描述 此模块安装mdadm包以管理 Linux 软件 RAID 阵列,并提供有限的配置支持。 具体来说,该模块目前不提供对md数组的创建、修改或删除的任何支持。 管理仅限于配置对预先...
mdadm 源码 可编译 可移植 应用在嵌入式系统中参考:https://blog.csdn.net/u013008311/article/details/108432917
并且可以利用不同的技术实现数据的冗余 即使有一个磁盘损坏 也可以从其他的磁盘中恢复所有的数据 简单地说 其好处就 是:安全性高 速度快 数据容量大 ">RAID 是冗余磁盘阵列(Redundant Array of Inexpensive Disk)...
linux系统下,mdadm-mdadm-4.1.源码