A home-built virtual RAID with ATA over Ethernet
Raiding the Net
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.
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).
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
(incl. VAT)
Buy Linux Magazine
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.
News
-
Juno Tab 3 Launches with Ubuntu 24.04
Anyone looking for a full-blown Linux tablet need look no further. Juno has released the Tab 3.
-
New KDE Slimbook Plasma Available for Preorder
Powered by an AMD Ryzen CPU, the latest KDE Slimbook laptop is powerful enough for local AI tasks.
-
Rhino Linux Announces Latest "Quick Update"
If you prefer your Linux distribution to be of the rolling type, Rhino Linux delivers a beautiful and reliable experience.
-
Plasma Desktop Will Soon Ask for Donations
The next iteration of Plasma has reached the soft feature freeze for the 6.2 version and includes a feature that could be divisive.
-
Linux Market Share Hits New High
For the first time, the Linux market share has reached a new high for desktops, and the trend looks like it will continue.
-
LibreOffice 24.8 Delivers New Features
LibreOffice is often considered the de facto standard office suite for the Linux operating system.
-
Deepin 23 Offers Wayland Support and New AI Tool
Deepin has been considered one of the most beautiful desktop operating systems for a long time and the arrival of version 23 has bolstered that reputation.
-
CachyOS Adds Support for System76's COSMIC Desktop
The August 2024 release of CachyOS includes support for the COSMIC desktop as well as some important bits for video.
-
Linux Foundation Adopts OMI to Foster Ethical LLMs
The Open Model Initiative hopes to create community LLMs that rival proprietary models but avoid restrictive licensing that limits usage.
-
Ubuntu 24.10 to Include the Latest Linux Kernel
Ubuntu users have grown accustomed to their favorite distribution shipping with a kernel that's not quite as up-to-date as other distros but that changes with 24.10.