LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware
User Name
Password
Linux - Hardware This forum is for Hardware issues.
Having trouble installing a piece of hardware? Want to know if that peripheral is compatible with Linux?

Notices


Reply
  Search this Thread
Old 09-09-2008, 05:12 AM   #1
neiljt
LQ Newbie
 
Registered: Nov 2002
Location: Canewdon, UK
Distribution: CentOS
Posts: 27

Rep: Reputation: 15
Storage Question - mdadm - residual metadata for "old" /dev/md0


I've just finished building an 8-device array using CentOS 5.2, and on trying to create my mdadm.conf have discovered a we oddity.

Prior to building any arrays for real, I installed the OS on a single drive, and built a test array of 4 drives using small slices so that I could force some drive failures and practice rebuilding. The test array was designated /dev/md0.

I have since slid in a new motherboard (needed more SATA ports), and reinstalled the OS on twin drives using RAID1. This is on

/dev/md0 /boot
/dev/md1 /
/dev/md2 swap

I've created my real RAID6 array as /dev/md3.

This is the strange part:

[root@bliksem ~]# mdadm -Es -v
ARRAY /dev/md0 level=raid1 num-devices=2 UUID=9e7833eb:c7c22cd4:1bcba113:ae80dbcd
devices=/dev/sdb1,/dev/sda1
ARRAY /dev/md1 level=raid1 num-devices=2 UUID=ff3bf0ba:24a21629:5b68137b:a3bd55d7
devices=/dev/sdb2,/dev/sda2
ARRAY /dev/md2 level=raid1 num-devices=2 UUID=e175a3ce:362a070d:a8aac7d7:40cda321
devices=/dev/sdb3,/dev/sda3
ARRAY /dev/md0 level=raid6 num-devices=4 UUID=ccefbbf1:83ae4ab4:c29eb3ff:82ed9be2
devices=/dev/sdg
ARRAY /dev/md3 level=raid6 num-devices=8 UUID=e3734679:3058bd92:e6685ba9:d8161fe0
devices=/dev/sdj1,/dev/sdi1,/dev/sdh1,/dev/sdg1,/dev/sdf1,/dev/sde1,/dev/sdd1,/dev/sdc1


See that second /dev/md0? Yes, that seems to be left over from the practice device I built a couple of weeks ago. After doing a complete rebuild on fresh drives, I can only think that this is residual config data left on one of the drives in the array (of 8).

Now if I try to examine "/dev/md0", I get info on the valid device:

[root@bliksem ~]# mdadm -D /dev/md0
/dev/md0:
Version : 00.90.03
Creation Time : Mon Sep 8 05:27:06 2008
Raid Level : raid1
Array Size : 1020032 (996.29 MiB 1044.51 MB)
Used Dev Size : 1020032 (996.29 MiB 1044.51 MB)
Raid Devices : 2
Total Devices : 2
Preferred Minor : 0
Persistence : Superblock is persistent

Update Time : Mon Sep 8 21:29:59 2008
State : clean
Active Devices : 2
Working Devices : 2
Failed Devices : 0
Spare Devices : 0

UUID : 9e7833eb:c7c22cd4:1bcba113:ae80dbcd
Events : 0.4

Number Major Minor RaidDevice State
0 8 1 0 active sync /dev/sda1
1 8 17 1 active sync /dev/sdb1

While that's reassuring, I would like to get rid of the erroneous entry for /dev/md0 seen above.

Other than writing lots of /dev/zero to /dev/sdg, is there some way to clean up my metadata?

Thanks.
 
Old 09-09-2008, 08:32 AM   #2
ChrisAbela
Member
 
Registered: Mar 2008
Location: Malta
Distribution: Slackware
Posts: 572

Rep: Reputation: 154Reputation: 154
I am not sure I can help but here is my contribution:
Can we see /proc/mdstat please?
/etc/mdadm.conf is not needed nowadays, ....I suppose.
Maybe you might solve your "issue" by removing md0 and building it again.
 
Old 09-09-2008, 08:50 AM   #3
neiljt
LQ Newbie
 
Registered: Nov 2002
Location: Canewdon, UK
Distribution: CentOS
Posts: 27

Original Poster
Rep: Reputation: 15
Sure, here 'tis, and all looks healthy to me:

root@bliksem:~> cat /proc/mdstat
Personalities : [raid1] [raid6] [raid5] [raid4]
md0 : active raid1 sdb1[1] sda1[0]
1020032 blocks [2/2] [UU]

md2 : active raid1 sdb3[1] sda3[0]
20482752 blocks [2/2] [UU]

md3 : active raid6 sdj1[7] sdi1[6] sdh1[5] sdg1[4] sdf1[3] sde1[2] sdd1[1] sdc1[0]
5860559616 blocks level 6, 128k chunk, algorithm 2 [8/8] [UUUUUUUU]

md1 : active raid1 sdb2[1] sda2[0]
222692928 blocks [2/2] [UU]

unused devices: <none>


Hmm, I'm a little reluctant to remove md0, that hosting my /boot partition ... possibly I could do it by breaking the mirror & booting off one disk only, though I haven't tried this before, so am considering alternatives first :-)

Thanks.
 
Old 09-09-2008, 09:48 AM   #4
neiljt
LQ Newbie
 
Registered: Nov 2002
Location: Canewdon, UK
Distribution: CentOS
Posts: 27

Original Poster
Rep: Reputation: 15
OK, I worked it out ...

Just in case anyone else gets as bugged as I did by this, here is what I did to get rid of the residual metadata on /dev/sdg. Some may be inclined to let a trivial thing like this go by, but I'm about to invest a lot of trust in this array, so I want it to be set up right.

I took a guess that the superblock on /dev/sdg (no longer relevant) is what we want to erase. There is no data on this array as yet, so this will be a. quicker (no need to umount, mark device as faulty, etc.), & b. less risky -- if it all goes horribly wrong I can recreate the device and file system -- takes about 18 hours.

The following command only ever listed the valid mds:

root@bliksem:~> mdadm --detail --scan
ARRAY /dev/md1 level=raid1 num-devices=2 UUID=ff3bf0ba:24a21629:5b68137b:a3bd55d7
ARRAY /dev/md3 level=raid6 num-devices=8 UUID=e3734679:3058bd92:e6685ba9:d8161fe0
ARRAY /dev/md2 level=raid1 num-devices=2 UUID=e175a3ce:362a070d:a8aac7d7:40cda321
ARRAY /dev/md0 level=raid1 num-devices=2 UUID=9e7833eb:c7c22cd4:1bcba113:ae80dbcd

Device is not mounted, so stop it abruptly:

root@bliksem:~> mdadm --stop /dev/md3
mdadm: stopped /dev/md3

Overwrite the superblock:

root@bliksem:~> mdadm --zero-superblock --force /dev/sdg -v

(yes, that's the verbose output from the --zero-superblock option)

Check the md device list:

root@bliksem:~> mdadm -Es
ARRAY /dev/md0 level=raid1 num-devices=2 UUID=9e7833eb:c7c22cd4:1bcba113:ae80dbcd
ARRAY /dev/md1 level=raid1 num-devices=2 UUID=ff3bf0ba:24a21629:5b68137b:a3bd55d7
ARRAY /dev/md2 level=raid1 num-devices=2 UUID=e175a3ce:362a070d:a8aac7d7:40cda321
ARRAY /dev/md3 level=raid6 num-devices=8 UUID=e3734679:3058bd92:e6685ba9:d8161fe0

It's gone :-)

Reassemble & restart the array:

root@bliksem:~> mdadm --assemble -v /dev/md3 /dev/sdc1 /dev/sdd1 /dev/sde1 /dev/sdf1 /dev/sdg1 /dev/sdh1 /dev/sdi1 /dev/sdj1
mdadm: looking for devices for /dev/md3
mdadm: /dev/sdc1 is identified as a member of /dev/md3, slot 0.
mdadm: /dev/sdd1 is identified as a member of /dev/md3, slot 1.
mdadm: /dev/sde1 is identified as a member of /dev/md3, slot 2.
mdadm: /dev/sdf1 is identified as a member of /dev/md3, slot 3.
mdadm: /dev/sdg1 is identified as a member of /dev/md3, slot 4.
mdadm: /dev/sdh1 is identified as a member of /dev/md3, slot 5.
mdadm: /dev/sdi1 is identified as a member of /dev/md3, slot 6.
mdadm: /dev/sdj1 is identified as a member of /dev/md3, slot 7.
mdadm: added /dev/sdd1 to /dev/md3 as 1
mdadm: added /dev/sde1 to /dev/md3 as 2
mdadm: added /dev/sdf1 to /dev/md3 as 3
mdadm: added /dev/sdg1 to /dev/md3 as 4
mdadm: added /dev/sdh1 to /dev/md3 as 5
mdadm: added /dev/sdi1 to /dev/md3 as 6
mdadm: added /dev/sdj1 to /dev/md3 as 7
mdadm: added /dev/sdc1 to /dev/md3 as 0
mdadm: /dev/md3 has been started with 8 drives.

Final check:

root@bliksem:~> mdadm -Es -v
ARRAY /dev/md0 level=raid1 num-devices=2 UUID=9e7833eb:c7c22cd4:1bcba113:ae80dbcd
devices=/dev/sdb1,/dev/sda1
ARRAY /dev/md1 level=raid1 num-devices=2 UUID=ff3bf0ba:24a21629:5b68137b:a3bd55d7
devices=/dev/sdb2,/dev/sda2
ARRAY /dev/md2 level=raid1 num-devices=2 UUID=e175a3ce:362a070d:a8aac7d7:40cda321
devices=/dev/sdb3,/dev/sda3
ARRAY /dev/md3 level=raid6 num-devices=8 UUID=e3734679:3058bd92:e6685ba9:d8161fe0
devices=/dev/sdj1,/dev/sdi1,/dev/sdh1,/dev/sdg1,/dev/sdf1,/dev/sde1,/dev/sdd1,/dev/sdc1

It's still gone.
 
Old 09-09-2008, 12:57 PM   #5
ChrisAbela
Member
 
Registered: Mar 2008
Location: Malta
Distribution: Slackware
Posts: 572

Rep: Reputation: 154Reputation: 154
I am happy to read that you sorted it out to your satisfaction and thanks for posting the detailed solution for future readers.

Chris
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
mdadm says "mdadm: /dev/md1 not identified in config file" when booting FC7 raffeD Linux - Server 1 08-11-2008 11:47 AM
RAID5 using mdadm, how to mount /dev/md0? ggduff Linux - Software 4 11-14-2007 01:59 AM
mdadm: no device found for /dev/md0 doorito Linux - Server 1 04-09-2007 09:21 PM
The meaning of "/dev/md0: No md super block found"? PhillipHuang Linux - Software 6 01-10-2007 07:37 PM
mdadm: no devices found for /dev/md0 humbletech99 Linux - General 2 06-19-2006 04:28 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware

All times are GMT -5. The time now is 11:22 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration