HOWTO - Discovering and using existing sata raid (eg sil3112

参与到Ubuntu的翻译中来
回复
yongyi
帖子: 3025
注册时间: 2005-05-07 23:57
联系:

HOWTO - Discovering and using existing sata raid (eg sil3112

#1

帖子 yongyi » 2005-07-31 15:49

DISCLAIMER: this is my first HOWTO, so ill probably get a lot of the style wrong. I just had huge trouble finding information on this problem, and i thought i should pass it on now ive solved it.

What this is for: People who have a SATA(serial ATA) raid controller, such as the sil3112 controller that comes on the Abit NF-7 S motherboard, and want to use this raid though the controller.
This is *NOT* for people with new, blank hdds. For you it is much easier IMHO to set them up using linux software raid, i believe that there is a howto on this forum already for that.
This *is* for people who need to access raid arrays they have already created, in my case i am dual booting with winxp and i have a large amount of data i need to access in linux.
It is supposed to support these raid controllers:
Highpoint HPT37X
Highpoint HPT45X
Intel Software RAID
Promise FastTrack
Silicon Image Medley


Right, lets get started. These instructions are adapted and fleshed out from the original dmraid(the program used to discover the raid devices) README.

1) download and install your kernel source, you can follow the instructions up to and including 'unpacking your kernel' in the kernel howto wiki
http://wiki.ubuntulinux.org/KernelHowto

2) Lucky for Ubuntu users, the 2.6.8 kernel that ships with warty final already has the device mapper base code! That means for raid-0 people there is nothing to do for step 2, goto 3!
If you want to use raid-0,5 or append, you will need to apply some kernel patches and build a new kernel.
For the 2.6.8.1 kernel they are here:
ftp://sources.redhat.com/pub/dm/pat...stable/2.6.8.1/

Apply these patches to your kernel source using something like:
cd /usr/src/linux
sudo cat <directory containing patches>/*.patch > patch -p1

Then build your kernel following the instructions in the wiki link above.

3) Install the device mapper userspace. This is located at ftp://sources.redhat.com/pub/dm/
You might as well get the latest version, which at time of writing is device-mapper.1.00.19.tgz.
Untar this somewhere and go into the directory tar creates.
then run
./configure
sudo make install

4) download the dmraid software
http://people.redhat.com/~heinzm/sw...current.tar.bz2

Untar it, and again go into the directory it creates.
./configure
sudo make install

Almost done!

5) now everything is installed. You just need to make dmraid load on startup and set up the drive mounting.
I didnt make mine load on startup, as i do not need to access my raid drives all that often. So i made a little script to mount them when i need them in my home directory.
Heres how:

You need to find your device name.
ls /dev/mapper/

There will be a few entries that look long and confusing. They are actually just the partitions of your raid drives, prefixed with a complex name. mine looks like
sil_0309402025011
sil_0309402025011_p1
sil_0309402025011_p5

you need to note these down.

make a new file called activateraid in your home directory.
Put this code in it :

dmraid -ay -v
mount -t <fs type> -o users,owner,ro,umask=000 dev/mapper/<your partiton name> /<your mount dir>

and add another line for every partition you have.
Save the file.
chmod 700 activateraid

6) Now test it! run
./activateraid
and all your drives should mount!

!
Hope it works for you. I was so stoked when i finally found this solution. Worth noting is that Ubuntu is the only distro of 3 or 4 ive tried that had the devicemapper code included in a form that was useful for this to work. Yay Ubuntu!

http://ubuntuforums.org/showthread.php? ... light=sata
独自看一看大海
总想起身边走在路上的朋友
Lenovo E290-420[Celeron-M420/256M/60G/Intel GMA950]
lattice
帖子: 36
注册时间: 2005-07-06 18:01

#2

帖子 lattice » 2005-08-01 13:54

HOWTO:探索并使用现有的SATA(串行ATA)阵列(例如sil3112)

不承诺:这是我的第一篇HOWTO,所以里面可能有一些不到之处。为了问题的解决我在寻找相关信息时遇到了很大的困难,如今我顺利解决了,我想我应该拿出来与大家分享。

文章的适用对象:拥有SATA(串行ATA)阵列控制器(比如Abit NF-7S主板上的sil3112控制器)并想通过此控制器使用阵列者。

这篇文章不适合拥有新的空白硬盘者。对于这部分人可以使用linux阵列软件来轻而易举地将其设置好,我想论坛上已经有了相关方面的HOWTO的文章。

这篇文章是为那些已经创建好了磁盘阵列而想在liniux下使用的朋友准备的。我就拥有一个主启动为winxp的双系统,而我必须在linux下存取我所拥有的大量数据。

假设下列阵列控制器被支持:

代码: 全选

Highpoint HPT37X 
Highpoint HPT45X 
Intel Software RAID 
Promise FastTrack 
Silicon Image Medley 
好,我们开始行动。这些指令借鉴于dmraid(用来检测阵列设备的程序)的README并与其兼容。

1)下载内核源程序并安装。你可以参照包含“解压内核”的kernel howto wiki中的操作方法去做
http://wiki.ubuntulinux.org/KernelHowto

2)对于ubuntu用户就很幸运了,2.6.8内核中已经拥有了相应的设备映射基础代码!这就意味着raid-0的朋友们无需做第二步骤,直接跳到第三步骤!

如果你需要使用raid-0,5或更多,你需要找来一些内核补丁,编译一个新内核。对于2.6.8.1内核,补丁在这里:
ftp://sources.redhat.com/pub/dm/pat...stable/2.6.8.1/

使用下面的方法把补丁打到你的内核代码中去:

代码: 全选

cd /usr/src/linux 
sudo cat <directory containing patches>/*.patch > patch -p1 
然后便可按照上面的wiki链接中的操作方法来编译你的内核了。


3)安装设备映射用户空间。在下面的地址中:ftp://sources.redhat.com/pub/dm/

你可能需要拿到最新版本,笔者写这篇HOWTO时的最新版本是device-mapper.1.00.19.tgz。

解压缩到某个目录然后到进入此目录并运行:

代码: 全选

./configure 
sudo make install 

4)下载dmraid软件:http://people.redhat.com/~heinzm/sw...current.tar.bz2

解压缩,然后到解压后的目录执行:

代码: 全选

./configure 
sudo make install 
就快完成了!


5)现在要装的都装好了。你需要在系统启动的时候加载dmraid然后挂载驱动器。

我自己没有在系统启动的时候加载dmraid,因为我并不是经常需要使用阵列驱动器。所以我在我的主目录里写了一个脚本,等我需要使用阵列的时候再去加载。下面是脚本的编写方法:

你需要找到你的设备名:

代码: 全选

ls /dev/mapper/ 
你会发现有些入口看起来很长很容易把人弄晕。实际上那些其实只是你的硬盘驱动器的分区,前面加上了复杂的名称而已。我的是这样的

代码: 全选

sil_0309402025011 
sil_0309402025011_p1 
sil_0309402025011_p5 
你需要把这些记录下来。

在你的主目录里建一个叫activateraid的新文件,写入以下内容:

代码: 全选

dmraid -ay -v 
mount -t <fs type> -o users,owner,ro,umask=000 dev/mapper/<your partiton name> /<your mount dir> 
然后把每个分区都如上地写为一行。保存文件,并执行:

代码: 全选

chmod 700 activateraid 
6)现在来进行测试!运行

代码: 全选

./activateraid 
这样你的驱动器就会加载上去了!


希望你的也可以成功。我最终找到解决方法的时候真的是有一种畅快淋漓的感觉。值得一提的是只有3或4个发行版将设备映射代码做成能够使阵列设备很容易运行起来的形式,ubuntu就是其中之一。Ubuntu万岁!(这一段很难翻译,可能有误)

http://ubuntuforums.org/showthread.php? ... light=sata
[/url]
头像
oneleaf
论坛管理员
帖子: 10441
注册时间: 2005-03-27 0:06
系统: Ubuntu 12.04

#3

帖子 oneleaf » 2005-08-02 9:17

当净其意如虚空,远离妄想及诸取,令心所向皆无碍
头像
millenniumdark
论坛版主
帖子: 4159
注册时间: 2005-07-02 14:41
系统: Ubuntu 14.04 (Kylin)
联系:

#4

帖子 millenniumdark » 2006-07-30 23:00

这个原来是4。10的,不知道现在还有用吗?
回复