[KLUG Members] Mirroring in Ubuntu 7.04 Server.
Mike Williams
knightperson at zuzax.com
Tue Jul 31 13:43:21 EDT 2007
Booting from a RAID and/or LVM'd root partition is tricky. It still
doesn't work without hand-holding on my Gentoo server (which I
fortunately don't reboot very often).
Your config would work, Jason, but it's not the way I would do it. You
took the two drives and created 6 raid sets on the same pair of drives.
My solution was to create three partitions on each drive. A small
mirror set (md0) for /boot, a swap partition on each drive, and the
rest of the space for a mirror that will hold an LVM physical volume.
/root, /home, /tmp, and /var are LVM drives. If the drives happened to
be different sizes I would consider putting /tmp unmirrored on the rest
of the bigger drive since there shouldn't be any important data there.
Having /tmp and swap unmirrored gives you storage efficiency and
performance (in theory, at least) but at the expense of some stability.
If you lose active swap the machine will likely crash, but your data
will be fine on reboot.
Here are some of the details from my system.
cleese ~ # cat /proc/mdstat
Personalities : [raid1]
md1 : active raid1 hdc3[1] hda3[0]
243489088 blocks [2/2] [UU]
md0 : active raid1 hdc1[1] hda1[0]
200704 blocks [2/2] [UU]
unused devices: <none>
cleese ~ # fdisk /dev/hda -l
Disk /dev/hda: 251.0 GB, 251000193024 bytes
255 heads, 63 sectors/track, 30515 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Device Boot Start End Blocks Id System
/dev/hda1 1 25 200781 fd Linux raid
autodetect
/dev/hda2 26 88 506047+ 82 Linux swap / Solaris
/dev/hda3 89 30401 243489172+ fd Linux raid
autodetect
cleese ~ # fdisk /dev/hdc -l
Disk /dev/hdc: 250.0 GB, 250059350016 bytes
255 heads, 63 sectors/track, 30401 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Device Boot Start End Blocks Id System
/dev/hdc1 1 25 200781 fd Linux raid
autodetect
/dev/hdc2 26 88 506047+ 82 Linux swap / Solaris
/dev/hdc3 89 30401 243489172+ fd Linux raid
autodetect
Jason Edward Durrett wrote:
>
> Hi Chris,
>
> The easy way is to do it when you are installing the system. Here are
> my notes from setting up raid with Debian several years ago. You will
> probably need to get to an advanced set up in order to find these options:
>
> First, create a primary partition on each of the disks. Use the entire
> disk and erase its contents. Now, on each disk, IDE0 and IDE1, create
> an identical partion scheme setting each partion to the type of RAID
> device. Using the typical linux partition scheme, we get something
> like this:
> IDE0:
> / 250MB RAID
> / 500GB RAID
> / 4GB RAID
> / 1.5GB RAID
> / 400MB RAID
> / 10GB RAID
> IDE2:
> / 250MB RAID
> / 500GB RAID
> / 4GB RAID
> / 1.5GB RAID
> / 400MB RAID
> / 10GB RAID
> Now, the RAID devices need to be set up. Choose the menu option for
> setting up RAID device. Select type of RAID1 with 2 active devices and
> 0 inactive devices. Match Part1 on IDE0 with Part1 on IDE1. Do this
> with the remaining partitions.
> The last step is setting up the File System on the RAID devices. Set
> the first RAID device to EXT3 mounted on / and continue for /usr /var
> /tmp /swap /home. Note, the swap device should be set to type swap and
> not ext3.
> After this step, the installer takes over and begins installing the
> base system.
>
> The root partition may not have raid enabled on reboot. To enable it,
> type:
> #mdadmin -a /dev/md0
> To fix this problem, first be sure all the partitions are running
> properly:
> # cat /proc/mdstat
> Then, run mkinitrd (run automatically if you choose this time to do a
> kernel upgrade).
> A proper configuration should look like this:
> zues:~# cat /proc/mdstat
> Personalities : [raid1]
> md1 : active raid1 hda5[0] hdb5[1]
> 4883648 blocks [2/2] [UU]
> md2 : active raid1 hda6[0] hdb6[1]
> 2931712 blocks [2/2] [UU]
> md3 : active raid1 hda7[0] hdb7[1]
> 1453760 blocks [2/2] [UU]
> md5 : active raid1 hda9[0] hdb9[1]
> 10000320 blocks [2/2] [UU]
> md0 : active raid1 hda1[0] hdb1[1]
> 272960 blocks [2/2] [UU]
> md4 : active raid1 hda8[0] hdb8[1]
> 393472 blocks [2/2] [UU]
> unused devices:
> zues:~#
>
>
>
> wilky wrote:
>> I have what is probably a simple question. /i hope
>>
>> OK I am looking into running an Ubuntu 7.04 server as a web server. I
>> have 2 IDE hard drive in this pc and here is my question.
>>
>> How do i go about mirroring this system. i would like to install the
>> OS on the mirror. there is no room in this case for another hard
>> drive so I am stuck with 2 drives.
>> I have googled this and the few walk troughs i did find did not work.
>> Hopefully it will be KLUG too the rescue :)
>>
>> PC SPECS:
>> P3 1.2gh
>> 512 PC133 SDRAM
>> 2 x 20GB Seagate hard disks. both IDE one on IDE channel 1 the other
>> on IDE channel 2.
>> Attempted OS: Ubuntu Server 7.04 Command line only.
>>
>> Thanks in advance,
>> Chris
>>
>>
>> --
>> "I have not failed. I've just found 10,000 ways that won't work."
>> - Thomas Alva Edison (1847-1931)
>> ------------------------------------------------------------------------
>>
>> _______________________________________________
>> Members mailing list
>> Members at kalamazoolinux.org
>>
>>
> ------------------------------------------------------------------------
>
> _______________________________________________
> Members mailing list
> Members at kalamazoolinux.org
>
>
More information about the Members
mailing list