Mr. B-o-B cried from the depths of the abyss...
> What version of Ubuntu are you going to be installing on the new machine
> where you plan to do the RAID 1. I'll grab that version, and give it a try.
> Should work fine, but I am curious if the procedure is different for some
> reason or another in Ubuntu.
OK. I gave this a try, and can confirm the below instructions worked on
Unbuntu. I
grabbed a recently decommissioned HP Compaq dc5750 microtower, pulled the
old drive, and installed two 500G disks.
I had to tweak a couple things from the original instructions I sent over,
but the below is confirmed for Ubuntu.
*IMPORTANT* To use these instructions you must use the Ubuntu alternate
installer disk (not the normal desktop install disk). I believe the
normal (GUI) installer disk has a raid option setup, but I never trust
those things. Since this is important, let's do it right (and not let the
installer make bad assumptions). Also the alternate disk has all the
commands required, and the regular doesn't (although you could apt-get
mdadm on the regular if needed)
I used the latest ubuntu-11.10-alternate-i386 in this example (the ncurses
based installer made me fell a little more at home (Slackware-ish
look/feel - nice :) ).
Boot the alt install disk
select "rescue a broken system"
continue through the prompts until you get to "Device to use as root file
system" -> select "Do not use a root file system"
Rescue operations (menu) -> select: "Execute a shell in the installer
environment"
this will bring up a shell. In this shell you don't need to do any
sudo's, just straight commands.
fdisk /dev/sda
Note that fdisk has a 2TB limit, so if your new disks are >2TB you will
need to use 'parted' instead. If this is the case there is a lot of how
to's about it on the net.
I created 2 partitions (partition 1 for swap (3000M) & partition 2 for /
(450G))
make sure to change both partitions to type FD - Linux RAID Autodetect
I left a handful of G's available (I do this so if you need to replace a
drive from a different brand you have insurance room in case the new drive
size if diff). Write the new partitions to disk. To keep it simple here I
just make a swap & a root partition. You can of course make as many
partitions as you want to suit your needs.
sfdisk -d /dev/sda | sfdisk --force /dev/sdb
mdadm --create /dev/md0 --level 1 --raid-devices 2 \
/dev/sda1 /dev/sdb1 --metadata=0.90
It will prompt you to "Continue creating array?" -> YES
Do the same for your other partition
mdadm --create /dev/md1 --level 1 --raid-devices 2 \
/dev/sda2 /dev/sdb2 --metadata=0.90
It will prompt you to "Continue creating array?" -> YES
Format your swap partition
mkswap /dev/md0
Reboot the box
shutdown -r now
Boot up the alternate installer disk again & choose the top most option
"Install Ubuntu"
Follow the instructions/prompts until you get to the "Partition Disks"
setup. At this point choose "MANUAL" (bottom option) partition setup.
Raid1 device #0 should already show up as SWAP (mime did). No need to
change anything.
Raid1 device #1 -> select -> choose file sys ext4 (or whatever you like
for a filesys) -> select / as mount point -> Format the partition - > YES
then select finish partitioning & write changes to disk
do u want to boot if degraded -> YES (since grub is on 2 disks MBR this is
OK & you still want to boot if there is a prob so you can repair it. More
importantly you want it to boot either way.)
write to disks - YES
Carry on with the install until (smoke'm if you got'm for awhile)
Install Grub to MBR -> YES
I noticed after I said YES to install it made ref to installing on
/dev/sda & /dev/sdb. That is pretty cool in my book, and no need to do
any post install grub work.
Finished Install & then rebooted without issue.
Log on, open terminal & check raid status
sudo mdadm --detail /dev/md[01]
Here is my output
/dev/md0:
Version : 0.90
Creation Time : Mon Apr 2 15:06:25 2012
Raid Level : raid1
Array Size : 3071936 (2.93 GiB 3.15 GB)
Used Dev Size : 3071936 (2.93 GiB 3.15 GB)
Raid Devices : 2
Total Devices : 2
Preferred Minor : 0
Persistence : Superblock is persistent
Update Time : Mon Apr 2 16:11:39 2012
State : clean
Active Devices : 2
Working Devices : 2
Failed Devices : 0
Spare Devices : 0
UUID : 96e1dd7d:49e2cd24:f9bec2d2:7e3a2625 (local to host dt10)
Events : 0.18
Number Major Minor RaidDevice State
0 8 1 0 active sync /dev/sda1
1 8 17 1 active sync /dev/sdb1
/dev/md1:
Version : 0.90
Creation Time : Mon Apr 2 15:08:15 2012
Raid Level : raid1
Array Size : 471859136 (450.00 GiB 483.18 GB)
Used Dev Size : 471859136 (450.00 GiB 483.18 GB)
Raid Devices : 2
Total Devices : 2
Preferred Minor : 1
Persistence : Superblock is persistent
Update Time : Mon Apr 2 16:02:48 2012
State : active, resyncing
Active Devices : 2
Working Devices : 2
Failed Devices : 0
Spare Devices : 0
Rebuild Status : 10% complete
UUID : abe603cd:984cea28:f9bec2d2:7e3a2625 (local to host dt10)
Events : 0.7
Number Major Minor RaidDevice State
0 8 2 0 active sync /dev/sda2
1 8 18 1 active sync /dev/sdb2
I wanted to test if it would boot one one drive, so I fired it up with one
dive unplugged. It booted, so I shutdown reinstalled the unplugged disk.
This is why it shows Rebuild Status : 10% complete on /dev/md1,
otherwise it would have showed State: Clean had I done this command before
I unplugged the disk (sorry - forgot).
So here ya go. Confirmed working Raid1 how to for Ubuntu. You can now
proceed on knowing you have RAID1 setup just the way you want!
Don't tell the boss, but now I have a Ubuntu box to play with :)
Good Luck!
Mr. B-o-B
--
"I want to learn the ways of the Source, and be a Jedi like my Father"