Linux – Fedora. Properly configure RAID1. Raid has name /md127

fedoralinuxmountraidsoftware-raid

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.

Best Answer

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.