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 have RAID1 with 2 3TB disks.

The general problem as I see is that for some reason this array have some problems with naming. It has md/19 md/19_0 and md127

My goal is to make this 3TB Raid1 automounted at system startup AND to not have mess with names.

I think that several command outputs might be helpful:

mdadm --detail --scan

ARRAY /dev/md123 metadata=0.90 UUID=d8e13d02:42e15bdd:a7ee4ba9:042b6983
ARRAY /dev/md124 metadata=0.90 UUID=bebc5077:0da808fe:c80b1c52:51eaca74
ARRAY /dev/md/19_0 metadata=1.0 name=19 UUID=106e24cd:72126345:5561dd7d:adcb9008
ARRAY /dev/md1 metadata=0.90 UUID=4606ff38:63608632:8ddec75b:5960982f
ARRAY /dev/md125 metadata=0.90 UUID=3f29bed2:645f6822:fd798925:a402af0e
ARRAY /dev/md120 metadata=0.90 UUID=0233db18:f9536858:df0b9ebc:7a95f77b
ARRAY /dev/md126 metadata=0.90 UUID=fb5d1ab5:0f1b97ec:06b1995e:dfaa5770
ARRAY /dev/md122 metadata=0.90 UUID=6ad2e633:3e80e563:531dca77:79bf01e0
ARRAY /dev/md121 metadata=0.90 UUID=aab82674:d97f02db:6a840782:80492029

mdadm --examine --scan

ARRAY /dev/md/19 metadata=1.0 UUID=106e24cd:72126345:5561dd7d:adcb9008 name=19
ARRAY /dev/md124 UUID=bebc5077:0da808fe:c80b1c52:51eaca74
ARRAY /dev/md123 UUID=d8e13d02:42e15bdd:a7ee4ba9:042b6983
ARRAY /dev/md1 UUID=4606ff38:63608632:8ddec75b:5960982f
ARRAY /dev/md126 UUID=fb5d1ab5:0f1b97ec:06b1995e:dfaa5770
ARRAY /dev/md120 UUID=0233db18:f9536858:df0b9ebc:7a95f77b
ARRAY /dev/md125 UUID=3f29bed2:645f6822:fd798925:a402af0e
ARRAY /dev/md122 UUID=6ad2e633:3e80e563:531dca77:79bf01e0
ARRAY /dev/md121 UUID=aab82674:d97f02db:6a840782:80492029

cat /proc/mdstat

Personalities : [raid1]
md121 : active raid1 sde2[1] sdf2[0]
      293065664 blocks [2/2] [UU]

md122 : active raid1 sde1[1] sdf1[0]
      195318144 blocks [2/2] [UU]

md126 : active raid1 sdc5[0] sdd5[1]
      7823552 blocks [2/2] [UU]

md120 : active raid1 sdc6[0] sdd6[1]
      1959808 blocks [2/2] [UU]

md125 : active raid1 sdc7[0] sdd7[1]
      20659456 blocks [2/2] [UU]

md1 : active raid1 sdd3[1] sdc3[0]
      1959808 blocks [2/2] [UU]

md127 : active raid1 sdb1[1] sda1[0]
      2930266412 blocks super 1.0 [2/2] [UU]

md124 : active raid1 sdc1[0] sdd1[1]
      803136 blocks [2/2] [UU]

md123 : active raid1 sdc2[0] sdd2[1]
      2939776 blocks [2/2] [UU]

unused devices: <none>

blkid

...
/dev/md127: UUID="612fb467-a78d-4b40-b8c5-745055c5a1ee" TYPE="ext4"
...

fdisk -l

...
Disk /dev/md127: 3000.6 GB, 3000592805888 bytes
...

cat /etc/fstab

UUID=05b64e47-1afb-47b9-ba4d-fa1e6fd27f7f /                       ext3    defaults,noatime         1 1
UUID=30ca72f8-6723-49d1-8f76-f66aa3b0cdf0 /boot                   ext3    defaults        1 2
#/dev/md122                               /home                   ext3    defaults,nodev  0 2
#/dev/md126                               /var/lib/mysql          ext3    defaults        0 2
#/dev/md120                               /tmp                    ext3    defaults        0 2
tmpfs                   /dev/shm                tmpfs   defaults        0 0
devpts                  /dev/pts                devpts  gid=5,mode=620  0 0
sysfs                   /sys                    sysfs   defaults        0 0
proc                    /proc                   proc    defaults        0 0
#/dev/md1               swap                    swap    deafults        0 0

mdadm --detail /dev/md127

/dev/md127:
        Version : 1.0
  Creation Time : Wed Jan  5 00:11:25 2011
     Raid Level : raid1
     Array Size : 2930266412 (2794.52 GiB 3000.59 GB)
  Used Dev Size : 2930266412 (2794.52 GiB 3000.59 GB)
   Raid Devices : 2
  Total Devices : 2
    Persistence : Superblock is persistent

    Update Time : Wed Feb  6 19:19:40 2013
          State : clean
 Active Devices : 2
Working Devices : 2
 Failed Devices : 0
  Spare Devices : 0

           Name : 19
           UUID : 106e24cd:72126345:5561dd7d:adcb9008
         Events : 7

    Number   Major   Minor   RaidDevice State
       0       8        1        0      active sync   /dev/sda1
       1       8       17        1      active sync   /dev/sdb1

Thank you in advance.

share|improve this question

1 Answer 1

up vote 1 down vote accepted

Forget device names — they never were reliable anyway.

Just use UUIDs in /etc/fstab, like / and /boot uses. For example instead of

/dev/md127 /home ext4 defaults,nodev  0 2

use:

UUID=612fb467-a78d-4b40-b8c5-745055c5a1ee /home ext4 defaults,nodev  0 2

This is what your distribution would use if you would have created RAID volumes in installer.


You can change a name, for example to /dev/md/home, while assembling an array. But don't use it in fstab — it can change when booting to a LiveCD, changing hostname etc. UUIDs are better.

share|improve this answer
    
1 more fast question is that I'v read about something called dracut and initramfs. What is this? –  Jevgeni Smirnov Feb 7 '13 at 6:27
    
I'm sorry, but you're supposed to try to find out yourself. You know - google it. We're trying to help with specific problems here - we don't explain what program X is for - but we can point you to program X if it can help with your specific problem Y. –  Tometzky Feb 7 '13 at 7:55
    
Ok I will ask in another way: should I update initramfs .img file or entry /etc/fstab/ would suffice? Or should I update the mdadm.conf file? –  Jevgeni Smirnov Feb 7 '13 at 8:29
1  
/etc/fstab only –  Tometzky Feb 7 '13 at 10:51
1  
And use "blkid /dev/md127" to find out the UUID of the partition to put into /etc/fstab for your /boot or / file systems. –  tgharold Sep 28 '13 at 4:46

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.