Rock on, Mike.

Gratz on finding your way through that, and getting it working.  I enjoyed
reading your summary. :)

-Rob


On Thu, May 3, 2012 at 4:56 PM, Mike Miller <mbmiller+l at gmail.com> wrote:

> 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:
>
> (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
>
> (2) When using GPT partitions we can't add /boot to the RAID1, and /boot
> has to have partition type "BIOS boot partition".
>
> (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.
>
>
> 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.
>
>
> 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:
>
> http://genetsim.org/gdisk/
>
> ...and you can download both of them and make them executable using this
> pair of commands:
>
> wget http://genetsim.org/gdisk/{c,}**gdisk<http://genetsim.org/gdisk/%7Bc,%7Dgdisk>
> chmod 755 {c,}gdisk
>
> 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".
>
> $ diff Makefile_original Makefile
> 4c4
> < CXXFLAGS+=-Wall -D_FILE_OFFSET_BITS=64 -D USE_UTF16
> ---
>
>> CXXFLAGS+=-Wall -D_FILE_OFFSET_BITS=64
>>
> 18c18
> <       $(CXX) $(LIB_OBJS) gdisk.o gpttext.o $(LDFLAGS) -licuio -licuuc
> -luuid -o gdisk
> ---
>
>>      $(CXX) $(LIB_OBJS) gdisk.o gpttext.o $(LDFLAGS) -luuid -o gdisk
>>
> 22c22
> <       $(CXX) $(LIB_OBJS) cgdisk.o gptcurses.o $(LDFLAGS) -licuio -licuuc
> -luuid -lncurses -o cgdisk
> ---
>
>>      $(CXX) $(LIB_OBJS) cgdisk.o gptcurses.o $(LDFLAGS) -luuid -lncurses
>> -o cgdisk
>>
> 26c26
> <       $(CXX) $(LIB_OBJS) sgdisk.o gptcl.o $(LDFLAGS) -licuio -licuuc
> -luuid -lpopt -o sgdisk
> ---
>
>>      $(CXX) $(LIB_OBJS) sgdisk.o gptcl.o $(LDFLAGS) -luuid -lpopt -o
>> sgdisk
>>
>
>
> 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:
>
> sudo apt-get install mdadm
>   this installs postfix, choose "local" installation, and default name
>
>
> Now use cgdisk, e.g.,...
>
> sudo cgdisk /dev/sda
>
> ...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.
>
> 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...
>
> start at 20480 add 409600
> start at default add 67108864
> start at default add 5792787343
>
> ...and these were the sizes, types and names of my partitions:
>
> Part. #     Size        Partition Type            Partition Name
> ------------------------------**------------------------------**----
>            10.0 MiB    free space
>   1        200.0 MiB   BIOS boot partition       /boot
>   2        32.0 GiB    Linux RAID                swap
>   3        2.7 TiB     Linux RAID                /
>            101.0 MiB   free space
>
> 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.
>
> After running cgdisk, including writing the partitions (essential) and
> quitting, I checked what I had in gdisk as follows:
>
> $ sudo ./gdisk -l /dev/sda
> GPT fdisk (gdisk) version 0.8.1
>
> Partition table scan:
>  MBR: protective
>  BSD: not present
>  APM: not present
>  GPT: present
>
> Found valid GPT with protective MBR; using GPT.
> Disk /dev/sda: 5860533168 sectors, 2.7 TiB
> Logical sector size: 512 bytes
> Disk identifier (GUID): 73650704-727A-4863-B31D-**997F8201656C
> Partition table holds up to 128 entries
> First usable sector is 34, last usable sector is 5860533134
> Partitions will be aligned on 2048-sector boundaries
> Total free space is 227294 sectors (111.0 MiB)
>
> Number  Start (sector)    End (sector)  Size       Code  Name
>   1           20480          430079   200.0 MiB   EF02  /boot
>   2          430080        67538943   32.0 GiB    FD00  swap
>   3        67538944      5860326286   2.7 TiB     FD00  /
>
> The result is identical for /dev/sdb, except for GUID:
> Disk identifier (GUID): 60C3D922-19EC-4A14-8D6B-**6F932CDC9D9C
>
> Once you have the partitions, you can run mdadm to create the RAID1.  For
> me that went like this (first swap, then /):
>
> sudo mdadm --create /dev/md0 --level 1 --raid-devices 2 /dev/sda2
> /dev/sdb2 --metadata=1.2
> sudo mdadm --create /dev/md1 --level 1 --raid-devices 2 /dev/sda3
> /dev/sdb3 --metadata=1.2
>
> Note that I did not add /boot to the RAID -- that will cause Ubuntu to
> fail to load GRUB, so don't do that.
>
> Next I set up the swap on the new swap partition on the RAID1:
>
> $ sudo mkswap /dev/md0
> mkswap: /dev/md0: warning: don't erase bootbits sectors
>        on whole disk. Use -f to force.
> Setting up swapspace version 1, size = 33553332 KiB
> no label, UUID=559c4534-1d13-47d0-af72-**e802d3d7f944
>
>
> 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.
>
> 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.
>
> When Ubuntu installed GRUB, it then installed it on both /dev/sda and
> /dev/sdb.  I rebooted, everything looked great.
>
> Thanks, everybody! (esp., gkey).
>
> Mike
> ______________________________**_________________
> TCLUG Mailing List - Minneapolis/St. Paul, Minnesota
> tclug-list at mn-linux.org
> http://mailman.mn-linux.org/**mailman/listinfo/tclug-list<http://mailman.mn-linux.org/mailman/listinfo/tclug-list>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.mn-linux.org/pipermail/tclug-list/attachments/20120503/0aaa004c/attachment-0001.html>