#!/bin/sh

# Make some blank files for the physical devices
/bin/dd if=/dev/zero of=loop0.img bs=1M count=256
/bin/dd if=/dev/zero of=loop1.img bs=1M count=256
/bin/dd if=/dev/zero of=loop2.img bs=1M count=256

# You'll need loopback capabilities in the kernel
/sbin/modprobe loop

# Associate the loopback devices with the files
/sbin/losetup /dev/loop0 loop0.img
/sbin/losetup /dev/loop1 loop1.img
/sbin/losetup /dev/loop2 loop2.img

# Create the physical volume
/sbin/pvcreate /dev/loop0 /dev/loop1 /dev/loop2

# Create the volume group
/sbin/vgcreate -s 1m vg /dev/loop0 /dev/loop1 /dev/loop2

# Create the logical volumes
/sbin/lvcreate -i 2 -L 50M  -n zzz_ext3     vg
/sbin/lvcreate -i 2 -L 75M  -n zzz_reiserfs vg
/sbin/lvcreate -i 2 -L 100M -n zzz_xfs      vg

# You'll need these filesystems in the kernel
/sbin/modprobe ext3
/sbin/modprobe reiserfs
/sbin/modprobe xfs

# Format the logical volumes
/sbin/mke2fs -cj -i 1024 -L zzz_ext3     /dev/vg/zzz_ext3
/sbin/mkreiserfs -f -b 1024 -l zzz_reiserfs /dev/vg/zzz_reiserfs
/sbin/mkfs.xfs /dev/vg/zzz_xfs


