A home-built virtual RAID with ATA over Ethernet

Raiding the Net

© Lead Image © Kheng Ho Toh, 123RF.com

© Lead Image © Kheng Ho Toh, 123RF.com

Article from Issue 162/2014
Author(s):

We'll show you how to build a network-based virtual RAID solution using ATA over Ethernet.

ATA over Ethernet (AoE) is a protocol for accessing media via Ethernet. A remote client can access the device directly through ATA commands, which the protocol software encapsulates, transmits, and disassembles at the other end (Figure 1). AoE is often used for building low-budget Storage Area Network (SAN) devices. An interesting feature of AoE is that it lets you combine remote disks on different systems into a network-based RAID array. In this article, I describe how to set up AoE and use it to create your own network RAID system.

Figure 1: RAID devices over the network with ATA Ethernet follow a pattern similar to iSCSI, with initiators and targets.

Required Components

The exact specifications for the AoE protocol are available online [1]: In a style similar to iSCSI, the literature refers to the system that provides the physical disks as a target. The initiator is the system that integrates the disk.

AoE is very easy to set up on most Linux systems. On the target, you just need to install the vblade package; on Debian systems, this is a painless procedure using:

aptitude install vblade

Running the install on the initiator is just as easy, but this time you need the AoE tools (aptitude install aoe-tools). You now have the aoe kernel module, which you can load with modprobe aoe. If you want to load this module by default at startup, simply add a corresponding entry to your /etc/modules file.

Providing Media

The vblade program lets you manage disks and partitions. You'll need to enter parameters for a shelf number, a slot number, and the network interface to serve up the storage, as well as partition and volume details. You can also provide a file (e.g., a raw image). The shelf and slot number, or their combination, must be unique on the network.

In addition to buffer settings and the access mode, you can specify MAC addresses as a comma-separated list. This list acts as a whitelist: Only computers with the specified MAC addresses can access the data.

For testing purposes, it makes sense to use a raw image. The following command generates a 10GB image:

dd if=/dev/zero of=/test/raw_image.raw bs=1M count=10000

If you prefer to try this with real data carriers, instead of the image (/test/raw_image.raw), simply insert the device name (e.g., /dev/sdc1 for the first partition on the hard disk integrated as sdc).

Shelves and Slots

To share the newly created raw image on the target as Shelf 2, Slot 1, simply type:

vblade 2 1 eth0 /test/raw_image.raw

If all requirements are met on the initiator system, the disk will be visible immediately. If all the requirements are not met, you might need to run the aoe-discover command. To see the media available to the system, you can run,

ls /dev/etherd

although you'll get more detailed output if you enter aoe-stat (Figure 2).

Figure 2: Three volumes are provided by the initiator, as shown by aoe-stat.

Using vblade is fine for test purposes; you will probably want to run the program in the foreground to see a lot of debug information (which you can abort with Ctrl+C). The corresponding background service is vbladed. In both cases, the data you provided disappears once again after a reboot.

If you want to automate the integration of initiators and targets, the tool you need is vblade-persist. However, the program is part of separate package and first needs to be installed with:

aptitude install vblade-persist

To provide the raw image used above permanently, it first needs a persistent export:

vblade-persist setup 2 1 eth0 /test/raw_image.raw

Absolute paths are used for the disk or file. Select the device with vblade-persist auto 2 1 to launch automatically. To deploy immediately without a restart, you can enter: vblade-persist start 2 1. For an overview of all the persistent AoE exports and their states, simply call vblade-persist ls.

Buy this article as PDF

Express-Checkout as PDF
Price $2.95
(incl. VAT)

Buy Linux Magazine

SINGLE ISSUES
 
SUBSCRIPTIONS
 
TABLET & SMARTPHONE APPS
Get it on Google Play

US / Canada

Get it on Google Play

UK / Australia

Related content

  • Desktop RAID

    Linux offers several options for fulfilling the RAID promise of fast hard disk access and data security.

  • ASK KLAUS!

    Klaus Knopper is the creator of Knoppix and co-founder of the LinuxTag expo. He currently works as a teacher, programmer, and consultant. If you have a configuration problem, or if you just want to learn more about how Linux works, send your questions to: klaus@linux-magazine. com

  • RAID Performance

    You can improve performance up to 20% by using the right parameters when you configure the filesystems on your RAID devices.

  • Ask Klaus!

    Klaus Knopper is the creator of Knoppix and co-founder of the LinuxTag expo. He currently works as a teacher, programmer, and consultant. If you have a configuration problem, or if you just want to learn more about how Linux works, send your questions to: klaus@linux-magazine.com

  • Ask Klaus!

    Klaus Knopper is the creator of Knoppix and co-founder of the LinuxTag expo. He currently works as a teacher, programmer, and consultant. If you have a configuration problem, or if you just want to learn more about how Linux works, send your questions to: klaus@linux-magazine.com

comments powered by Disqus
Subscribe to our Linux Newsletters
Find Linux and Open Source Jobs
Subscribe to our ADMIN Newsletters

Support Our Work

Linux Magazine content is made possible with support from readers like you. Please consider contributing when you’ve found an article to be beneficial.

Learn More

News