2

I have in mdadm.conf the following:

ARRAY /dev/md/root level=raid1 num-devices=2 UUID=331de03d:8ba39777:3b664baf:36366f33

But here is mdadm.conf example with the following:

ARRAY /dev/md0 UUID=3aaa0122:29827cfa:5331ad66:ca767371

In my current centos I have two raid partitions: /dev/md126, and /dev/md127.

The questions:

  1. Why do I have /dev/md/root instead of /dev/mdX?
  2. As I understand in linux I must have some partition in order to mount it. For example /dev/sda1, /dev/md1. After that I need some mount point, where to mount it, for example, /, /boot etc. And of course we must set the relation between partition and mount point, what we do in fstab file. How is this relation (partition<->mount point) is set with raids in my situation.

P.S. I've read a lot of questions about md12X problem but I didn't find the clear explanation of 1)why it happens 2)how dangerous it is 3)what should be done. That's why before doing something I want to understand the backend of the problem.

1

Answering only the second part (I noticed /dev/md/root in your question Raid devices are mounted with different UUID and mused on that but without an answer.)

How is this relation (partition<->mount point) is set with raids in my situation

md126 : active raid1 sdb2[1] sda2[0]
     974711616 blocks super 1.0 [2/2] [UU]
     bitmap: 1/8 pages [4KB], 65536KB chunk

You have two physical partitions /dev/sda2 and /dev/sdb2. These are mirrored as RAID 1 creating a device /dev/md126.

At some point I assume that your CentOS box has mapped this to /dev/md/root (or maybe /dev/md/swap; I can't tell from information in either this or your other question).

The filesystem was created on /dev/md/root, so that is what you have to mount in /etc/fstab. This in turn is /dev/md126 (or maybe /dev/md127) and the RAID subsystem ensures that all data written to the filesystem is mirrored to the two disk physical partitions.

You cannot (and must not attempt to) mount one half of the RAID, i.e. /dev/sdb2 or /dev/sda2 as a filesystem. Even assuming it is possible the act of mounting it may write data to the filesystem (particularly the superblock), leading to an inconsistent mirror between the two halves of the RAID device.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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