1

besides:

head -2 /dev/dm-16 | strings | grep ^id 

how can I find that which device belongs to a given MD RAID1 array?

1

Try this command:

cat /proc/mdstat
  • doesn't shows which was the pair of the device that is in the RAID1 md. – gasko peter Aug 20 '13 at 18:58
  • md1 : active raid1 sdb2[1] sda2[0] => sdb2, sda2 ? isn't that what you're referring to by "pair"? – Shimi Aug 20 '13 at 19:15
  • it only shows 1 sdXX device :) I'm searching for it's pair – gasko peter Aug 20 '13 at 19:17
  • sdb2, sda2, are two devices. no? – Shimi Aug 20 '13 at 19:18
1

How about

mdadm -D /dev/mdX

replacing X by your actual RAID-1 device number.

  • doesn't shows which was the pair of the device that is in the RAID1 md. – gasko peter Aug 20 '13 at 19:09
  • @gaskopeter It's been a while since I managed a RAID array. Can you please tell me what the output of mdadm -D /dev/mdX show on your box? and what you expected it to show? – Joseph R. Aug 20 '13 at 19:10
0

since RAID1 means there are two identical disks, so checksums need to match

[root@SERVER ~]# head -100 /dev/sdb3|cksum
2207220453 6836
[root@SERVER ~]# head -100 /dev/sda3|cksum
2207220453 6836
[root@SERVER ~]# 
  • hope it's a really good answer for every situation... metadata/etc could differ?? – gasko peter Aug 26 '13 at 7:50
0

blkid(8) should be informative.

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.