LinuxQuestions.org
Go Job Hunting at the LQ Job Marketplace
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 01-16-2009, 03:49 PM   #1
indienick
Senior Member
 
Registered: Dec 2005
Location: London, ON, Canada
Distribution: Arch, Ubuntu, Slackware, OpenBSD, FreeBSD
Posts: 1,853

Rep: Reputation: 65
mdadm RAID1 failed and not rebuilding


I am having a problem with a RAID1 array I set up a while ago, for work. It was working fine up until someone unknowing walked past the server one night and thought it was weird that that particular computer had been left on, and proceeded to turn it off via the power button.

I rebuilt it once, by re-formatting the faulty drive (device1) and activating the array.

It rebooted once, since then, and never re-built.

I can mount device0 without a problem, as long as mdadm is not running. This is the only error I get when I try to start the array:
Code:
W: mdadm: using ARRAYs defined in existing mdadm.conf.
Assembling MD array md0...failed (no devices found).
Generating udev events for MD arrays...done.
That second line is weirding me out.

Here is my /etc/mdadm/mdadm.conf file:
Code:
# mdadm.conf
#
# Please refer to mdadm.conf(5) for information about this file.
#

# by default, scan all partitions (/proc/partitions) for MD superblocks.
# alternatively, specify devices to scan, using wildcards if desired.
DEVICE /dev/sda1 /dev/sdb1
DEVICE partitions

# auto-create devices with Debian standard permissions
CREATE owner=root group=disk mode=0660 auto=yes

# automatically tag new arrays as belonging to the local system
HOMEHOST <system>

# instruct the monitoring daemon where to send mail alerts
MAILADDR root

# definitions of existing MD arrays
ARRAY /dev/md0 devices=/dev/sda1,/dev/sdb1 level=raid1 auto=yes
        super-minor=0

# auto-create devices with Debian standard permissions
CREATE owner=root group=disk mode=0660 auto=yes

# automatically tag new arrays as belonging to the local system
HOMEHOST <system>

# instruct the monitoring daemon where to send mail alerts
MAILADDR root

# This file was auto-generated on Thu, 14 Aug 2008 05:27:52 -0400
# by mkconf $Id: mkconf 261 2006-11-09 13:32:35Z madduck $
 
Old 01-19-2009, 03:00 PM   #2
mostlyharmless
Senior Member
 
Registered: Jan 2008
Distribution: Slackware -current (multilib) with kernel 3.16.2
Posts: 1,566
Blog Entries: 13

Rep: Reputation: 178Reputation: 178
So, I'm not clear on this, is the RAID array running degraded, or not at all?
What does mdadm -D /dev/md0 say?
and can you use mdadm manually? as in
mdadm -B /dev/md0 /dev/sda1 /dev/sdb1
 
Old 01-19-2009, 03:19 PM   #3
indienick
Senior Member
 
Registered: Dec 2005
Location: London, ON, Canada
Distribution: Arch, Ubuntu, Slackware, OpenBSD, FreeBSD
Posts: 1,853

Original Poster
Rep: Reputation: 65
Here is what I get:
Code:
$ sudo mdadm -D /dev/md0
mdadm: md device /dev/md0 does not appear to be active.

$ sudo mdadm -B /dev/md0 /dev/sda1 /dev/sdb1
mdadm: no raid-disks specified.
 
Old 01-19-2009, 03:32 PM   #4
mostlyharmless
Senior Member
 
Registered: Jan 2008
Distribution: Slackware -current (multilib) with kernel 3.16.2
Posts: 1,566
Blog Entries: 13

Rep: Reputation: 178Reputation: 178
How about mdadm -A /dev/md0 --level=1 -n 2 /dev/sda1 /dev/sdb1
 
Old 01-19-2009, 03:41 PM   #5
indienick
Senior Member
 
Registered: Dec 2005
Location: London, ON, Canada
Distribution: Arch, Ubuntu, Slackware, OpenBSD, FreeBSD
Posts: 1,853

Original Poster
Rep: Reputation: 65
Quote:
Originally Posted by mostlyharmless View Post
How about mdadm -A /dev/md0 --level=1 -n 2 /dev/sda1 /dev/sdb1
Code:
mdadm:option --level not valid in assemble mode
If I leave off the "--level=1" and "-n 2" arguments, I am left with:
Code:
$ sudo mdadm -A /dev/md0 /dev/sda1 /dev/sdb1
mdadm: no recogniseable superblock on /dev/sda1
mdadm: /dev/sda1 has no superblock - assembly aborted
...yet, I can mount /dev/sda1 by itself, without a problem (but it is not mounted while I'm trying these commands ).

Last edited by indienick; 01-19-2009 at 03:46 PM.
 
Old 01-19-2009, 06:02 PM   #6
mostlyharmless
Senior Member
 
Registered: Jan 2008
Distribution: Slackware -current (multilib) with kernel 3.16.2
Posts: 1,566
Blog Entries: 13

Rep: Reputation: 178Reputation: 178
Sorry I messed up the syntax. Guess I meant you can try those -l 1 -n 2 options with -B. Or you can start from scratch if you have no data and use mdadm -C /dev/md0 -l 1 -n 2 /dev/sda1 /dev/sdb1.

I did have a question though:
You can mount /dev/sda1 by itself? You mean using
Quote:
mount /dev/sda1 /mnt
or something like that? If that's the case, then the filesystem is no longer "mdraid" but is "ext3" or "reiserfs" or whatever it is. You shouldn't be able to mount your raid pieces with mount...
Or did you mean you can mount it with mdadm in degraded mode like
Quote:
mdadm - A /dev/md0 /dev/sda1 missing

Last edited by mostlyharmless; 01-19-2009 at 06:05 PM.
 
Old 01-20-2009, 08:32 AM   #7
indienick
Senior Member
 
Registered: Dec 2005
Location: London, ON, Canada
Distribution: Arch, Ubuntu, Slackware, OpenBSD, FreeBSD
Posts: 1,853

Original Poster
Rep: Reputation: 65
Gotcha.

Okay, so running
Code:
$ sudo mdadm -B /dev/md0 --level=1 -n 2 /dev/sda1 /dev/sdb1
did work, but it made the RAID array read-only, and the resync "PENDING".

When I say I can mount the RAID pieces, I mean I can mount the first drive in the array: /dev/sda1. The RAID died a while ago (somebody couldn't understand why the computer was still on, so they thought they would be helpful and turn it off, forcefully) and I was freaking out because most (if not all) of our engineering data is on there. I tried mounting the first drive (without doing anything to it) and it mounted without a hitch:
Code:
$ sudo mount -t jfs /dev/sda1 /srv/smb
 
Old 01-20-2009, 11:45 AM   #8
mostlyharmless
Senior Member
 
Registered: Jan 2008
Distribution: Slackware -current (multilib) with kernel 3.16.2
Posts: 1,566
Blog Entries: 13

Rep: Reputation: 178Reputation: 178
I think when you mounted the piece with mount that was working you desync'd it, regardless of the fact that you "didn't do anything to it". Presumably rebuilding and allowing the sync to complete ought to fix the problem...
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
Migrate to a raid1 with mdadm Ossar Linux - Software 2 08-19-2008 12:55 PM
mdadm error creating raid1 Ezplan Fedora 7 07-26-2007 11:35 AM
rebuilding a drive kicked from RAID1 array ocularbob Linux - Software 1 02-12-2007 11:12 PM
Software RAID1 with mdadm bujecas Debian 0 10-26-2006 10:56 AM
raid1 using mdadm? help plz akadidm Linux - Hardware 3 06-09-2005 05:58 AM


All times are GMT -5. The time now is 03:58 PM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration