software raid 1: how to remove a UUID from a device?
Hi,
after switching from i386 to x86_64, my software RAID-1 partitions
were not discovered automatically as they should have been. It seems
that the physical devices (/dev/sda and /dev/sdb) have UUIDs stored
from when I first tried to create the array, and that may have
confused the automatic detection.
My first try (a couple years ago, when the disks were new) had been to
create a RAID-1 from the two disks and to partition that array later
as needed. But that didn't work, so I created partitions on the disks
and then created RAID-1 arrays from these partitions. Now it looks like this:
Device Boot Start End Blocks Id System
/dev/sda1 1 9119 73248336 fd Linux raid autodetect
/dev/sda2 9120 29788 166023742+ fd Linux raid autodetect
/dev/sda3 29789 36483 53777587+ fd Linux raid autodetect
Device Boot Start End Blocks Id System
/dev/sdb1 1 9119 73248336 fd Linux raid autodetect
/dev/sdb2 9120 29788 166023742+ fd Linux raid autodetect
/dev/sdb3 29789 36483 53777587+ fd Linux raid autodetect
cat:/etc/exim4# mdadm --examine --scan /dev/sda1
ARRAY /dev/md0 level=raid1 num-devices=2 UUID=ca34e190:39db09f0:390edcc4:35d74b5f
cat:/etc/exim4# mdadm --examine --scan /dev/sdb1
ARRAY /dev/md0 level=raid1 num-devices=2 UUID=ca34e190:39db09f0:390edcc4:35d74b5f
cat:/etc/exim4# mdadm --examine --scan /dev/sda2
ARRAY /dev/md1 level=raid1 num-devices=2 UUID=9f9a753b:eb70a81c:5ff8d522:9ec3586b
cat:/etc/exim4# mdadm --examine --scan /dev/sdb2
ARRAY /dev/md1 level=raid1 num-devices=2 UUID=9f9a753b:eb70a81c:5ff8d522:9ec3586b
cat:/etc/exim4# mdadm --examine --scan /dev/sda3
ARRAY /dev/md2 level=raid1 num-devices=2 UUID=ae296907:7c3dc6ef:763a7645:40ee5e12
cat:/etc/exim4# mdadm --examine --scan /dev/sdb3
ARRAY /dev/md2 level=raid1 num-devices=2 UUID=ae296907:7c3dc6ef:763a7645:40ee5e12
cat:/etc/exim4# mdadm --examine --scan /dev/sda
ARRAY /dev/md0 level=raid1 num-devices=2 UUID=c5460893:6fe1b92f:8d76d626:2a523555
cat:/etc/exim4# mdadm --examine --scan /dev/sdb
ARRAY /dev/md0 level=raid1 num-devices=2 UUID=c5460893:6fe1b92f:8d76d626:2a523555
Note that the physical devices /dev/sda and /dev/sdb have UUIDs
stored. How do I remove these UUIDs?
The automatic detection created these entries in
/etc/mdadm/mdadm.conf (I commented them out later):
# definitions of existing MD arrays
#ARRAY /dev/md0 level=raid1 num-devices=2 UUID=c5460893:6fe1b92f:8d76d626:2a523555
#ARRAY /dev/md0 level=raid1 num-devices=2 UUID=ca34e190:39db09f0:390edcc4:35d74b5f
#ARRAY /dev/md1 level=raid1 num-devices=2 UUID=9f9a753b:eb70a81c:5ff8d522:9ec3586b
#ARRAY /dev/md2 level=raid1 num-devices=2 UUID=ae296907:7c3dc6ef:763a7645:40ee5e12
This left me with a /dev/md0 across both disks, fdisk -l showing
non-existent devices /dev/md0p1, /dev/md0p2 etc., the data
inaccessable, a resync started automatically and /dev/md1 and /dev/md2
broken.
After the resync was done, I stopped all md devices and added the
partitions to the md devices manually. Fortunately, I didn't lose any
data ... Now I have /dev/md0, /dev/md1 and /dev/md2 as they were
before. The entries in /etc/mdadm/mdadm.conf probably should look like this:
ARRAY /dev/md0 level=raid1 num-devices=2 metadata=00.90 UUID=ca34e190:39db09f0:390edcc4:35d74b5f
ARRAY /dev/md1 level=raid1 num-devices=2 metadata=00.90 UUID=9f9a753b:eb70a81c:5ff8d522:9ec3586b
ARRAY /dev/md2 level=raid1 num-devices=2 metadata=00.90 UUID=ae296907:7c3dc6ef:763a7645:40ee5e12
Does this look correct?
How do I remove the UUIDs from /dev/sda and /dev/sdb to prevent
the automatic detection from being confused again?
--
"Don't let them, daddy. Don't let the stars run down."
http://adin.dyndns.org/adin/TheLastQ.htm
Reply to: