Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Next revision
Previous revision
sanboot:ubuntu_aoe [2010/09/17 04:01]
qiet72 First draft
sanboot:ubuntu_aoe [2010/09/17 05:03] (current)
qiet72
Line 1: Line 1:
 ====== Setting up an Ubuntu Installation to work with AOE ====== ====== Setting up an Ubuntu Installation to work with AOE ======
 +(Tested on Ubuntu Lucid 10.04 and Ubuntu Maverick 10.10)
  
-First make sure you have a server with soem aoe software installed. ​ If you use Linux as a server, get and install the "​vblade"​ package.+First make sure you have a server with some aoe server ​software installed. ​ If you use Linux as a server, get and install the "​vblade"​ package.
  
-On the client side, install a standard Ubuntu Desktop on a physical or virtual machine. +On the client side, install a standard Ubuntu Desktop on a physical or virtual machine. ​ If you use a virtual machine, ​make the sure disk image is in '​raw'​ format, meaning no headers or such on the image. ​ If it is a valid raw image, you should be able to see the partition table with, for example "fdisk -l disk.img"​ or even the "​disktype"​ command, like so:
-Use the following steps to make it aoe capable:+
  
-First, login, start a terminal and become root: Applications -Accessories -> Terminal":​+<code> 
 +$ disktype disk.img ​
  
-Paste the following code into /etc/​initramfs-tools/scripts/​local-top/aoe+--- disk.img 
 +Regular file, size 6 GiB (6442450944 bytes) 
 +DOS/MBR partition map 
 +Partition 1: 5.858 GiB (6290407424 bytes, 12285952 sectors from 2048, bootable) 
 +  Type 0x83 (Linux) 
 +  Ext3 file system 
 +    UUID 745D45C4-38FA-4B7C-85A3-71D37AE23AF3 (DCE, v4) 
 +    Volume size 5.858 GiB (6290407424 bytes, 1535744 blocks of 4 KiB) 
 +Partition 2: 144 MiB (150994944 bytes, 294912 sectors from 12288000) 
 +  Type 0x82 (Linux swap Solaris) 
 +  Linux swap, version 2, subversion 1, 4 KiB pages, little-endian 
 +    Swap size 144.0 MiB (150986752 bytes, 36862 pages of 4 KiB) 
 +</code>
  
-[code] +===== Use the following steps to make the Ubuntu client aoe capable: =====
-#!/bin/sh+
  
-sleep 1                                      # Wait for network driver ​ 
-to load 
-ip link set eth0 up                     # Activate the network interface 
-sleep 3                                      # Wait for the network ​ 
-interface to become active 
-echo 1 >/​dev/​etherd/​discover ​ # Start looking for aoe devices on the net 
-[/code] 
  
 +First, start the client and login, then start a terminal and become root: Applications -> Accessories -> Terminal
  
 +== Paste the following code into a new file called /​etc/​initramfs-tools/​scripts/​local-top/​aoe ==
  
-echo aoe >>/etc/initramfs-tools/modules+<code> 
 +#!/bin/sh
  
 +sleep 1                       # Wait for network driver to load
 +ip link set eth0 up           # Activate the network interface
 +sleep 3                       # Wait for the network interface to become active
 +echo 1 >/​dev/​etherd/​discover ​ # Start looking for aoe devices on the net
 +</​code>​
  
 +Then do these commands at the terminal:
 +<​code>​
 +sudo -s                                               # Become root, if it asks for password, use the users password
 +chmod +x /​etc/​initramfs-tools/​scripts/​local-top/​aoe ​  # Make your script executable
 +apt-get install aoetools ​                             # Make sure you have the aoe tools installed
 +echo aoe >>/​etc/​initramfs-tools/​modules ​              # Add the aoe module to the modules list of initramfs
 +update-initramfs -u                                   # Update initramfs with your changes, ​
 +                                                      # the changes will also take effect even with upgrades
 +</​code>​
  
-Following is just brainstorming:+== OptionalDo the following if you want your eth0 interface to have the same name even if the image is booted on different machines == 
 +<​code>​ 
 +sudo -s                                                   # Change to root access 
 +rm /​etc/​udev/​rules.d/​70-persistent-net.rules ​             # Get rid of this rule so that your current eth0 interface doesn'​t get changed 
 +rm /​lib/​udev/​rules.d/​75-persistent-net-generator.rules ​   # This re-creates the above, so get rid of it too 
 +</​code>​
  
 +Note: I don't know if the above steps are the best way to make eth0 name static, but this is what works for me.
  
 +You are now finished with editing the client. Shutdown the client now.
  
-sudo -s                         # Become root +===== Last step: Transfer the image to the server =====
-apt-get install grub-pc # Install grub and make disk bootable+
  
-rm /​etc/​udev/​rules.d/70-persistent-net.rules +You could just copy the image as is, but it is even smarter to make a sparse file.  That way only actual data is copied and not the empty sectors You can do this under linux with the cp command: 
-rm /lib/udev/rules.d/75-persistent-net-generator.rules+<​code>​ 
 +cp --sparse=always disk.img /media/server-data/disk-images/​disk.img 
 +</code>
  
-echo aoe >>/etc/initramfs-tools/modules+If you installed to a physical machine, boot up the machine with a live linux cd, become root and do this command: 
 +<code> 
 +cp --sparse=always ​/dev/sda /​media/​server-data/disk-images/​disk.img 
 +</​code>​
  
 +===== Random Notes =====
  
----------- <​snip>​ ------------------- +    * If you don't install any proprietary video drivers, then what you got here is an image that will boot from either AOE, USB, or any internal/​external disk on any machine. 
-#!/bin/sh+    * Since Ubuntu is Debian based, these steps should work with Debian too but I haven'​t tried it myself 
 +    * You cannot create sparse images if you copy to a windows or samba network share, use nfs/ssh/nc (netcat) instead. ​ Here is an example with nc (netcat):
  
-sleep 1                                      # Wait for network driver ​ +Client side: 
-to load +<​code>​ 
-ip link set eth0 up                     # Activate the network interface +cat /dev/sda | nc -l -p 1234 
-sleep 3                                      # Wait for the network  +</code>
-interface to become active +
-echo 1 >/dev/etherd/discover ​ # Start looking for aoe devices on the net+
  
------------ ​<snip--------------------------+Server side: 
 +<​code>​ 
 +nc <client-ip> 1234 | cp --sparse=always /dev/stdin disk.img 
 +</code>
  
-chmod +x /​etc/​initramfs-tools/​scripts/​local-top/​aoe ​  # Make your script ​ 
-executable 
-update-initramfs -u                                                      ​ 
-# Update initrd to include your changes 
  
 +Created by  --- //Quinn Plattel 2010/09/17 07:33//

QR Code
QR Code sanboot:ubuntu_aoe (generated for current page)