On Tue, October 12, 2010 8:35 pm, Matthias Johnson wrote:
> I have recently built some test centos servers using software raid 1 and I
> noticed things that perhaps those more familiar can assist with.  First
> off sfdisk is a real time saver for cloning a partition scheme allowing
> you to quickly rebuild a failed array.

sfdisk is also very useful for working with partitions in a script.

> In any case my two drive raid was rather simple, two partitions
> consisting of swap and / .  I would fail sda and
> would get a grub boot error.  In the GUI centos install I was pretty
> certain I installed grub to both drives but perhaps the mbr only goes
> to one.

Yeah, the MBR portion of GRUB only gets installed onto one of the drives. 
I had the same problem when I did this.

> I cleared that issue up by running:
>
> /bin/grub
> device (hd*) /dev/sd*
> root (hd*)
> setup (hd*)

Another way to clear this up is to use 'dd' to manually copy over the MBR
section of the 1st drive that GRUB gets installed to onto the mirror
drive.  If your method above works, that's a lot cleaner.

> To set a drive failure I just disconnected the data rather than cli.
> After reconnecting (powered off for this part off testing) I found the
> swap raid rebuilt without mdadm but the / did not.  My only guess is
> that it is coded in such a way that it knows nothing in swap is needed
> so losing that data is no big deal but it wont make the assumption that
> the two / are mates and rebuild since the may be two different / that
> were accidentally paired thus causing data loss.

swap doesn't really have a "filesystem" on it, but other than that I've
forgotten how mirrored swap works.  It does have to be mirrored also,
because you can't swap memory to a single disk, loose the disk, and then
have everything be okay -- that would be like writing something down,
forgetting it from your head, and then loosing the piece of paper; there
needs to be a "mirror piece of paper".

> The last thing I noticed is fdisk can't seem to recognize a raid
> filesystem.

fdisk understands partitions and partition boundaries, not filesystems.

   -- Chris

--

Chris Knadle
[email protected]

_______________________________________________
Mid-Hudson Valley Linux Users Group                  http://mhvlug.org
http://mhvlug.org/cgi-bin/mailman/listinfo/mhvlug

Upcoming Meetings (6pm - 8pm)                         MHVLS Auditorium
  Nov 3 - Open Source Hardware: Bugs, Beagles and Beyond
  Dec 1 - IBM's Open Client Deployment
  Jan 5 - Building a Comunity Site with Drupal

Reply via email to