1

Centos 7.1 64. This is what I have: Two raids, but not md0 and md1

[root@localhost]# cat /proc/mdstat
Personalities : [raid1] 
md126 : active raid1 sdb2[1] sda2[0]
      974711616 blocks super 1.0 [2/2] [UU]
      bitmap: 1/8 pages [4KB], 65536KB chunk

md127 : active raid1 sdb1[1] sda1[0]
      2048000 blocks super 1.2 [2/2] [UU]

unused devices: <none>

This is my fstab [root@localhost]# cat /etc/fstab

#
# /etc/fstab
# Created by anaconda on Sun Apr 26 22:00:45 2015
#
# Accessible filesystems, by reference, are maintained under '/dev/disk'
# See man pages fstab(5), findfs(8), mount(8) and/or blkid(8) for more info
#
UUID=ec671046-c512-4992-9a91-ac58ab2d0b31 /   ext4    defaults        1 1
UUID=30993a21-eff2-4c8d-9fe5-d7055e6e3ed0 swap swap    defaults        0 0

And raid configuration

[root@localhost]# cat /etc/mdadm.conf
# mdadm.conf written out by anaconda
MAILADDR root
AUTO +imsm +1.x -all
ARRAY /dev/md/root level=raid1 num-devices=2 UUID=331de03d:8ba39777:3b664baf:36366f33
ARRAY /dev/md/swap level=raid1 num-devices=2 UUID=f387cddd:e96384df:1a4f0d19:7d7fd10e

As we see the UUID in fstab and mdadm are different.

The questions:

  1. Why does system work and "/" is mounted - we do see that UUID are different.
  2. If I change UUID in fstab conf (to UUID from mdadm conf) what will it have as a result?
3

You can see the UUIDs for the various different components (physical disk, RAID, etc.) by running blkid

Here is a sample from one of my systems:

/dev/sda3: UUID="NAzDnw-zu08-iSt9-v76l-njNc-NElx-8RFzVg" TYPE="LVM2_member"
/dev/sdc3: UUID="215b625b-8531-26ed-c610-01f443697250" UUID_SUB="087e72db-ff75-bcbe-5b41-8f79a6bb54f5" LABEL="server:3" TYPE="linux_raid_member"
/dev/md3: UUID="04eaa265-36e2-4f24-93f9-6eb88a55e56b" TYPE="crypto_LUKS"
/dev/mapper/server_crypt_md3: UUID="GnOlBC-BS1f-32BV-PAP7-Tzsy-KaMm-kQDMpj" TYPE="LVM2_member"
/dev/mapper/server_crypt_md3-iso_images: LABEL="iso_images" UUID="99880b2b-25f8-46a0-b7b9-20ec7da53c32" TYPE="ext4"

You can see that the UUID for the filesystem labelled "iso_images" is different to the UUID for the underlying components (LVM, LUKS crypto, RAID). Each UUID allows the appropriate subsystem to identify its known disk partitions and devices and to assemble the necessary parts correctly.

You can quickly see that if you were change the UUID in /etc/fstab from one referring to a filesystem to one referring to, say, a RAID 1 device you would be referencing the wrong device and it wouldn't work. (Worse, under some circumstances, it might be possible to appear to mount a RAID 1 member as a filesystem but doing so would unverifiably corrupt the RAID 1 array and therefore its mirrored filesystem.)

3

The UUID you use in the /etc/fstab is for identifying the filesystem on the raid (it was created when you formatted your raid). The UUID you see in the /etc/mdadm.conf is on every device (disc/partition) that is part of a particular raid to identify it, for mdadm that these devices belong to a particular raid. That UUID is created when the RAID is created, and written to all devices that constitute the RAID during creation, as well as to any devices later added to the RAID (as replacement or extension).

If you change the fstab to include some of the mdadm.conf UUIDs, mount will not be able to find the device indicated by that UUID.

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.