Results 1 to 5 of 5

Thread: [Correction] LHN Ch26 Software RAID: fix array not assembling after plugging new hdd

  1. #1

    Lightbulb [Correction] LHN Ch26 Software RAID: fix array not assembling after plugging new hdd


    LHN Ch26 Linux Software RAID is THE manual for softraiding on Linux. There's just no other complete manual over the web!

    But after having followed the guide i've been suffering from a very annoying problem: when i add (or remove) drives to my computer, the sd* numbering of drives changes and array won't assemble! I had to update my mdadm.conf every time i add/remove non-raid drives.

    Recently i decided to invest some time to overcome this issue. And i've found a solution!

    In section "Create the mdadm.conf Configuration File" the command reads:

    mdadm --detail --scan --verbose > /etc/mdadm.conf
    Solution: remove "--verbose" and that's it!

    mdadm --detail --scan > /etc/mdadm.conf
    It's the "--verbose" parameter that defines what /dev/sd* partitions to use. If you don't provide those manually with "--verbose" then... mdadm will find the partitions automatically!

    This is possible because of two facts:
    1) All partitions of a raid array share same UUID. So mdadm doesn't need to know the sd* names to understand what partitions are part of what array.
    2) Default mdadm.conf already has the "devices" directive defined with value "partitions". This forces mdadm to scan through all available partitions if none are defined manually.

    PS I also suggest either changing "/etc/mdadm.conf" to "/etc/mdadm/mdadm.conf" or making a note that the Ubuntu/Debian users should be aware of the path.

  2. #2
    Administrator Advisor peter's Avatar
    Join Date
    Apr 2004
    Thanks, I'll note the change.

    I plan to update the pages on Dovecot, Squid, LVM and RAID this weekend based on FC14, Ubuntu will follow shortly afterwards.

  3. #3
    Administrator Advisor peter's Avatar
    Join Date
    Apr 2004
    lolmaus, I have made the change. Thanks for providing the note.

  4. #4
    I've made a sad mistake. Should be ">>" instead of ">". This mistake leads to mdadm.conf being purged.

    Sorry for that.

  5. #5
    I've ruined a whole day trying to figure out why else my array is falling apart on reboot. Instead of md0, an unmountable md127 appeared after every reboot.

    I tried EVERYTHING and everything failed. I've studied 100 of first Google results there were a lot of people having this issue on various Linux distros (Ubuntu, Gentoo, RHEL, Fedora...) but their solutions didn't work for me.

    Then FINALLY i found a solution!

    To resolve the issue, open mdadm.conf and replace
    HOMEHOST <system>
    HOMEHOST andrey
    (that's my linux box hostname)

    That subtle change resolved the issue that was preventing my array from mounting.

    The explaination is that this "<system>" token won't resolve into actual hostname during initramfs boot stage. Thus, the array parts are inentified as belonging to another system. Mdadm still tries to assemble them giving reverse name md127 but produces a broken array (UUID of the array is different and its unmountable). When mdadm.conf is parsed afterwards, array parts are already occupied so the
    correct array won't assemble.

    So my suggestion is to include this HOMEHOST trick into your beautiful guide.
    Last edited by lolmaus; 07-26-2011 at 04:21 PM.

Similar Threads

  1. Software RAID with /boot & / fs
    By bpb in forum Linux - Software, Applications & Programming
    Replies: 1
    Last Post: 04-30-2011, 05:18 PM
  2. Software Raid
    By Ragman in forum Windows - General Topics
    Replies: 1
    Last Post: 01-15-2007, 07:25 PM
  3. Computer case for raid array
    By vvx in forum General Chat
    Replies: 7
    Last Post: 08-19-2004, 02:06 PM
  4. Debian Software Raid 1
    By pyfsapple in forum Linux - General Topics
    Replies: 0
    Last Post: 10-15-2003, 09:39 AM
  5. Software RAID in Linux
    By in forum Linux - Hardware, Networking & Security
    Replies: 9
    Last Post: 04-11-2002, 03:03 PM


Posting Permissions

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