根据鸟哥linux私房菜的介绍初步了解了linux下 raid的构成和使用。在此做个备忘!
鸟哥linux私房菜介绍文章
http://linux.vbird.org/linux_basic/0420quota.php#lvm_whatis
raid功能需要kernel支持
Device Drivers ---> Multi-device support (RAID and LVM) --->
配置raid需要的linux工具为mdadm 和 lvm2
mdadm的介绍有很多,引用了以下几篇文章
http://blog.chinaunix.net/u/31550/showart_542171.html
http://piaoling.javaeye.com/blog/178122
http://www.cublog.cn/u/21041/showart_1882211.html
对于嵌入式来说需要移植mdadm 和 lvm2两套命令
源码位置为
http://www.kernel.org/pub/linux/utils/raid/mdadm/
ftp://sources.redhat.com/pub/lvm2
编译lvm2的时候出现了 undefined reference to `rpl_malloc' 错误,参考了网上的文章进行如下修改就可以通过
在当前目录查找了rpl_malloc,发现configure里有#define malloc rpl_malloc一行。分析configure 脚本相关的代码,原来是ac_cv_func_malloc_0_nonnull引起的,OK我们不让它检查了,产生一个cache文件arm-linux.cache,欺骗configure:
[root@linux tslib]# echo "ac_cv_func_malloc_0_nonnull=yes" > arm-linux.cache
[root@linux tslib]# ./configure --prefix=$(ROOTFS_DIR)/usr --host=arm-linux --cache-file=arm-linux.cache