On Sun, 2 Oct 2011, Mike Miller wrote:

> This seems to describe the problem I am having:
>
> http://ubuntuforums.org/showthread.php?t=1631358


Yes!!  I can't believe it finally is working.  The major fix was given by 
B-o-B on July 12, 2011, in this same thread.  It just took me awhile to 
figure out how to use it (with a tip from Thomas Lunde).  I'll explain all 
of the steps below.

I had two new 2TB HDDs and had been getting a bunch of junk (e.g., 
corrupted partitions) building up on them from repeated attempts at 
installing Ubuntu, but I didn't have any data on them.  At one point 
gparted wouldn't even open -- it was crashing on startup and fdisk 
couldn't do anything (it recommended gparted).  Luckily, Thomas Lunde on 
TCLUG gave me this tip:

sudo dd if=/dev/zero of=/dev/sda bs=1024 count=1024
sudo dd if=/dev/zero of=/dev/sdb bs=1024 count=1024

I used the Ubuntu 10.10 x64 Desktop Live CD to "try" Ubuntu and run those 
commands (from Application -> Terminal) and those that follow.

My HDDs were /dev/sda and /dev/sdb.  After that I opened gparted and it 
seemed to show there were problems with the drives, but it did show them 
and it didn't crash.  In gparted I told it to create an MSDOS partition 
table.  I believe I went into the "Device" menu to do that.  I was only 
trying to make it so that I could use fdisk.  After the two dd commands 
above, fdisk still couldn't work with the drives because of some residual 
GPT data on them, but now that gparted had created the MSDOS partition 
table, fdisk worked.

sudo fdisk /dev/sda

In fdisk I first ran recommended 'c' and 'u' commands (recommended in a 
note at fdisk startup).  Then I used 'n' to create two new partitions (1 
and 2), for root and swap, respectively, and I used 't' to change the type 
for both to fd (that's the hex code for the raid type).  I exited with 
'w'.  The sfdisk command recommended by B-o-B to copy the partition info 
from /dev/sda to /dev/sdb did not work for me, so I simply repeated the 
exact steps I used on /dev/sda on /dev/sdb starting with this command:

sudo fdisk /dev/sdb

Next I ran these two commands (one line each) to create the raid:

sudo mdadm --create /dev/md0 --level 1 --raid-devices 2 /dev/sda1 /dev/sdb1 --metadata=0.90
sudo mdadm --create /dev/md1 --level 1 --raid-devices 2 /dev/sda2 /dev/sdb2 --metadata=0.90

...and I formatted the swap array:

sudo mkswap /dev/md1

Luckily for me, that was all I needed from the B-o-B instructions because 
the grub boot loader ended up working without any extra steps.  B-o-B next 
told me "Now start your install like normal.  You should see /dev/md1 
available for your swap, and /dev/md0 available for your root."  Well, I 
tried using the Ubuntu 10.10 x64 Desktop CD first, but that didn't work -- 
it did not show the /dev/md? partitions.  Looking from Live CD again, I 
didn't see them, but I probably wasn't looking the right way, because they 
extisted on some level.  I know that because I next went back to the 
Alternate CD and it detected the RAID.  The swap partition seemed to be 
ready to go, so I partitioned the big partition for root (mounted at /) 
using ext4.  I let the Alt CD finish running and when it got to grub I was 
afraid, as always because of so many past failures, but it sailed right 
through it.

B-o-B also recommended that I check the /etc/fstab file to make sure that 
"swap & / are pointing to /dev/md0 & /dev/md1":

/dev/md1         swap             swap        defaults         0   0
/dev/md0         /                ext3        defaults         1   1

I hope it isn't a problem, but after rebooting I see this instead:

# <file system> <mount point>   <type>  <options>       <dump>  <pass>
proc            /proc           proc    nodev,noexec,nosuid 0       0
# / was on /dev/md0 during installation
UUID=f322a6dc-f6b7-4207-a1fb-4cace87ca2db /               ext4    errors=remount-ro 0       1
/dev/md1        none            swap    sw              0       0

I think that's OK, but let me know if it doesn't look right.

Anyway, it did reboot after installation and it looks beautiful.

Thanks to everyone for the help, especially B-o-B and Thomas Lunde.

Mike