Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I want to create a soft RAID-5 and use UUIDs im the mdadm config file. So I have four disks with 1 partition each that spans the whole disk. But since the partitons don'5 have a filesystem, blkid does not give a UUID. Is there a way to do that?

share|improve this question
add comment

3 Answers 3

up vote 4 down vote accepted

You use the UUID of the RAID5 device on your mdadm.conf, not the UUID for a filesystem.

# mdadmin --detail /dev/md0
/dev/md0:
        Version : 1.2
 ....
           Name : enterprise:0  (local to host enterprise)
           UUID : 7d2bf7e5:dc6edd5c:3ca12e46:8c9e5d4b
         Events : 48

    Number   Major   Minor   RaidDevice State

So I have a mdadm.conf of

ARRAY /dev/md/0 metadata=1.2 UUID=7d2bf7e5:dc6edd5c:3ca12e46:8c9e5d4b name=enterprise:0
share|improve this answer
    
wow thanks a lot. really good answer! –  Daniel Dec 21 '12 at 21:05
add comment

First create your desired raid array with mdadm command. As soon as this is done you will have a UUID for the md. Then you can create a mdadm.conf with

mdadm --examine --scan > /etc/mdadm.conf

Verify later on with ls -l /dev/disk/by-uuid/

share|improve this answer
1  
On some distributions, the config file is on /dev/mdadm/mdadm.conf. Second, I think you meant >>, which would append to the file (just as a comment for other readers here) –  Daniel Dec 21 '12 at 21:20
    
@Daniel youre right thanks for your input –  rhasti Dec 26 '12 at 17:16
add comment

Use the entries in /dev/disk/by-id to reference the parts of the RAID. For example:

/dev/disk/by-id/ata-ST9320423AS_5VH56VSB

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.