个人工具

“UbuntuHelp:ATAOverEthernet”的版本间的差异

来自Ubuntu中文

跳转至: 导航, 搜索
 
第3行: 第3行:
 
== Language ==
 
== Language ==
 
{|border="1" cellspacing="0"
 
{|border="1" cellspacing="0"
|'''[[ATAOverEthernet|En]]'''||||'''[[ATAOverEthernet_RU|Ru]]'''
+
|'''[[UbuntuHelp:ATAOverEthernet|En]]'''||||'''[[UbuntuHelp:ATAOverEthernet_RU|Ru]]'''
 
|}
 
|}
 
== Introduction ==
 
== Introduction ==
第13行: 第13行:
 
Do this at your own risk.
 
Do this at your own risk.
 
WARNING: Don't mount the target from more than one client or filesystem corruption will occur.
 
WARNING: Don't mount the target from more than one client or filesystem corruption will occur.
To do this something like [[http://en.wikipedia.org/wiki/Global_File_System|GFS]] is needed.
+
To do this something like [http://en.wikipedia.org/wiki/Global_File_System GFS] is needed.
 
== Required Packages ==
 
== Required Packages ==
 
With the Universe repository enabled..
 
With the Universe repository enabled..
On the Ubuntu host that you wish to be the disk server (due to a bug in Ubuntu 8.04 LTS, you will need vblade 14-1ubuntu1.1 for this to work. See [[https://launchpad.net/bugs/223440|bug #223440]] for details):
+
On the Ubuntu host that you wish to be the disk server (due to a bug in Ubuntu 8.04 LTS, you will need vblade 14-1ubuntu1.1 for this to work. See [https://launchpad.net/bugs/223440 bug #223440] for details):
 
<pre><nowiki>
 
<pre><nowiki>
(server)# apt-get install vblade
+
  (server)# apt-get install vblade
 
</nowiki></pre>
 
</nowiki></pre>
 
On the Ubuntu host that you wish to mount the disk on:
 
On the Ubuntu host that you wish to mount the disk on:
 
<pre><nowiki>
 
<pre><nowiki>
(client)# apt-get install aoetools
+
  (client)# apt-get install aoetools
 
</nowiki></pre>
 
</nowiki></pre>
 
== To set the interface up ==
 
== To set the interface up ==
 
It's important to note that no IP address is needed to get this working.
 
It's important to note that no IP address is needed to get this working.
 
<pre><nowiki>
 
<pre><nowiki>
# ip link set eth0 up
+
# ip link set eth0 up
 
</nowiki></pre>
 
</nowiki></pre>
 
== To create an AoE device ==
 
== To create an AoE device ==
第34行: 第34行:
 
On the server:
 
On the server:
 
<pre><nowiki>
 
<pre><nowiki>
(server)# dd if=/dev/zero of=vblade0 count=1 bs=1M
+
  (server)# dd if=/dev/zero of=vblade0 count=1 bs=1M
(server)# vblade 1 1 eth0 vblade0
+
  (server)# vblade 1 1 eth0 vblade0
ioctl returned 0
+
  ioctl returned 0
1048576 bytes
+
  1048576 bytes
pid 25000: e1.1, 2048 sectors
+
  pid 25000: e1.1, 2048 sectors
 
</nowiki></pre>
 
</nowiki></pre>
 
The daemon ('vbladed') could be used instead of 'vblade', which detaches the process from the console and send log messages to the system logs.
 
The daemon ('vbladed') could be used instead of 'vblade', which detaches the process from the console and send log messages to the system logs.
第45行: 第45行:
 
If this hasn't occured, insert the module into the linux kernel.
 
If this hasn't occured, insert the module into the linux kernel.
 
<pre><nowiki>
 
<pre><nowiki>
(client)# modprobe aoe
+
  (client)# modprobe aoe
 
</nowiki></pre>
 
</nowiki></pre>
 
optionally the list of interfaces can be specified while loading the module
 
optionally the list of interfaces can be specified while loading the module
 
<pre><nowiki>
 
<pre><nowiki>
(client)# modprobe aoe aoe_iflist="eth0 eth1"
+
  (client)# modprobe aoe aoe_iflist="eth0 eth1"
 
</nowiki></pre>
 
</nowiki></pre>
 
This can automatically be performed at startup, by entering a line into the
 
This can automatically be performed at startup, by entering a line into the
第55行: 第55行:
 
In Ubuntu 6.06 (or any systems without udev), create the 'etherd' directory:
 
In Ubuntu 6.06 (or any systems without udev), create the 'etherd' directory:
 
<pre><nowiki>
 
<pre><nowiki>
(client)# mkdir /dev/etherd
+
  (client)# mkdir /dev/etherd
 
</nowiki></pre>
 
</nowiki></pre>
In Ubuntu 8.04, add the necessary rules to udev (this is not needed in 9.04 and later, see [[https://launchpad.net/bugs/234033|bug #234033]]):
+
In Ubuntu 8.04, add the necessary rules to udev (this is not needed in 9.04 and later, see [https://launchpad.net/bugs/234033 bug #234033]):
 
<pre><nowiki>
 
<pre><nowiki>
(client)# cat > /etc/udev/rules.d/60-aoe.rules << EOM
+
  (client)# cat > /etc/udev/rules.d/60-aoe.rules << EOM
 
SUBSYSTEM=="aoe", NAME="etherd/%k", GROUP="disk", MODE="0220"
 
SUBSYSTEM=="aoe", NAME="etherd/%k", GROUP="disk", MODE="0220"
 
SUBSYSTEM=="aoe", KERNEL=="err", MODE="0440"
 
SUBSYSTEM=="aoe", KERNEL=="err", MODE="0440"
 
EOM
 
EOM
(client)# /etc/init.d/udev restart
+
  (client)# /etc/init.d/udev restart
 
</nowiki></pre>
 
</nowiki></pre>
 
Next, access the devices:
 
Next, access the devices:
 
<pre><nowiki>
 
<pre><nowiki>
(client)# aoe-interfaces eth0
+
  (client)# aoe-interfaces eth0
(client)# aoe-discover
+
  (client)# aoe-discover
(client)# aoe-stat
+
  (client)# aoe-stat
e1.1        0.001GB  eth0 up  
+
      e1.1        0.001GB  eth0 up  
 
</nowiki></pre>
 
</nowiki></pre>
 
The block device is then located in /dev/etherd/e1.1 and can be  
 
The block device is then located in /dev/etherd/e1.1 and can be  
第76行: 第76行:
 
Create a filesystem:
 
Create a filesystem:
 
<pre><nowiki>
 
<pre><nowiki>
(client)# mke2fs /dev/etherd/e1.1
+
  (client)# mke2fs /dev/etherd/e1.1
 
</nowiki></pre>
 
</nowiki></pre>
 
Create a mount point and mount the file system:
 
Create a mount point and mount the file system:
 
<pre><nowiki>
 
<pre><nowiki>
(client)# mkdir /mnt/e1.1
+
  (client)# mkdir /mnt/e1.1
(client)# mount /dev/etherd/e1.1 /mnt/e1.1
+
  (client)# mount /dev/etherd/e1.1 /mnt/e1.1
 
</nowiki></pre>
 
</nowiki></pre>
 
This can be made to automatically mount on reboot, by entering a configuration
 
This can be made to automatically mount on reboot, by entering a configuration
第87行: 第87行:
 
If the AoE device disappears or changes size use the ```aoe-revalidate``` command:
 
If the AoE device disappears or changes size use the ```aoe-revalidate``` command:
 
<pre><nowiki>
 
<pre><nowiki>
(client)# aoe-revalidate e1.1
+
  (client)# aoe-revalidate e1.1
 
</nowiki></pre>
 
</nowiki></pre>
 
Alternatively, you can re-load the aoe module completely.
 
Alternatively, you can re-load the aoe module completely.
 
<pre><nowiki>
 
<pre><nowiki>
(client)# rmmod aoe
+
  (client)# rmmod aoe
(client)# modprobe aoe
+
  (client)# modprobe aoe
 
</nowiki></pre>
 
</nowiki></pre>
 
== References ==
 
== References ==

2010年5月19日 (三) 21:38的最新版本

Language

En Ru

Introduction

There is now a kernel module (aoe), tools (aoetools) and server software (vblade) which allows anyone to set up an ATA over Ethernet storage network... it is very easy to do in Ubuntu. This software is available in Dapper 6.06 LTS and later.. WARNING: These commands need to be run with root privileges (sudo -i). Do this at your own risk. WARNING: Don't mount the target from more than one client or filesystem corruption will occur. To do this something like GFS is needed.

Required Packages

With the Universe repository enabled.. On the Ubuntu host that you wish to be the disk server (due to a bug in Ubuntu 8.04 LTS, you will need vblade 14-1ubuntu1.1 for this to work. See bug #223440 for details):

  (server)# apt-get install vblade

On the Ubuntu host that you wish to mount the disk on:

  (client)# apt-get install aoetools

To set the interface up

It's important to note that no IP address is needed to get this working.

 # ip link set eth0 up

To create an AoE device

To test that everything is working correctly, we created and used a 1 Mbyte file (vblade0). Any other block device or file could be used. On the server:

  (server)# dd if=/dev/zero of=vblade0 count=1 bs=1M
  (server)# vblade 1 1 eth0 vblade0
  ioctl returned 0
  1048576 bytes
  pid 25000: e1.1, 2048 sectors

The daemon ('vbladed') could be used instead of 'vblade', which detaches the process from the console and send log messages to the system logs.

Using AoE

The 'aoe' module should already be automatically loaded when the 'aoetools' package is installed. Please note that you will not be able to discover AoE devices on the localhost unless you specify ```lo``` to vblade. If this hasn't occured, insert the module into the linux kernel.

  (client)# modprobe aoe

optionally the list of interfaces can be specified while loading the module

   (client)# modprobe aoe aoe_iflist="eth0 eth1"

This can automatically be performed at startup, by entering a line into the /etc/modules file. In Ubuntu 6.06 (or any systems without udev), create the 'etherd' directory:

  (client)# mkdir /dev/etherd

In Ubuntu 8.04, add the necessary rules to udev (this is not needed in 9.04 and later, see bug #234033):

   (client)# cat > /etc/udev/rules.d/60-aoe.rules << EOM
SUBSYSTEM=="aoe", NAME="etherd/%k", GROUP="disk", MODE="0220"
SUBSYSTEM=="aoe", KERNEL=="err", MODE="0440"
EOM
   (client)# /etc/init.d/udev restart

Next, access the devices:

  (client)# aoe-interfaces eth0
  (client)# aoe-discover
  (client)# aoe-stat
      e1.1         0.001GB   eth0 up 

The block device is then located in /dev/etherd/e1.1 and can be treated like any other block device. Create a filesystem:

  (client)# mke2fs /dev/etherd/e1.1

Create a mount point and mount the file system:

  (client)# mkdir /mnt/e1.1
  (client)# mount /dev/etherd/e1.1 /mnt/e1.1

This can be made to automatically mount on reboot, by entering a configuration line in /etc/fstab (untested). If the AoE device disappears or changes size use the ```aoe-revalidate``` command:

   (client)# aoe-revalidate e1.1

Alternatively, you can re-load the aoe module completely.

   (client)# rmmod aoe
   (client)# modprobe aoe

References