Ok, formatting is a little screwed up, but meh, it should be pretty readable. Basically I've written exactly what I wished existed when I started this whole thing. Hope it helps someone!
Building initial USB key
Note, you must use the desktop one, you can't use the alternate or server version (you need live cd functionality)
- open the usb installer
- select the correct desktop build you have downloaded, and select that iso.
- select your pen drive.
- select the persistant option, and select a casper partition (2GB is plenty)
- allow this to build
- Once built, stick this into your server (any usb slot)
Booting up
- The server should boot this usb stick with no changes to bios (assuming nothing else bootable is present of course)
- select run from this usb
- You should now be at the ubuntu desktop
Configure enviroment
First off, you need to fix a missing link that will prevent the system from being able to update itself correctly.
open a terminal and enter the following:
Code:
ln -s /cdrom/casper/vmlinuz /vmlinuz
note I found this didn't work unless I first deleted the existing /vmlinuz directory.
- Now, we're able to add/remove the packages we need to get this going.
- We don't need the installed dmraid packages, and they will screw around with the drives at boot time, making it impossible for the program we want to use to function. Either from the package manager or synaptic remove dmraid, and libdmraid.
- We need mdadm to control our raid array, so install that package in the same manner.
Setting up the drives
Now, here I admit I'm a little hazy, as I tried lots of things and generally faffed around until it worked.
All I think you need to do is make primary partitions on all of your drives, and mdadm can handle the rest. You can do this with gparted, cfdisk fdisk etc, whichever you are happiest with. You can set the 'raid' flag too, but I don't think that actually prevents it from working otherwise.
Assuming you have 4 drives in the bays like I do, what you want to end up with is sda1,sdb1,sdc1,sdd1. You can verify this from console by typing this:
Assuming this is all correct, it's time to assemble the array using mdadm.
Setting up raid with adadm
For a raid5 raid volume spanning all 4 disks, you'd type the following:
Code:
mdadm --create /dev/md0 --level=5 --raid-devices=4 /dev/sda1 /dev/sdb1 /dev/sdc1 /dev/sdd1
Check you're getting what you want:
Code:
sudo mdadm --query --detail /dev/md0
Refer to this document if you need other options:
http://ubuntuforums.org/showthread.php?t=408461
It should now get to work building the array. You can monitor progress from the console:
If you're building an array like mine, expect it to take *Forever* (13 + hours)
But, we still need to set a few more things up, and you can do that while it's building.
I'm not sure if you need this, but to be on the safe side, you can use a script to put the details of your raid setup into mdadm.conf
Code:
sudo /usr/share/mdadm/mkconf
After a short delay, this should write the required lines into the file (you will be able to see the lines it adds on the console)
Basic Samba setup
We are going to want samba to share things to the pc, so we need to install these packages:
samba
libpam-smbpass
I will expand this later if anyone wants it, but samba is pretty straight forward and well documented. The easiest way to kick it off is actually through the gui, navigate to your mount point for the device, right click, propeties, and go to sharing and this will generaly set it up for you. Note that I still had issues until went into the console and put in the password again for the samba user (even though there's some stuff that's meant to link them together)
(follow instructions)
it should appear as a share from a windows machine, and accept that login.
Obviously there's lots of stuff you can do here, way beyond the scope of this guide to just getting it going.
Remote SSH
you are also likely to want to be able to remotely access the machine using ssh. By default, it's not included in
the live cd install, so add it:
Code:
sudo aptitude update
sudo aptitude install openssh-server
You can now access the machine across the network.
Formatting the array
I think you need to wait until the array is built (could be wrong!) before you can add a filesystem:
note ext3 is the filesystem, you may want to read around if you aren't sure which one you want. This will take a fair while, but not as long as it did to build the array.
Mounting the array
now we need this new raid volume to be mounted somewhere. I'm sure linux experts will have suggestions, but I just
stuck it in /mnt/storage like so:
Code:
sudo mkdir /mnt/storage
sudo mount /dev/md0 /mnt/storage
you will most likely want this folder owned by the ubuntu user rather than root:
Code:
sudo chown -R ubuntu:users /mnt/storage/
Now we want to make this auto mount each time you boot the machine. This means adding a line to the fstab, but before we can do that we need to make one more change. By default the live cd wipes the fstab on each boot, which isn't very useful. To prevent that, enter the following from console:
Code:
sudo chmod -x /usr/share/initramfs-tools/scripts/casper-bottom/12fstab
(the second one can take a little while, don't panic)
now we need to edit the fstab to include our new mount point
for mine I added:
Code:
/dev/md0 /mnt/storage reiserfs defaults 0 3
Consult here for what you may need :
http://www.tuxfiles.org/linuxhelp/fstab.html
Success?
This is as far as I've got, I still need to work on improving smb performance and some other tweaks. However hopefully this saves you lots and lots of time I wasted to get this to work.