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.
Hey!
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:
Solution: remove "--verbose" and that's it!Code:mdadm --detail --scan --verbose > /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!Code:mdadm --detail --scan > /etc/mdadm.conf
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.
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.
lolmaus, I have made the change. Thanks for providing the note.
I've made a sad mistake. Should be ">>" instead of ">". This mistake leads to mdadm.conf being purged.
Sorry for that.![]()
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!
https://bugs.launchpad.net/ubuntu/+s...dm/+bug/136252
To resolve the issue, open mdadm.conf and replace
withCode:HOMEHOST <system>
(that's my linux box hostname)Code:HOMEHOST andrey
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.
Bookmarks