Back at the main partitioning window, you can review all your changes. As you can see, the partitioning scheme is quite a bit more complicated than your typical install.
If everything looks good, select “Finish partitioning and write changes to disk” and press enter.
Since we have set up a RAID, the installer has an important question for us: if the system loses a drive, do you want to go ahead and boot anyway? Or do you want the system to stay in a recovery shell until the problem is corrected?
Choose yes or no and press enter to continue.
The installer then asks for confirmation to write changes to the disk. If you are happy with the way things are set up, select “Yes” and press enter.
At this point, the installer starts writing the partitions you just set up.
Finishing the Ubuntu Server 12.04 Installation
The rest of the installation proceeds as normal. If you have previous experience installing Ubuntu Server, there won’t be any surprises after this point.
The installer installs the base system.
It asks you to enter your proxy information (if you don’t know what this is, you probably don’t have one). Enter that info or leave it blank and press enter.
After some more configuration, the installer asks how you want to handle security updates. I like having them installed automatically. Choose whichever option you prefer and press enter.
Select which additional packages you want to install using the space bar. You don’t have to select your packages now if you don’t want to. They can be installed later. Or if you do install the packages here, it doesn’t mean they are there forever. Anything you install here can be removed after the installation.
Press enter to continue.
After installing the base system and your packages, the installer asks if you want to install the GRUB boot loader to the master boot record. Unless you are dual-booting Ubuntu Server with another operating system, or have some other sort of unique circumstances, the GRUB boot loader is your friend. Choose “Yes” and press enter.
Once that is done, you are finally finished installing Ubuntu Server 12.04 with encrypted LVM on RAID1.
Press enter to reboot your server.
Welcome to Your New Secure Ubuntu Server 12.04
When the server reboots, you are prompted for your passphrase to decrypt the root filesystem. Enter the passphrase and press enter.
After the system finishes booting, you can now log in to your new Ubuntu Server 12.04 with encrypted LVM on RAID1.
Installation Variations
This tutorial shows one way to install Ubuntu Server 12.04 with encrypted LVM. In this case we used RAID1, but depending on how many hard drives you have available, you could create many other types of setups. The principles in this tutorial will help you install whichever type of setup you need.
Basically, any system you come up with will have your RAID as a foundation for your logical volume manager, which forms containers for encrypted volumes. The RAID can be any kind you want (that the installer supports, that is). You can create as many logical volumes as you want. You can encrypt or not encrypt whichever of the volumes you want.
What setup are you going to use?
George Pligor says
Now with the new installers the bootable flag cannot be set to on for the raid partitions which means you cannot configure raid ๐ Moreover the boot now is by default set to EFIboot which complicates things even better. The combination of raid 1 and lvm is critical for professional environments. This is a great tutorial. Could you update it? That would be awesome. Thanks!
The New Guy says
I’m not sure what you mean by “the new installers.”
Mr.Gosh says
he means the installers from 14.04 – these changed many things…
Jonathan Corbett says
Thank you — this was extremely helpful!!
The New Guy says
Hey, Jonathan! Glad to hear it helped.
Gary Attaway says
Great tutorial. Thanks for taking the time to do this.
The New Guy says
Thanks, Gary. Glad to help.
Gary Attaway says
I am having a problem with this setup. If I unplug either drive, the system will not boot. I get the error message: “Begin: Waiting for encrypted source device……”. So far I have not been able to find any help on what the solution to this is.
Thank you,
Gary
Tony says
The instructions here are very clear and helpful. BUT I built it with Ubuntu Server 14.04.1 and have the same problem as Gary – if I unplug either drive and boot, the system says “no volume groups found … waiting for encrypted source device”
I then rebuilt with RAID->LUKS->LVM rather than RAID->LVM->LUKS but get exactly the same problem.
Lst time I tried this (in 2010) the same problem cropped up. I really don’t think Ubuntu has paid much attention to the need for encrypted RAID to work.
Tony says
I even tried putting a clean disk in place of the “removed” disk to see if it rebuilt, but still says just “waiting for encrypted source device”.
I gave up on Ubuntu for this. Instead I installed a minimal version of Debian 6.0.10 and the encrypted RAID works perfectly; that is removing either drive still allows you to enter your passphrase and log in.
Seems to me there is no point using Ubuntu for encryption with RAID if you can’t boot when a drive fails. And since I am about to build a HP microserver for file storage, I do not want to get burnt by a buggy RAID/Encryption setup.
Thanks “the new guy” for the detailed instructions though, they are probably applicable to Debian and maybe other OS’s too.
Alan Netherclift says
Hi The New Guy.
I also have “The new installer”, downloaded today and the bugs that George Pligor speaks of are also preventing me from being able to configure a software RAID 1 array on Ubuntu 12.04.3 LTS 64-bit Server.
Some of the changes include:
Not being given a choice to make a partition Primary or Logical.
An added line to give a partition a name
The inability to set the Bootable Flag to “on”.
The bootable flag of course is the killer. It means grub will not instal.
I am unsure why they changed the installer, but I really wish they hadn’t.
I would really like to get my hands on the old installer because the new installer doesn’t recognize a hardware RAID1 array setup in the Intel RAID Utility on my Gigabyte Z87M-D3HP Motherboard either.
Alan Netherclift says
OK, so there is no such thing as a “new installer”
turns out the problem was that I was using 3TB HDDs. anything bigger the 2TB and the Partition table needs to be forced to GPT.
The current installer is not able to cope with rives larger than 2TB for RAID.
You need to set the partitions up first in something like GParted (I used GParted Live CD, or you can use Ubuntu Desktop Live DVD and use its GParted.)
explicitly set the Partition table to GPT.
create a partition at least 1.0MB with no file system and set its flag “biosgrub”
create your swap partition and set its flag “raid”
create your main partition and set its flag “raid”
repeat for the other HDD
exit and begin normal instal.
Once you get to the Partitioner, the partitions are already setup, just do the RAID Configuration.
Create MD swap
create MD main
back in the partitioner, choose swap in the array and choose “use as” – swap area
choose the main in the array and choose “use as” – ext4 – mount – / (root)
DONE.
not need to worry about setting bootable flag.
Finish and write changes to disk.
Install will then work.
This is only for HDDs above 2TB that this is necessary.
solution found here:
http://ubuntuforums.org/showthread.php?t=2109438
The New Guy says
Thanks for your input, Alan. Those bigger drives pose some interesting challenges.
nn says
I read this 2 years later and it’s going to save my day! I had no idea the 2GB limit was a problem, took me forever to start searching and here, of all places my search hits sent me to, at last I find a decent explanation…
Thx a zillion!
Joe says
This guide was great – thanks for taking the time to prepare!
Benson says
Hi The New Guy,
Thanks for the effort , the tutorial is clear and very helpful.
I have a question, need advise / help.
With the same setup like the example with a RAID 1 with 2 drives setup , if one of drive is dead and what steps to recover the array after a brand new unformatted hard drive is replaced .
Ally B says
Good documentation like this is priceless thank you for taking the time to write it ๐ I am interested in Ubuntu administration and will be following this site for future entries
XCiber says
There be any problems with an encrypted partition by adding another PV in LVM? Could you describe the process more?
1) Create new PV (only one drive without MD for simplify): pvcreate /dev/sdc
2) Add PV to VG: vgextend linus /dev/sdc
3) Extend LV: lvextend -LXXX /dev/linus/root
4) Anything with /dev/maper/linux-root_crypt??
5) Resize fs: resize2fs /dev/maper/linux-root_crypt
XCiber says
4) cryptsetup resizeโฆ
๐
metrik says
Thank You!
This is extremely helpful and easy to follow!
Marvin says
Is not /home missing in this tutorial or is it created automatically within / ?
ram says
Awesome tutorial! Thanks a lot!