Results 1 to 14 of 14
  1. #1
    Join Date
    Nov 2005
    Location
    Canada
    Posts
    16

    * First Post: Raid1; quick question

    First timer here!

    I'm setting up a Raid1 array using 2x 120Gb IDE drives (plugged in seperate controllers) and FC3.

    I created separate partitions for /boot, /, /var, /tmp, /home, /backup, swap.
    I can get the box up and running fine, and the drive mirrors itself on the 2nd drive perfectly.

    Since this is my first raid setup, I am trying to get a feel of how I would have to deal with a drive faliure.

    What is the acutal process in replacing, for example, the primary master drive, when it fails?

    I was under the impression that I could simply shut down, replace the drive, boot in rescue and, BOOM, partitionning would start and reconstruction would happen ... this is not the case obviously it would have been too easy!

    Do I absolutely need to run a SPARE drive in the box or can I replace a failed drive "on the fly"? ... Do I have to re-partiton the drive manually? How do I mount the unpartitioned drive to partition it ? ....

    I'm a bit confused at this point.
    Any help/inout is greatly appreciated!

    Dan

  2. #2
    Join Date
    Jan 2005
    Location
    Cardiff, UK
    Posts
    375
    Depends whether you are using hardware or software RAID.
    It also depends on the individual software/hardware i believe.
    Some hardware solutions have a menu to boot into to restore data partitions. You shouldn't have to manually partition a new drive. With FC3 (and other variations) there will be a service called mdadm running. This monitors your RAID setup and will alert you if something goes wrong. When a drive is connected I believe this will attempt to restore an existing array - assuming it is setup to do so.

    It is a good idea to play with the config before putting it into a production machine.
    Peter Hall
    Tera Web Hosting
    UK Web Hosting and Backup Storage

  3. #3
    Join Date
    Nov 2005
    Location
    Canada
    Posts
    16

    not sure...

    This is definatly software raid. I am using mdadm which seems to come standard with FC3.

    When a drive fails, mdadm marks it as Failed...But nothing happens. If I had a "spare" drive configured in my raid setup, they say it would automatically start to rebuild...

    I am basically looking for redundancy with a 2 hard drive setup ...

    Anybody got ideas?


    Thanks !

    Dan

  4. #4
    Join Date
    Dec 2004
    Location
    New York City, NY, USA
    Posts
    735
    Quote Originally Posted by WestGat
    I was under the impression that I could simply shut down, replace the drive, boot in rescue and, BOOM, partitionning would start and reconstruction would happen ... this is not the case obviously it would have been too easy!
    It depends how the RAID1 is setup (I don't recall what CentOS/Fedora do exactly), but that is all that you should need to do.

    Do you have only one raid device? Are you using LVM? etc...

  5. #5
    Join Date
    Apr 2003
    Location
    Melbourne, AU
    Posts
    539
    Quote Originally Posted by WestGat
    What is the acutal process in replacing, for example, the primary master drive, when it fails?

    I was under the impression that I could simply shut down, replace the drive, boot in rescue and, BOOM, partitionning would start and reconstruction would happen ... this is not the case obviously it would have been too easy!

    Do I absolutely need to run a SPARE drive in the box or can I replace a failed drive "on the fly"? ... Do I have to re-partiton the drive manually? How do I mount the unpartitioned drive to partition it ? ....
    From my (limited) experience with Linux md, you have to partition the new drive, then add them back into the RAID1 array.

    Cumbersome, but it's fair enough I suppose, since Linux really doesn't know whether a foreign drive is part of the array or otherwise.

    Do I absolutely need to run a SPARE drive in the box or can I replace a failed drive "on the fly"? ... Do I have to re-partiton the drive manually? How do I mount the unpartitioned drive to partition it ? ....
    Once the drive has been marked as failed,
    1) Physically remove faulty drive
    2) Install new drive
    3) Partition new drive to reflect the prior partition table
    4) mdadm --manage --add the new partitions to the md devices
    5) Wait for the array to rebuild and check if it's all good

  6. #6
    Join Date
    Nov 2005
    Location
    Canada
    Posts
    16

    damn!!:P

    Once the drive has been marked as failed,
    1) Physically remove faulty drive
    2) Install new drive
    3) Partition new drive to reflect the prior partition table
    4) mdadm --manage --add the new partitions to the md devices
    5) Wait for the array to rebuild and check if it's all good
    which brings me to my next 2 questions.
    - if I slap in a new unpartitionned drive in there... how do I mount and partition it ?!

    - if it's the primary master drive that fails and I replace it, the OS will not boot from secondary master... grub will only boot from the secondary master drive if no primary master drive is present ... i would have to do a cable swap ...

    man... i though this was gonna be easy and super-managable ... if I have 20 hosting servers to manage like this... software raid might be a hassle ... might have to go hardware raid . hehehe


    BTW. my usual setup looks like this:

    md0 -> /dev/hda1 + /dev/hdc1 (/boot)
    md1 -> /dev/hda2 + /dev/hdc2 (/)
    md2 -> /dev/hda3 + /dev/hdc3 (/home)
    md3 -> /dev/hda4 + /dev/hdc4 (/var)
    md4 -> /dev/hda6 + /dev/hdc6 (/usr)
    md5 -> /dev/hda7 + /dev/hdc7 (/tmp)
    md6 -> /dev/hda8 + /dev/hdc8 (/backup)
    md7 -> /dev/hda9 + /dev/hdc9 (swap)

    If I have to keep track of all partition label+sizes for all boxes that are running raid ..in case they fail .. this is starting to get complicated! lol

    Any more ideas!?

    Thanks for you help guys!

  7. #7
    Join Date
    Apr 2003
    Location
    Melbourne, AU
    Posts
    539
    1) if I slap in a new unpartitionned drive in there... how do I mount and partition it ?!

    2) if it's the primary master drive that fails and I replace it, the OS will not boot from secondary master... grub will only boot from the secondary master drive if no primary master drive is present ... i would have to do a cable swap ...
    #2: Let's say you have:

    Primary master: A (which fails)
    2ndary master: B

    If you're replacing A with a completely fresh drive, your BIOS should fall over to boot from B (which presumably, had GRUB installed by you beforehand).

    #1: Uhh, like fdisk? It's no different from partitioning any other new drive.

  8. #8
    Join Date
    Nov 2005
    Location
    Canada
    Posts
    16

    yep...

    yes, i tried fdisk...but since the drive is not mounted ... i can't really go:
    fdisk /dev/hda ...

    how would I go about partitionning it?

    Thanks
    Dan

  9. #9
    Join Date
    Apr 2003
    Location
    Melbourne, AU
    Posts
    539
    What do you mean by "mounting" a drive?

  10. #10
    Join Date
    Nov 2005
    Location
    Canada
    Posts
    16

    ...

    well,

    when the drive is unpartitionned and un-mounted, /dev/hda does not exist, so I am unable to use: fdisk /dev/hda

    i might be missing something here!

    ... maybe it has something to do with fstab ...

    Thanks again.

    Dan

  11. #11
    Join Date
    Apr 2003
    Location
    Melbourne, AU
    Posts
    539
    Quote Originally Posted by WestGat
    when the drive is unpartitionned and un-mounted, /dev/hda does not exist, so I am unable to use: fdisk /dev/hda
    No, when the drive is unpartitioned (and therefore unmounted), and you run fdisk on it, you'll get a message:

    Device contains neither a valid DOS partition table, nor Sun, SGI or OSF disklabel. Building a new DOS disklabel.
    If you've used Windows, it's the parallel to the 'initialize new disk" wizard.

  12. #12
    Join Date
    Nov 2005
    Location
    Canada
    Posts
    16

    :)

    Cool.
    I'll give that a try and let you know!

    Thanks.!!


    Dan

  13. #13
    Join Date
    Nov 2005
    Location
    Canada
    Posts
    16

    Nice!!!!!!

    wanted to let you know I got it working.

    i used the" dd" command to clone the partition table (and data) from the working drive to the new drive.
    I added the partitions to the array and mdadm then started to rebuild.

    All good!!

    Thanks

    Dan

  14. #14
    Thanks guys, these are the exact questions I was going to ask until I found what I needed in this thread.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •