LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 01-16-2009, 01:53 PM   #1
debian newbie
LQ Newbie
 
Registered: Mar 2007
Posts: 20

Rep: Reputation: 0
mdadm problem


Hi,

I have a debian etch 2.6.18-6-686. I have two SATA 160Gb drives and am a problem with mdadm. I had this server all set up and then I had to put in a new drive and now I cannot get them to sync up. Here are some print outs:
more /proc/mdstat
Personalities : [raid1]
md5 : active raid1 sda8[1]
97699200 blocks [2/1] [_U]

md4 : active raid1 sda7[1]
22458752 blocks [2/1] [_U]

md3 : active raid1 sda6[1]
29294400 blocks [2/1] [_U]

md2 : active raid1 sda5[1]
2835328 blocks [2/1] [_U]

md1 : active raid1 sda2[1]
96320 blocks [2/1] [_U]

md0 : active raid1 sda1[1]
1951744 blocks [2/1] [_U]

unused devices: <none>
So I they wasy I understand this, I only have one drive active. So I then do:

mdadm -D /dev/md0
/dev/md0:
Version : 00.90.03
Creation Time : Tue Jul 17 02:28:50 2007
Raid Level : raid1
Array Size : 1951744 (1906.32 MiB 1998.59 MB)
Device Size : 1951744 (1906.32 MiB 1998.59 MB)
Raid Devices : 2
Total Devices : 1
Preferred Minor : 0
Persistence : Superblock is persistent

Update Time : Fri Jan 16 11:50:04 2009
State : clean, degraded
Active Devices : 1
Working Devices : 1
Failed Devices : 0
Spare Devices : 0

UUID : 303b86c1:8c96a4f6:e4d89378:93e63358
Events : 0.688462

Number Major Minor RaidDevice State
0 0 0 0 removed
1 8 1 1 active sync /dev/sda1
So I try:
willow:~# mdadm /dev/md0 -r /dev/sda1 -a /dev/sda1
mdadm: hot remove failed for /dev/sda1: Device or resource busy

What am I doing wrong??
Thanx for any help you can provide.

Lisa
 
Old 01-16-2009, 04:02 PM   #2
rayfordj
Member
 
Registered: Feb 2008
Location: Texas
Distribution: Fedora, RHEL, CentOS
Posts: 488

Rep: Reputation: 78
You are trying to remove the only running member of your md0 array: /dev/sda1.
It does not currently have a listed failed partner to remove. You should create a partition to add to the array. Maybe an sdb1?
 
Old 01-16-2009, 04:10 PM   #3
debian newbie
LQ Newbie
 
Registered: Mar 2007
Posts: 20

Original Poster
Rep: Reputation: 0
So does this mean both of my drives are working together and syncing? How can I tell? What does the 2/1 mean in this printout, (this is from more /proc/mdstat)? I thought it meant that only one of my drives were being used? Am I way off??

md0 : active raid1 sda1[1]
1951744 blocks [2/1] [_U]

Thanx Lisa
 
Old 01-16-2009, 04:29 PM   #4
rayfordj
Member
 
Registered: Feb 2008
Location: Texas
Distribution: Fedora, RHEL, CentOS
Posts: 488

Rep: Reputation: 78
Quote:
Originally Posted by debian newbie View Post
So does this mean both of my drives are working together and syncing? How can I tell? What does the 2/1 mean in this printout, (this is from more /proc/mdstat)? I thought it meant that only one of my drives were being used? Am I way off??

md0 : active raid1 sda1[1]
1951744 blocks [2/1] [_U]

Thanx Lisa
You are correct. The array is currently running degraded because it is missing a mirror partner.

md0 is an active raid1 composed of 2 members with currently only 1 participant which is sda1.

When you add a replacement member to the array it should start synchronizing immediately. Running 'cat /proc/mdstat' should indicate this with a new line being presented that reports the sync's progress.


[EDIT: It is entirely possible to create a mirror with missing member(s) which may also explain the current situation if you do not have a 2nd physical disk to mirror with sda. If that is the case then this is expected.]

Last edited by rayfordj; 01-16-2009 at 04:32 PM.
 
Old 01-16-2009, 04:50 PM   #5
debian newbie
LQ Newbie
 
Registered: Mar 2007
Posts: 20

Original Poster
Rep: Reputation: 0
Yes i do have the second drive installed, I just can't or don't know how to sync them up!??! I just did a cfdisk and to me it is only stating that I have one drive??
Name Flags Part Type FS Type [Label] Size (MB)
-----------------------------------------------------------------------------------------------------------------------------------------------------------
sda1 Primary Linux raid autodetect 1998.75
sda2 Primary Linux raid autodetect 98.71
sda3 Primary Linux swap / Solaris 1998.75
sda5 Logical Linux raid autodetect 2903.53
sda6 Logical Linux raid autodetect 29997.60
sda7 Logical Linux raid autodetect 22997.89
sda8 Logical Linux raid autodetect 100044.09

I have tried to boot the other drive but it does not work. I am a loss as to what to try next.
Lisa
 
Old 01-16-2009, 07:42 PM   #6
rayfordj
Member
 
Registered: Feb 2008
Location: Texas
Distribution: Fedora, RHEL, CentOS
Posts: 488

Rep: Reputation: 78
What about 'fdisk -l', 'blkid', 'sfdisk -l', 'cat /proc/scsi/scsi', 'ls -d /sys/block/sd*', 'cfdisk -l', 'dmesg | grep -e "sd[a-z]"', ...? Do any of those report the 2nd disk? The 2nd disk physically detected at the BIOS-level during POST?



maybe try this, after getting a backup of any data on md1|sda2 (i choose this one because it is ~100MB).
assuming you have disk sdb which is same drive capacity and partitioning scheme as sda:
Code:
mdadm /dev/md1 -a /dev/sdb2
watch -n .5 cat /proc/mdstat
 
  


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
MDADM screws up the LVM partitions? Can't mount the LVMs after mdadm stopped alirezan1 Linux - Newbie 3 11-18-2008 04:42 PM
mdadm - pvcreate, problem. zaxonus Linux - Software 1 11-06-2008 08:45 AM
unable to load MDADM module BUT mdadm works?!?!?! alirezan1 Linux - Software 2 09-08-2008 07:58 PM
mdadm says "mdadm: /dev/md1 not identified in config file" when booting FC7 raffeD Linux - Server 1 08-11-2008 11:47 AM
Problem booting with grub + mdadm spectra Linux - General 1 04-04-2007 06:34 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 12:04 AM.

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