LVM (Linux Volume Management) tutorial using Aoe, Fuse and loopback devices with different RAID levels 1,5, and 10.
Structure to follow:
The first step is to install the kernel source.
yum install kernel-devel
This picked kernel-devel-2.6.1
It's possible this is already installed.
yum list|grep 'kernel-devel*'
kernel-devel.i686 2.6.17-1.2157_FC5 installed
kernel-devel.i586 2.6.17-1.2157_FC5 updates
Next download aoe tools and vblade, and create the necessary directories. I use the following script.
mkdir -p /home/src/aoe
cd /home/src/aoe
wget http://www.coraid.com/support/linux/aoe6-31.tar.gz
tar -xzf aoe6-31.tar.gz
mkdir -p /home/src/vblade
cd /home/src/vblade
wget http://ftp1.sourceforge.net/aoetools/vblade-10.tar.gz
tar -xzf vblade-10.tar.gz
Next compile the software.
cd /home/src/aoe/aoe6-31
make install
modproble aoe
cd /home/src/vblade/vblade-10
make
Now create the disk images. See (diskcreate.sh).
dd if=/dev/zero of=/images/disk0.img count=102400
dd if=/dev/zero of=/images/disk1.img count=102400
dd if=/dev/zero of=/images/disk2.img count=102400
dd if=/dev/zero of=/images/disk3.img count=102400
Next map the loopback device
losetup `losetup -f` /images/disk0.img
losetup `losetup -f` /images/disk1.img
losetup `losetup -f` /images/disk2.img
Take a look at what is being used.
fdisk -l
cat /proc/mdstat
Create the raid. Note it is also possible to create the raid on a remote device too; but, vbladed would need to be run first. (Note to self: Document this later as well).
mdadm --create /dev/md0 --level=5 --raid-devices=3 /dev/loop0 /dev/loop1 /dev/loop2
Now take a look at the status.
cat /proc/mdstat
Personalities : [raid5] [raid4]
md0 : active raid5 loop2[2] loop1[1] loop0[0]
102272 blocks level 5, 64k chunk, algorithm 2 [3/3] [UUU]
unused devices: none
Also, you can get more information with the following:
mdadm --detail /dev/md0
Now, we'll run vbladed on living room.
cd /home/src/vblade/vblade-10
./vbladed 12 0 eth0 /dev/md0
Take a look at the log files.
Jul 27 12:42:24 livingroom vbladed: ioctl returned 0 Jul 27 12:42:24 livingroom vbladed: 104726528 bytes Jul 27 12:42:24 livingroom vbladed: pid 2144: e12.0, 204544 sectors
Now log in to another computer on the same subnet, which has the aoe tools installed and compiled. Note, to compile you'll need the kernel source.
ssh v5
yum install kernel-xenU-devel #This Xen domain
# There is also yum install kernel-xen0-devel
cd /home/src/aoe/aoe6-31
make install
modprobe aoe
lsmod|grep 'aoe'
aoe 33920 0
aoe-stat
e12.0 0.104GB eth0 up
Remember, the commands above were executed on the remote computer. Continuting on the remote computer.
Next, run pvcreate
pvcreate /dev/etherd/e12.0
vgcreate AoEVolGroup00 /dev/etherd/e12.0
Volume group "AoEVolGroup00" successfully created
lvcreate -L51 -n lpLogVol00 AoEVolGroup00
If you need to remove: lvremove -f AoEVolGroup00/lpLogVol00
Rounding up size to full physical extent 52.00 MB
Logical volume "AoEVolGroup00" created
ls /dev/AoEVolGroup00/
lpLogVol00
The lvcreate command only uses 51 MB. It can be extended later. Next format this volume.
mkfs -t ext3 /dev/AoEVolGroup00/lpLogVol00
or
yum install reiserfs-utils
mkfs -t reiserfs /dev/AoEVolGroup00/lpLogVol00
of
yum install xfsprogs*
mkfs.xfs -f /dev/AoEVolGroup00/lpLogVol00
mkdir -p /AoE
mount /dev/AoEVolGroup00/lpLogVol00 /AoE
to unmount
umount /AoE
Now run vgscan.
vgscan
vgchange -ay lp_volumes #Make this active
Breaking Firewalls with OpenSSH and PuTTY: If the system administrator deliberately filters out all traffic except port 22 (ssh), to a single server, it is very likely that you can still gain access other computers behind the firewall. This article shows how remote Linux and Windows users can gain access to firewalled samba, mail, and http servers. In essence, it shows how openSSH and Putty can be used as a VPN solution for your home or workplace.
Create a Live Linux CD - BusyBox and OpenSSH Included: These steps will show you how to create a functioning Linux system, with the latest 2.6 kernel compiled from source, and how to integrate the BusyBox utilities including the installation of DHCP. Plus, how to compile in the OpenSSH package on this CD based system. On system boot-up a filesystem will be created and the contents from the CD will be uncompressed and completely loaded into RAM -- the CD could be removed at this point for boot-up on a second computer. The remaining functioning system will have full ssh capabilities. You can take over any PC assuming, of course, you have configured the kernel with the appropriate drivers and the PC can boot from a CD. This tutorial steps you through the whole processes.
SQLite Tutorial : This article explores the power and simplicity of sqlite3, first by starting with common commands and triggers, then the attach statement with the union operation is introduced in a way that allows multiple tables, in separate databases, to be combined as one virtual table, without the overhead of copying or moving data. Next, the simple sign function and the amazingly powerful trick of using this function in SQL select statements to solve complex queries with a single pass through the data is demonstrated, after making a brief mathematical case for how the sign function defines the absolute value and IF conditions.
The Lemon Parser Tutorial: This article explains how to build grammars and programs using the lemon parser, which is faster than yacc. And, unlike yacc, it is thread safe.
How to Compile the 2.6 kernel for Red Hat 9 and 8.0 and get Fedora Updates: This is a step by step tutorial on how to compile the 2.6 kernel from source.
Linux System Admin Tips: There are over 160 linux tips and tricks in this article. This article is updated weekly.
Virtual Filesystem: Building A Linux Filesystem From An Ordinary File. You can take a disk file, format it as ext2, ext3, or reiser filesystem and then mount it, just like a physical drive. Yes, it then possible to read and write files to this newly mounted device. You can also copy the complete filesystem, sinc\ e it is just a file, to another computer. If security is an issue, read on. This article will show you how to encrypt the filesystem, and mount it with ACL (Access Control Lists), which give you rights beyond the traditional read (r) write (w) and execute (x) for the 3 user groups file, owner and other.
Working With Time: What? There are 61 seconds in a minute? We can go back in time? We still tell time by the sun?
Mike Chirico, a father of triplets (all girls) lives outside of
Philadelphia, PA, USA. He has worked with Linux since 1996, has a Masters
in Computer Science and Mathematics from Villanova University, and has
worked in computer-related jobs from Wall Street to the University of
Pennsylvania. His hero is Paul Erdos, a brilliant number theorist who was
known for his open collaboration with others.
Mike's notes page is souptonuts. For
open source consulting needs, please send an email to
mchirico@comcast.net. All consulting work must include a donation to
SourceForge.net.