There is a new version of this tutorial available for Debian 8 (Jessie).

Using ATA Over Ethernet (AoE) On Debian Lenny (Initiator And Target) - Page 2

This tutorial exists for these OS versions

On this page

  1. 4 Setting Up The Initiator (server1)
  2. 5 Links

4 Setting Up The Initiator (server1)

server1:

On server1, we install the initiator:

aptitude install aoetools

Now we check what AoE storage devices are available:

aoe-discover

The command

aoe-stat

should now show the storage devices:

server1:~# aoe-stat
      e0.1        21.474GB   eth0 up
server1:~#

At this point we have a new block device available on the client box named /dev/etherd/e0.1. If we have a look at the /dev tree a new node appears:

ls -la /dev/etherd/
server1:~# ls -la /dev/etherd/
total 0
drwxr-xr-x  2 root root     160 2009-02-25 14:47 .
drwxr-xr-x 12 root root    3180 2009-02-25 14:47 ..
c-w--w----  1 root disk 152,  3 2009-02-25 14:06 discover
brw-rw----  1 root disk 152, 16 2009-02-25 14:47 e0.1
cr--r-----  1 root disk 152,  2 2009-02-25 14:06 err
c-w--w----  1 root disk 152,  6 2009-02-25 14:06 flush
c-w--w----  1 root disk 152,  4 2009-02-25 14:06 interfaces
c-w--w----  1 root disk 152,  5 2009-02-25 14:06 revalidate
server1:~#

In the output of

fdisk -l

you should now also find the new hard drive:

server1:~# fdisk -l

Disk /dev/sda: 32.2 GB, 32212254720 bytes
255 heads, 63 sectors/track, 3916 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0x00031334

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *           1        3749    30113811   83  Linux
/dev/sda2            3750        3916     1341427+   5  Extended
/dev/sda5            3750        3916     1341396   82  Linux swap / Solaris

Disk /dev/etherd/e0.1: 21.4 GB, 21474836480 bytes
255 heads, 63 sectors/track, 2610 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0x00000000

Disk /dev/etherd/e0.1 doesn't contain a valid partition table
server1:~#

To use that device, we must format it:

fdisk /dev/etherd/e0.1

server1:~# fdisk /dev/etherd/e0.1
Device contains neither a valid DOS partition table, nor Sun, SGI or OSF disklabel
Building a new DOS disklabel with disk identifier 0xa00b110d.
Changes will remain in memory only, until you decide to write them.
After that, of course, the previous content won't be recoverable.


The number of cylinders for this disk is set to 2610.
There is nothing wrong with that, but this is larger than 1024,
and could in certain setups cause problems with:
1) software that runs at boot time (e.g., old versions of LILO)
2) booting and partitioning software from other OSs
   (e.g., DOS FDISK, OS/2 FDISK)
Warning: invalid flag 0x0000 of partition table 4 will be corrected by w(rite)

Command (m for help):
 <-- n
Command action
   e   extended
   p   primary partition (1-4)

<-- p
Partition number (1-4): <-- 1
First cylinder (1-2610, default 1): <-- ENTER
Using default value 1
Last cylinder or +size or +sizeM or +sizeK (1-2610, default 2610):
<-- ENTER
Using default value 2610

Command (m for help):
 <-- t
Selected partition 1
Hex code (type L to list codes):
 <-- 83

Command (m for help): <-- w
The partition table has been altered!

Calling ioctl() to re-read partition table.
Syncing disks.
server1:~#

Afterwards, the output of

fdisk -l

should look as follows:

server1:~# fdisk -l

Disk /dev/sda: 32.2 GB, 32212254720 bytes
255 heads, 63 sectors/track, 3916 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0x00031334

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *           1        3749    30113811   83  Linux
/dev/sda2            3750        3916     1341427+   5  Extended
/dev/sda5            3750        3916     1341396   82  Linux swap / Solaris

Disk /dev/etherd/e0.1: 21.4 GB, 21474836480 bytes
255 heads, 63 sectors/track, 2610 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0xa00b110d

            Device Boot      Start         End      Blocks   Id  System
/dev/etherd/e0.1p1               1        2610    20964793+  83  Linux
server1:~#

Now we create a filesystem on /dev/etherd/e0.1p1...

mkfs.ext3 /dev/etherd/e0.1p1

... and mount it for test purposes:

mount /dev/etherd/e0.1p1 /mnt

You should now see the new device in the outputs of...

mount
server1:~# mount
/dev/sda1 on / type ext3 (rw,errors=remount-ro)
tmpfs on /lib/init/rw type tmpfs (rw,nosuid,mode=0755)
proc on /proc type proc (rw,noexec,nosuid,nodev)
sysfs on /sys type sysfs (rw,noexec,nosuid,nodev)
udev on /dev type tmpfs (rw,mode=0755)
tmpfs on /dev/shm type tmpfs (rw,nosuid,nodev)
devpts on /dev/pts type devpts (rw,noexec,nosuid,gid=5,mode=620)
/dev/etherd/e0.1p1 on /mnt type ext3 (rw)
server1:~#

... and

df -h
server1:~# df -h
Filesystem            Size  Used Avail Use% Mounted on
/dev/sda1              29G  683M   27G   3% /
tmpfs                 253M     0  253M   0% /lib/init/rw
udev                   10M   88K   10M   1% /dev
tmpfs                 253M     0  253M   0% /dev/shm
/dev/etherd/e0.1p1     20G  173M   19G   1% /mnt
server1:~#

You can unmount it like this:

umount /mnt

To have the device mounted automatically at boot time, e.g. in the directory /storage, we create that directory...

mkdir /storage

... and add the following line to /etc/fstab:

vi /etc/fstab
[...]
/dev/etherd/e0.1p1       /storage        ext3    defaults,auto,_netdev 0 0

This alone isn't enough to have the device mounted at boot time because the AoE stuff gets loaded after /etc/fstab is read. Therefore we open /etc/rc.local...

vi /etc/rc.local

... and add the following lines to it (before the exit 0 line):

[...]
aoe-discover
sleep 5
mount -a
[...]

For test purposes, you can now reboot the system:

reboot

After the reboot, the device should be mounted:

mount
server1:~# mount
/dev/sda1 on / type ext3 (rw,errors=remount-ro)
tmpfs on /lib/init/rw type tmpfs (rw,nosuid,mode=0755)
proc on /proc type proc (rw,noexec,nosuid,nodev)
sysfs on /sys type sysfs (rw,noexec,nosuid,nodev)
udev on /dev type tmpfs (rw,mode=0755)
tmpfs on /dev/shm type tmpfs (rw,nosuid,nodev)
devpts on /dev/pts type devpts (rw,noexec,nosuid,gid=5,mode=620)
/dev/etherd/e0.1p1 on /storage type ext3 (rw,_netdev)
server1:~#
df -h
server1:~# df -h
Filesystem            Size  Used Avail Use% Mounted on
/dev/sda1              29G  684M   27G   3% /
tmpfs                 253M     0  253M   0% /lib/init/rw
udev                   10M   88K   10M   1% /dev
tmpfs                 253M     0  253M   0% /dev/shm
/dev/etherd/e0.1p1     20G  173M   19G   1% /storage
server1:~#

 

Share this page:

0 Comment(s)