Rock on, Mike. <div><br></div><div>Gratz on finding your way through that, and getting it working.  I enjoyed reading your summary. :) </div><div><br></div><div>-Rob</div><div><br><br><div class="gmail_quote">On Thu, May 3, 2012 at 4:56 PM, Mike Miller <span dir="ltr"><<a href="mailto:mbmiller+l@gmail.com" target="_blank">mbmiller+l@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Thanks for all of the helpful suggestions.  A guy usually known as gkey (or "gk") was most helpful.  The crazy thing about my problem was that it wasn't all that difficult or tricky and most of the info on the web was steering me into all kinds of unneeded complexities.  It turned out that these were the issues:<br>

<br>
(1) disks of more than 2TB have different requirements than disks of 2TB or less -- we can't use the usual DOS partitioning and fdisk with the bigger disks, so we have to use GPT partitioning and gdisk instead<br>
<br>
(2) When using GPT partitions we can't add /boot to the RAID1, and /boot has to have partition type "BIOS boot partition".<br>
<br>
(3) I was also told to leave 10MB empty at the beginning of both drives. I didn't test that those 10MB were actually needed, but I did leave that space and everything worked, so I'm inclined to believe the gkey's claim that it is necessary.<br>

<br>
<br>
If you are trying to do this, I hope you won't be intimidated by the instructions below.  They aren't as long as they seem because most of it is output, not input.  It's pretty straightforward.<br>
<br>
<br>
When installing Ubuntu 12.04 on the 3TB RAID1, it helps a lot to have cgdisk and gdisk handy, but they are not on the Live CD and they are not available via apt-get.  That's an annoyance Ubuntu should fix.  I had to compile them on another machine.  I then used scp to copy them over after booting to Live CD.  One trick was that I had to compile gdisk and cgdisk, but I only had an older Ubuntu box to compile it on.  When I copied the compiled binary for cgdisk to the running Ubuntu 12.04 Live CD, it didn't work because it was looking for older versions of various /usr/lib/libicu* files.  I had to edit the Makefile to fix that, which is a lot easier than you would think, especially given that they had instructions on how to fix this problem in the README file.  To make this easier for you, if you need to do this work, I put the two binaries here:<br>

<br>
<a href="http://genetsim.org/gdisk/" target="_blank">http://genetsim.org/gdisk/</a><br>
<br>
...and you can download both of them and make them executable using this pair of commands:<br>
<br>
wget <a href="http://genetsim.org/gdisk/%7Bc,%7Dgdisk" target="_blank">http://genetsim.org/gdisk/{c,}<u></u>gdisk</a><br>
chmod 755 {c,}gdisk<br>
<br>
The UTF support is turned off, so if you want to use special UTF characters in formatting your disks, this may not be for you.  If you want to know exactly what I did to make them work on Ubuntu, here's the info: I was using gdisk_0.8.1.orig.tar.gz.  The Makefile diff of changes is below (if you are not familiar, all this tells you is that any line shown below beginning with "<" was changed into the subsequent line beginning with ">").  Basically, I removed "-D USE_UTF16" and any option beginning with "-licu".<br>

<br>
$ diff Makefile_original Makefile<br>
4c4<br>
< CXXFLAGS+=-Wall -D_FILE_OFFSET_BITS=64 -D USE_UTF16<br>
---<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
CXXFLAGS+=-Wall -D_FILE_OFFSET_BITS=64<br>
</blockquote>
18c18<br>
<       $(CXX) $(LIB_OBJS) gdisk.o gpttext.o $(LDFLAGS) -licuio -licuuc -luuid -o gdisk<br>
---<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
      $(CXX) $(LIB_OBJS) gdisk.o gpttext.o $(LDFLAGS) -luuid -o gdisk<br>
</blockquote>
22c22<br>
<       $(CXX) $(LIB_OBJS) cgdisk.o gptcurses.o $(LDFLAGS) -licuio -licuuc -luuid -lncurses -o cgdisk<br>
---<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
      $(CXX) $(LIB_OBJS) cgdisk.o gptcurses.o $(LDFLAGS) -luuid -lncurses -o cgdisk<br>
</blockquote>
26c26<br>
<       $(CXX) $(LIB_OBJS) sgdisk.o gptcl.o $(LDFLAGS) -licuio -licuuc -luuid -lpopt -o sgdisk<br>
---<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
      $(CXX) $(LIB_OBJS) sgdisk.o gptcl.o $(LDFLAGS) -luuid -lpopt -o sgdisk<br>
</blockquote>
<br>
<br>
The other thing you'll need to install is mdadm, for setting up the RAID1. That's a lot easier to get, if you have network connectivity:<br>
<br>
sudo apt-get install mdadm<br>
   this installs postfix, choose "local" installation, and default name<br>
<br>
<br>
Now use cgdisk, e.g.,...<br>
<br>
sudo cgdisk /dev/sda<br>
<br>
...which I think is the easiest option, to set up the partitions.  You want to use blocks of a certain size so that you get proper alignment. Don't just make up numbers, actually multiply things out.  It wants you to supply a certain number of 512-byte blocks.  My HDD uses larger blocks, I think 2048-byte, but I did everything in terms of sets of 2048 512-byte blocks (mebibytes or MiBs).  In other words, in cgdisk, a mebibyte (MiB: 1,048,576 bytes, formerly known as a megabyte) is 2048 and 10 MiB is 20480 because that's the number of 512-byte blocks you'll be using.<br>

<br>
In my simple case, I just wanted to leave 10 MiB free at the beginning, then have a 200 MiB /boot, a 32 GiB swap and the rest as /, but leaving about 100 MiB free at the end.  To do that I used these numbers of 512 byte blocks...<br>

<br>
start at 20480 add 409600<br>
start at default add 67108864<br>
start at default add <a href="tel:5792787343" value="+15792787343" target="_blank">5792787343</a><br>
<br>
...and these were the sizes, types and names of my partitions:<br>
<br>
Part. #     Size        Partition Type            Partition Name<br>
------------------------------<u></u>------------------------------<u></u>----<br>
            10.0 MiB    free space<br>
   1        200.0 MiB   BIOS boot partition       /boot<br>
   2        32.0 GiB    Linux RAID                swap<br>
   3        2.7 TiB     Linux RAID                /<br>
            101.0 MiB   free space<br>
<br>
Probably you will be like me and your first disk will be /dev/sda and the second will be /dev/sdb.  I ran cgdisk to get what you see above on /dev/sda then ran exactly the same numbers on /dev/sdb.<br>
<br>
After running cgdisk, including writing the partitions (essential) and quitting, I checked what I had in gdisk as follows:<br>
<br>
$ sudo ./gdisk -l /dev/sda<br>
GPT fdisk (gdisk) version 0.8.1<br>
<br>
Partition table scan:<br>
  MBR: protective<br>
  BSD: not present<br>
  APM: not present<br>
  GPT: present<br>
<br>
Found valid GPT with protective MBR; using GPT.<br>
Disk /dev/sda: 5860533168 sectors, 2.7 TiB<br>
Logical sector size: 512 bytes<br>
Disk identifier (GUID): 73650704-727A-4863-B31D-<u></u>997F8201656C<br>
Partition table holds up to 128 entries<br>
First usable sector is 34, last usable sector is 5860533134<br>
Partitions will be aligned on 2048-sector boundaries<br>
Total free space is 227294 sectors (111.0 MiB)<br>
<br>
Number  Start (sector)    End (sector)  Size       Code  Name<br>
   1           20480          430079   200.0 MiB   EF02  /boot<br>
   2          430080        67538943   32.0 GiB    FD00  swap<br>
   3        67538944      5860326286   2.7 TiB     FD00  /<br>
<br>
The result is identical for /dev/sdb, except for GUID:<br>
Disk identifier (GUID): 60C3D922-19EC-4A14-8D6B-<u></u>6F932CDC9D9C<br>
<br>
Once you have the partitions, you can run mdadm to create the RAID1.  For me that went like this (first swap, then /):<br>
<br>
sudo mdadm --create /dev/md0 --level 1 --raid-devices 2 /dev/sda2 /dev/sdb2 --metadata=1.2<br>
sudo mdadm --create /dev/md1 --level 1 --raid-devices 2 /dev/sda3 /dev/sdb3 --metadata=1.2<br>
<br>
Note that I did not add /boot to the RAID -- that will cause Ubuntu to fail to load GRUB, so don't do that.<br>
<br>
Next I set up the swap on the new swap partition on the RAID1:<br>
<br>
$ sudo mkswap /dev/md0<br>
mkswap: /dev/md0: warning: don't erase bootbits sectors<br>
        on whole disk. Use -f to force.<br>
Setting up swapspace version 1, size = 33553332 KiB<br>
no label, UUID=559c4534-1d13-47d0-af72-<u></u>e802d3d7f944<br>
<br>
<br>
Now leave the Live CD and boot with the Alternate CD.  You need the Alternate CD to install Ubuntu on the RAID.  When you get to the screen where it asks you to partition your disks, the swap should be all set. Make sure to identify the RAID partition you will use for / and tell Ubuntu that / goes there and what format to use (e.g., ext4) -- setting up / is done only in the RAID, not in the /dev/sda or /dev/sdb.  You might also check that both of the /boot partitions on /dev/sda and /dev/sdb are set up properly -- both called /boot and both using the "BIOS boot partition" type.<br>

<br>
When you get the question about whether to install GRUB on both disks or just one of them (it says something about what happens whether you want to boot with a degraded drive) -- I chose both so that I will be able to boot with a degraded drive and see what's going on with it.  I'm not always in the office and if it is running I can see it remotely.<br>

<br>
When Ubuntu installed GRUB, it then installed it on both /dev/sda and /dev/sdb.  I rebooted, everything looked great.<br>
<br>
Thanks, everybody! (esp., gkey).<br>
<br>
Mike<br>
______________________________<u></u>_________________<br>
TCLUG Mailing List - Minneapolis/St. Paul, Minnesota<br>
<a href="mailto:tclug-list@mn-linux.org" target="_blank">tclug-list@mn-linux.org</a><br>
<a href="http://mailman.mn-linux.org/mailman/listinfo/tclug-list" target="_blank">http://mailman.mn-linux.org/<u></u>mailman/listinfo/tclug-list</a><br>
</blockquote></div><br></div>