Re: Question regarding mdadm.conf

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Lajber Zoltan wrote:
Hi!

On Thu, 17 Feb 2005, Torsten E. wrote:


How does I get those UUID information, to add them to the new
/etc/mdadm.conf?

Try this one: mdadm --detail /dev/md1 | grep UUID

I'd say

  mdadm --detail --brief /dev/md1 | grep -v devices=

-- this will give you all information necessary for mdadm.conf,
you can just redirect output into that file.

Note the grep usage.  Someone will disagree with me here, but
there is a reason why to remove devices= line.  Without it,
output from mdadm looks like (on my system anyway):

ARRAY /dev/md1 level=raid1 num-devices=4 UUID=11e92e45:15fcc4a0:cf62e981:a79de494
   devices=/dev/sda1,/dev/sdb1,/dev/sdc1,/dev/sdd1

Ie, it lists all the devices which are parts of the array.
The problem with this is: if, for any reason (dead drive,
adding/removing drives/controllers etc) the devices will
change, and some /dev/sdXY will point to another device wich
is a part of some other raid array, mdadm will refuse to
assemble this array, saying something in a line of "the
UUIDs does not match, aborting".  Without the "devices="
part but with --scan option, mdadm will search all devices
by its own (based on the DEVICE line in mdadm.conf) - this
is somewhat slower as it will try to open each device in
turn, but safer, as it will find all the present components
no matter what.

Someone correct me if I'm wrong... ;)

/mjt
-
To unsubscribe from this list: send the line "unsubscribe linux-raid" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux RAID Wiki]     [ATA RAID]     [Linux SCSI Target Infrastructure]     [Linux Block]     [Linux IDE]     [Linux SCSI]     [Linux Hams]     [Device Mapper]     [Device Mapper Cryptographics]     [Kernel]     [Linux Admin]     [Linux Net]     [GFS]     [RPM]     [git]     [Yosemite Forum]


  Powered by Linux